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/cd9660/cd9660_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/cd9660/cd9660_vnops.c')
-rw-r--r-- | sys/fs/cd9660/cd9660_vnops.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 1cbfaee..ab6fea8 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -74,6 +74,7 @@ static int iso_shipdir(struct isoreaddir *idp); static vop_readdir_t cd9660_readdir; static vop_readlink_t cd9660_readlink; static vop_strategy_t cd9660_strategy; +static vop_vptofh_t cd9660_vptofh; /* * Setattr call. Only allowed for block and character special devices. @@ -798,6 +799,32 @@ cd9660_pathconf(ap) } /* + * Vnode pointer to File handle + */ +static int +cd9660_vptofh(ap) + struct vop_vptofh_args /* { + struct vnode *a_vp; + struct fid *a_fhp; + } */ *ap; +{ + struct iso_node *ip = VTOI(ap->a_vp); + struct ifid *ifhp; + + ifhp = (struct ifid *)ap->a_fhp; + ifhp->ifid_len = sizeof(struct ifid); + + ifhp->ifid_ino = ip->i_number; + ifhp->ifid_start = ip->iso_start; + +#ifdef ISOFS_DBG + printf("vptofh: ino %d, start %ld\n", + ifhp->ifid_ino,ifhp->ifid_start); +#endif + return 0; +} + +/* * Global vfs data structures for cd9660 */ struct vop_vector cd9660_vnodeops = { @@ -817,6 +844,7 @@ struct vop_vector cd9660_vnodeops = { .vop_reclaim = cd9660_reclaim, .vop_setattr = cd9660_setattr, .vop_strategy = cd9660_strategy, + .vop_vptofh = cd9660_vptofh, }; /* @@ -830,4 +858,5 @@ struct vop_vector cd9660_fifoops = { .vop_inactive = cd9660_inactive, .vop_reclaim = cd9660_reclaim, .vop_setattr = cd9660_setattr, + .vop_vptofh = cd9660_vptofh, }; |