summaryrefslogtreecommitdiffstats
path: root/sys/fs/hpfs/hpfs_vnops.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2007-02-15 22:08:35 +0000
committerpjd <pjd@FreeBSD.org>2007-02-15 22:08:35 +0000
commitcb2d7c85a85791923bd76d6e730efe888d456b05 (patch)
treed0649ac0ff4a69d709b0c801322ed78174e44d1c /sys/fs/hpfs/hpfs_vnops.c
parent8442403943388cc79bc6f4b7d43bfe916ee194ef (diff)
downloadFreeBSD-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/hpfs/hpfs_vnops.c')
-rw-r--r--sys/fs/hpfs/hpfs_vnops.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c
index 550f613..ffe13d9 100644
--- a/sys/fs/hpfs/hpfs_vnops.c
+++ b/sys/fs/hpfs/hpfs_vnops.c
@@ -78,6 +78,7 @@ static vop_remove_t hpfs_remove;
static vop_bmap_t hpfs_bmap;
static vop_fsync_t hpfs_fsync;
static vop_pathconf_t hpfs_pathconf;
+static vop_vptofh_t hpfs_vptofh;
static int
hpfs_fsync(ap)
@@ -1208,6 +1209,24 @@ hpfs_pathconf(ap)
/* NOTREACHED */
}
+int
+hpfs_vptofh(ap)
+ struct vop_vptofh_args /* {
+ struct vnode *a_vp;
+ struct fid *a_fhp;
+ } */ *ap;
+{
+ register struct hpfsnode *hpp;
+ register struct hpfid *hpfhp;
+
+ hpp = VTOHP(ap->a_vp);
+ hpfhp = (struct hpfid *)ap->a_fhp;
+ hpfhp->hpfid_len = sizeof(struct hpfid);
+ hpfhp->hpfid_ino = hpp->h_no;
+ /* hpfhp->hpfid_gen = hpp->h_gen; */
+ return (0);
+}
+
/*
* Global vfs data structures
@@ -1235,4 +1254,5 @@ struct vop_vector hpfs_vnodeops = {
.vop_setattr = hpfs_setattr,
.vop_strategy = hpfs_strategy,
.vop_write = hpfs_write,
+ .vop_vptofh = hpfs_vptofh,
};
OpenPOWER on IntegriCloud