From cb2d7c85a85791923bd76d6e730efe888d456b05 Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 15 Feb 2007 22:08:35 +0000 Subject: 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 --- sys/fs/ntfs/ntfs_vnops.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'sys/fs/ntfs/ntfs_vnops.c') diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index 0b90b60..bc30044 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -80,6 +80,7 @@ static vop_readdir_t ntfs_readdir; static vop_cachedlookup_t ntfs_lookup; static vop_fsync_t ntfs_fsync; static vop_pathconf_t ntfs_pathconf; +static vop_vptofh_t ntfs_vptofh; int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */ @@ -731,6 +732,26 @@ ntfs_pathconf(ap) /* NOTREACHED */ } +int +ntfs_vptofh(ap) + struct vop_vptofh_args /* { + struct vnode *a_vp; + struct fid *a_fhp; + } */ *ap; +{ + register struct ntnode *ntp; + register struct ntfid *ntfhp; + + ddprintf(("ntfs_fhtovp(): %p\n", ap->a_vp)); + + ntp = VTONT(ap->a_vp); + ntfhp = (struct ntfid *)ap->a_fhp; + ntfhp->ntfid_len = sizeof(struct ntfid); + ntfhp->ntfid_ino = ntp->i_number; + /* ntfhp->ntfid_gen = ntp->i_gen; */ + return (0); +} + /* * Global vfs data structures */ @@ -752,4 +773,5 @@ struct vop_vector ntfs_vnodeops = { .vop_reclaim = ntfs_reclaim, .vop_strategy = ntfs_strategy, .vop_write = ntfs_write, + .vop_vptofh = ntfs_vptofh, }; -- cgit v1.1