summaryrefslogtreecommitdiffstats
path: root/sys/ufs/ffs
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/ufs/ffs
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/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c22
-rw-r--r--sys/ufs/ffs/ffs_vnops.c28
2 files changed, 28 insertions, 22 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 225dd8a..788eb2f 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -87,7 +87,6 @@ static vfs_unmount_t ffs_unmount;
static vfs_mount_t ffs_mount;
static vfs_statfs_t ffs_statfs;
static vfs_fhtovp_t ffs_fhtovp;
-static vfs_vptofh_t ffs_vptofh;
static vfs_sync_t ffs_sync;
static struct vfsops ufs_vfsops = {
@@ -103,7 +102,6 @@ static struct vfsops ufs_vfsops = {
.vfs_uninit = ffs_uninit,
.vfs_unmount = ffs_unmount,
.vfs_vget = ffs_vget,
- .vfs_vptofh = ffs_vptofh,
};
VFS_SET(ufs_vfsops, ufs, 0);
@@ -1511,26 +1509,6 @@ ffs_fhtovp(mp, fhp, vpp)
}
/*
- * Vnode pointer to File handle
- */
-/* ARGSUSED */
-static int
-ffs_vptofh(vp, fhp)
- struct vnode *vp;
- struct fid *fhp;
-{
- struct inode *ip;
- struct ufid *ufhp;
-
- ip = VTOI(vp);
- ufhp = (struct ufid *)fhp;
- ufhp->ufid_len = sizeof(struct ufid);
- ufhp->ufid_ino = ip->i_number;
- ufhp->ufid_gen = ip->i_gen;
- return (0);
-}
-
-/*
* Initialize the filesystem.
*/
static int
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 3ebadeb..77c5958 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -118,6 +118,7 @@ static vop_getextattr_t ffs_getextattr;
static vop_listextattr_t ffs_listextattr;
static vop_openextattr_t ffs_openextattr;
static vop_setextattr_t ffs_setextattr;
+static vop_vptofh_t ffs_vptofh;
/* Global vfs data structures for ufs. */
@@ -129,12 +130,14 @@ struct vop_vector ffs_vnodeops1 = {
.vop_read = ffs_read,
.vop_reallocblks = ffs_reallocblks,
.vop_write = ffs_write,
+ .vop_vptofh = ffs_vptofh,
};
struct vop_vector ffs_fifoops1 = {
.vop_default = &ufs_fifoops,
.vop_fsync = ffs_fsync,
.vop_reallocblks = ffs_reallocblks, /* XXX: really ??? */
+ .vop_vptofh = ffs_vptofh,
};
/* Global vfs data structures for ufs. */
@@ -152,6 +155,7 @@ struct vop_vector ffs_vnodeops2 = {
.vop_listextattr = ffs_listextattr,
.vop_openextattr = ffs_openextattr,
.vop_setextattr = ffs_setextattr,
+ .vop_vptofh = ffs_vptofh,
};
struct vop_vector ffs_fifoops2 = {
@@ -166,6 +170,7 @@ struct vop_vector ffs_fifoops2 = {
.vop_listextattr = ffs_listextattr,
.vop_openextattr = ffs_openextattr,
.vop_setextattr = ffs_setextattr,
+ .vop_vptofh = ffs_vptofh,
};
/*
@@ -1690,3 +1695,26 @@ vop_setextattr {
error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td);
return(error);
}
+
+/*
+ * Vnode pointer to File handle
+ */
+static int
+ffs_vptofh(struct vop_vptofh_args *ap)
+/*
+vop_vptofh {
+ IN struct vnode *a_vp;
+ IN struct fid *a_fhp;
+};
+*/
+{
+ struct inode *ip;
+ struct ufid *ufhp;
+
+ ip = VTOI(ap->a_vp);
+ ufhp = (struct ufid *)ap->a_fhp;
+ ufhp->ufid_len = sizeof(struct ufid);
+ ufhp->ufid_ino = ip->i_number;
+ ufhp->ufid_gen = ip->i_gen;
+ return (0);
+}
OpenPOWER on IntegriCloud