summaryrefslogtreecommitdiffstats
path: root/sys/fs/hpfs
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
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')
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c18
-rw-r--r--sys/fs/hpfs/hpfs_vnops.c20
2 files changed, 20 insertions, 18 deletions
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index 92735ec..b0a303a 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -68,7 +68,6 @@ static vfs_mount_t hpfs_mount;
static vfs_root_t hpfs_root;
static vfs_statfs_t hpfs_statfs;
static vfs_unmount_t hpfs_unmount;
-static vfs_vptofh_t hpfs_vptofh;
static int
hpfs_cmount (
@@ -435,22 +434,6 @@ hpfs_fhtovp(
}
static int
-hpfs_vptofh(
- struct vnode *vp,
- struct fid *fhp)
-{
- register struct hpfsnode *hpp;
- register struct hpfid *hpfhp;
-
- hpp = VTOHP(vp);
- hpfhp = (struct hpfid *)fhp;
- hpfhp->hpfid_len = sizeof(struct hpfid);
- hpfhp->hpfid_ino = hpp->h_no;
- /* hpfhp->hpfid_gen = hpp->h_gen; */
- return (0);
-}
-
-static int
hpfs_vget(
struct mount *mp,
ino_t ino,
@@ -550,6 +533,5 @@ static struct vfsops hpfs_vfsops = {
.vfs_statfs = hpfs_statfs,
.vfs_unmount = hpfs_unmount,
.vfs_vget = hpfs_vget,
- .vfs_vptofh = hpfs_vptofh,
};
VFS_SET(hpfs_vfsops, hpfs, 0);
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