Index: head/sys/kern/vfs_vnops.c =================================================================== --- head/sys/kern/vfs_vnops.c +++ head/sys/kern/vfs_vnops.c @@ -1457,25 +1457,6 @@ return (0); } -/* generic FIOBMAP2 implementation */ -static int -vn_ioc_bmap2(struct file *fp, struct fiobmap2_arg *arg, struct ucred *cred) -{ - struct vnode *vp = fp->f_vnode; - daddr_t lbn = arg->bn; - int error; - - vn_lock(vp, LK_SHARED | LK_RETRY); -#ifdef MAC - error = mac_vnode_check_read(cred, fp->f_cred, vp); - if (error == 0) -#endif - error = VOP_BMAP(vp, lbn, NULL, &arg->bn, &arg->runp, - &arg->runb); - VOP_UNLOCK(vp, 0); - return (error); -} - /* * File table vnode ioctl routine. */ @@ -1485,6 +1466,7 @@ { struct vattr vattr; struct vnode *vp; + struct fiobmap2_arg *bmarg; int error; vp = fp->f_vnode; @@ -1500,8 +1482,17 @@ *(int *)data = vattr.va_size - fp->f_offset; return (error); case FIOBMAP2: - return (vn_ioc_bmap2(fp, (struct fiobmap2_arg*)data, - active_cred)); + bmarg = (struct fiobmap2_arg *)data; + vn_lock(vp, LK_SHARED | LK_RETRY); +#ifdef MAC + error = mac_vnode_check_read(active_cred, fp->f_cred, + vp); + if (error == 0) +#endif + error = VOP_BMAP(vp, bmarg->bn, NULL, + &bmarg->bn, &bmarg->runp, &bmarg->runb); + VOP_UNLOCK(vp, 0); + return (error); case FIONBIO: case FIOASYNC: return (0);