summaryrefslogtreecommitdiffstats
path: root/sys/gnu/fs/reiserfs
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/gnu/fs/reiserfs
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/gnu/fs/reiserfs')
-rw-r--r--sys/gnu/fs/reiserfs/reiserfs_vfsops.c26
-rw-r--r--sys/gnu/fs/reiserfs/reiserfs_vnops.c29
2 files changed, 29 insertions, 26 deletions
diff --git a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
index 4ace2da..e947379 100644
--- a/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
+++ b/sys/gnu/fs/reiserfs/reiserfs_vfsops.c
@@ -26,7 +26,6 @@ static vfs_mount_t reiserfs_mount;
static vfs_root_t reiserfs_root;
static vfs_statfs_t reiserfs_statfs;
static vfs_unmount_t reiserfs_unmount;
-static vfs_vptofh_t reiserfs_vptofh;
static int reiserfs_mountfs(struct vnode *devvp, struct mount *mp,
struct thread *td);
@@ -377,30 +376,6 @@ reiserfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp)
return (0);
}
-/*
- * Vnode pointer to File handle
- */
-static int
-reiserfs_vptofh(struct vnode *vp, struct fid *fhp)
-{
- struct rfid *rfhp;
- struct reiserfs_node *ip;
-
- ip = VTOI(vp);
- reiserfs_log(LOG_DEBUG,
- "fill *fhp with inode (dirid=%d, objectid=%d)\n",
- ip->i_ino, ip->i_number);
-
- rfhp = (struct rfid *)fhp;
- rfhp->rfid_len = sizeof(struct rfid);
- rfhp->rfid_dirid = ip->i_ino;
- rfhp->rfid_objectid = ip->i_number;
- rfhp->rfid_gen = ip->i_generation;
-
- reiserfs_log(LOG_DEBUG, "return it\n");
- return (0);
-}
-
/* -------------------------------------------------------------------
* Functions for the journal
* -------------------------------------------------------------------*/
@@ -1180,7 +1155,6 @@ static struct vfsops reiser_vfsops = {
.vfs_statfs = reiserfs_statfs,
//.vfs_sync = reiserfs_sync,
//.vfs_vget = reiserfs_vget,
- .vfs_vptofh = reiserfs_vptofh,
};
VFS_SET(reiser_vfsops, reiserfs, VFCF_READONLY);
diff --git a/sys/gnu/fs/reiserfs/reiserfs_vnops.c b/sys/gnu/fs/reiserfs/reiserfs_vnops.c
index 9b0ba7d..14242464 100644
--- a/sys/gnu/fs/reiserfs/reiserfs_vnops.c
+++ b/sys/gnu/fs/reiserfs/reiserfs_vnops.c
@@ -16,6 +16,7 @@ static vop_open_t reiserfs_open;
static vop_pathconf_t reiserfs_pathconf;
static vop_readlink_t reiserfs_readlink;
static vop_strategy_t reiserfs_strategy;
+static vop_vptofh_t reiserfs_vptofh;
/* Global vfs data structures for ReiserFS */
struct vop_vector reiserfs_vnodeops = {
@@ -34,6 +35,7 @@ struct vop_vector reiserfs_vnodeops = {
.vop_readlink = reiserfs_readlink,
.vop_pathconf = reiserfs_pathconf,
.vop_strategy = reiserfs_strategy,
+ .vop_vptofh = reiserfs_vptofh,
};
struct vop_vector reiserfs_specops = {
@@ -351,3 +353,30 @@ reiserfs_strategy(struct vop_strategy_args /* {
bufdone(bp);
return (error);
}
+
+/*
+ * Vnode pointer to File handle
+ */
+static int
+reiserfs_vptofh(struct vop_vptofh_args /* {
+ struct vnode *a_vp;
+ struct fid *a_fhp;
+ } */ *ap)
+{
+ struct rfid *rfhp;
+ struct reiserfs_node *ip;
+
+ ip = VTOI(ap->a_vp);
+ reiserfs_log(LOG_DEBUG,
+ "fill *fhp with inode (dirid=%d, objectid=%d)\n",
+ ip->i_ino, ip->i_number);
+
+ rfhp = (struct rfid *)ap->a_fhp;
+ rfhp->rfid_len = sizeof(struct rfid);
+ rfhp->rfid_dirid = ip->i_ino;
+ rfhp->rfid_objectid = ip->i_number;
+ rfhp->rfid_gen = ip->i_generation;
+
+ reiserfs_log(LOG_DEBUG, "return it\n");
+ return (0);
+}
OpenPOWER on IntegriCloud