diff options
author | pjd <pjd@FreeBSD.org> | 2007-02-15 22:08:35 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-02-15 22:08:35 +0000 |
commit | cb2d7c85a85791923bd76d6e730efe888d456b05 (patch) | |
tree | d0649ac0ff4a69d709b0c801322ed78174e44d1c /sys/fs/nullfs | |
parent | 8442403943388cc79bc6f4b7d43bfe916ee194ef (diff) | |
download | FreeBSD-src-cb2d7c85a85791923bd76d6e730efe888d456b05.zip FreeBSD-src-cb2d7c85a85791923bd76d6e730efe888d456b05.tar.gz |
Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.
This way we may support multiple structures in v_data vnode field within
one file system without using black magic.
Vnode-to-file-handle should be VOP in the first place, but was made VFS
operation to keep interface as compatible as possible with SUN's VFS.
BTW. Now Solaris also implements vnode-to-file-handle as VOP operation.
VFS_VPTOFH() was left for API backward compatibility, but is marked for
removal before 8.0-RELEASE.
Approved by: mckusick
Discussed with: many (on IRC)
Tested with: ufs, msdosfs, cd9660, nullfs and zfs
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 13 | ||||
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 10 |
2 files changed, 10 insertions, 13 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 125c67a..7094cfb 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -63,7 +63,6 @@ static vfs_sync_t nullfs_sync; static vfs_statfs_t nullfs_statfs; static vfs_unmount_t nullfs_unmount; static vfs_vget_t nullfs_vget; -static vfs_vptofh_t nullfs_vptofh; static vfs_extattrctl_t nullfs_extattrctl; /* @@ -344,17 +343,6 @@ nullfs_fhtovp(mp, fidp, vpp) return (null_nodeget(mp, *vpp, vpp)); } -static int -nullfs_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - struct vnode *lvp; - - lvp = NULLVPTOLOWERVP(vp); - return VFS_VPTOFH(lvp, fhp); -} - static int nullfs_extattrctl(mp, cmd, filename_vp, namespace, attrname, td) struct mount *mp; @@ -381,7 +369,6 @@ static struct vfsops null_vfsops = { .vfs_uninit = nullfs_uninit, .vfs_unmount = nullfs_unmount, .vfs_vget = nullfs_vget, - .vfs_vptofh = nullfs_vptofh, }; VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK); diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 4459fe1..fb20667 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -708,6 +708,15 @@ null_getwritemount(struct vop_getwritemount_args *ap) return (0); } +static int +null_vptofh(struct vop_vptofh_args *ap) +{ + struct vnode *lvp; + + lvp = NULLVPTOLOWERVP(ap->a_vp); + return VOP_VPTOFH(lvp, ap->a_fhp); +} + /* * Global vfs data structures */ @@ -728,4 +737,5 @@ struct vop_vector null_vnodeops = { .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, .vop_unlock = null_unlock, + .vop_vptofh = null_vptofh, }; |