From owner-svn-src-head@FreeBSD.ORG Sun Jul 7 15:51:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 58120F22; Sun, 7 Jul 2013 15:51:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4ACF3193A; Sun, 7 Jul 2013 15:51:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r67FpTZd042267; Sun, 7 Jul 2013 15:51:29 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r67FpTBu042266; Sun, 7 Jul 2013 15:51:29 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307071551.r67FpTBu042266@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 7 Jul 2013 15:51:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252956 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jul 2013 15:51:29 -0000 Author: pfg Date: Sun Jul 7 15:51:28 2013 New Revision: 252956 URL: http://svnweb.freebsd.org/changeset/base/252956 Log: Implement SEEK_HOLE/SEEK_DATA for ext2fs. Merged from r236044 on UFS. MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Sun Jul 7 15:50:01 2013 (r252955) +++ head/sys/fs/ext2fs/ext2_vnops.c Sun Jul 7 15:51:28 2013 (r252956) @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -92,6 +93,7 @@ static vop_close_t ext2_close; static vop_create_t ext2_create; static vop_fsync_t ext2_fsync; static vop_getattr_t ext2_getattr; +static vop_ioctl_t ext2_ioctl; static vop_link_t ext2_link; static vop_mkdir_t ext2_mkdir; static vop_mknod_t ext2_mknod; @@ -122,6 +124,7 @@ struct vop_vector ext2_vnodeops = { .vop_fsync = ext2_fsync, .vop_getattr = ext2_getattr, .vop_inactive = ext2_inactive, + .vop_ioctl = ext2_ioctl, .vop_link = ext2_link, .vop_lookup = vfs_cache_lookup, .vop_mkdir = ext2_mkdir, @@ -1427,6 +1430,9 @@ ext2_pathconf(struct vop_pathconf_args * case _PC_NO_TRUNC: *ap->a_retval = 1; return (0); + case _PC_MIN_HOLE_SIZE: + *ap->a_retval = ap->a_vp->v_mount->mnt_stat.f_iosize; + return(0); default: return (EINVAL); } @@ -1702,6 +1708,20 @@ ext2_read(struct vop_read_args *ap) return (error); } +static int +ext2_ioctl(struct vop_ioctl_args *ap) +{ + + switch (ap->a_command) { + case FIOSEEKDATA: + case FIOSEEKHOLE: + return (vn_bmap_seekhole(ap->a_vp, ap->a_command, + (off_t *)ap->a_data, ap->a_cred)); + default: + return (ENOTTY); + } +} + /* * Vnode op for writing. */