diff options
author | pjd <pjd@FreeBSD.org> | 2007-02-15 22:08:35 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2007-02-15 22:08:35 +0000 |
commit | cb2d7c85a85791923bd76d6e730efe888d456b05 (patch) | |
tree | d0649ac0ff4a69d709b0c801322ed78174e44d1c /sys/fs/udf/udf_vnops.c | |
parent | 8442403943388cc79bc6f4b7d43bfe916ee194ef (diff) | |
download | FreeBSD-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/udf/udf_vnops.c')
-rw-r--r-- | sys/fs/udf/udf_vnops.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 32ffc47..b0c6fcd 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -67,6 +67,7 @@ static vop_strategy_t udf_strategy; static vop_bmap_t udf_bmap; static vop_cachedlookup_t udf_lookup; static vop_reclaim_t udf_reclaim; +static vop_vptofh_t udf_vptofh; static int udf_readatoffset(struct udf_node *node, int *size, off_t offset, struct buf **bp, uint8_t **data); static int udf_bmap_internal(struct udf_node *node, off_t offset, @@ -88,6 +89,7 @@ static struct vop_vector udf_vnodeops = { .vop_readlink = udf_readlink, .vop_reclaim = udf_reclaim, .vop_strategy = udf_strategy, + .vop_vptofh = udf_vptofh, }; MALLOC_DEFINE(M_UDFFID, "udf_fid", "UDF FileId structure"); @@ -1022,6 +1024,20 @@ udf_reclaim(struct vop_reclaim_args *a) return (0); } +static int +udf_vptofh(struct vop_vptofh_args *a) +{ + struct udf_node *node; + struct ifid *ifhp; + + node = VTON(a->a_vp); + ifhp = (struct ifid *)a->a_fhp; + ifhp->ifid_len = sizeof(struct ifid); + ifhp->ifid_ino = node->hash_id; + + return (0); +} + /* * Read the block and then set the data pointer to correspond with the * offset passed in. Only read in at most 'size' bytes, and then set 'size' |