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 | |
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')
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 34 | ||||
-rw-r--r-- | sys/fs/cd9660/cd9660_vnops.c | 29 | ||||
-rw-r--r-- | sys/fs/cd9660/iso.h | 7 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 18 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_vnops.c | 20 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 17 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vnops.c | 21 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfs_vfsops.c | 20 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfs_vnops.c | 22 | ||||
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 13 | ||||
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 10 | ||||
-rw-r--r-- | sys/fs/udf/udf.h | 7 | ||||
-rw-r--r-- | sys/fs/udf/udf_vfsops.c | 23 | ||||
-rw-r--r-- | sys/fs/udf/udf_vnops.c | 16 | ||||
-rw-r--r-- | sys/fs/umapfs/umap_vfsops.c | 13 | ||||
-rw-r--r-- | sys/fs/umapfs/umap_vnops.c | 15 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vfsops.c | 8 | ||||
-rw-r--r-- | sys/fs/unionfs/union_vnops.c | 7 |
18 files changed, 154 insertions, 146 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 8f94c6a..319b192 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -75,7 +75,6 @@ static vfs_root_t cd9660_root; static vfs_statfs_t cd9660_statfs; static vfs_vget_t cd9660_vget; static vfs_fhtovp_t cd9660_fhtovp; -static vfs_vptofh_t cd9660_vptofh; static struct vfsops cd9660_vfsops = { .vfs_fhtovp = cd9660_fhtovp, @@ -85,7 +84,6 @@ static struct vfsops cd9660_vfsops = { .vfs_statfs = cd9660_statfs, .vfs_unmount = cd9660_unmount, .vfs_vget = cd9660_vget, - .vfs_vptofh = cd9660_vptofh, }; VFS_SET(cd9660_vfsops, cd9660, VFCF_READONLY); MODULE_VERSION(cd9660, 1); @@ -595,13 +593,6 @@ cd9660_statfs(mp, sbp, td) * - check that the generation number matches */ -struct ifid { - u_short ifid_len; - u_short ifid_pad; - int ifid_ino; - long ifid_start; -}; - /* ARGSUSED */ static int cd9660_fhtovp(mp, fhp, vpp) @@ -821,28 +812,3 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir) *vpp = vp; return (0); } - -/* - * Vnode pointer to File handle - */ -/* ARGSUSED */ -static int -cd9660_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - struct iso_node *ip = VTOI(vp); - struct ifid *ifhp; - - ifhp = (struct ifid *)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; -} 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, }; diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h index 0851341..0988bf6 100644 --- a/sys/fs/cd9660/iso.h +++ b/sys/fs/cd9660/iso.h @@ -249,6 +249,13 @@ struct iso_mnt { void *im_l2d; }; +struct ifid { + u_short ifid_len; + u_short ifid_pad; + int ifid_ino; + long ifid_start; +}; + #define VFSTOISOFS(mp) ((struct iso_mnt *)((mp)->mnt_data)) #define blkoff(imp, loc) ((loc) & (imp)->im_bmask) 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, }; diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index adefd76..3b53b0a 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -112,7 +112,6 @@ static vfs_root_t msdosfs_root; static vfs_statfs_t msdosfs_statfs; static vfs_sync_t msdosfs_sync; static vfs_unmount_t msdosfs_unmount; -static vfs_vptofh_t msdosfs_vptofh; /* Maximum length of a character set name (arbitrary). */ #define MAXCSLEN 64 @@ -931,21 +930,6 @@ msdosfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) return (0); } -static int -msdosfs_vptofh(struct vnode *vp, struct fid *fhp) -{ - struct denode *dep; - struct defid *defhp; - - dep = VTODE(vp); - defhp = (struct defid *)fhp; - defhp->defid_len = sizeof(struct defid); - defhp->defid_dirclust = dep->de_dirclust; - defhp->defid_dirofs = dep->de_diroffset; - /* defhp->defid_gen = dep->de_gen; */ - return (0); -} - static struct vfsops msdosfs_vfsops = { .vfs_fhtovp = msdosfs_fhtovp, .vfs_mount = msdosfs_mount, @@ -954,7 +938,6 @@ static struct vfsops msdosfs_vfsops = { .vfs_statfs = msdosfs_statfs, .vfs_sync = msdosfs_sync, .vfs_unmount = msdosfs_unmount, - .vfs_vptofh = msdosfs_vptofh, }; VFS_SET(msdosfs_vfsops, msdosfs, 0); diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 589f13a..33e5292 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -107,6 +107,7 @@ static vop_bmap_t msdosfs_bmap; static vop_strategy_t msdosfs_strategy; static vop_print_t msdosfs_print; static vop_pathconf_t msdosfs_pathconf; +static vop_vptofh_t msdosfs_vptofh; /* * Some general notes: @@ -1904,6 +1905,25 @@ msdosfs_advlock(ap) return (lf_advlock(ap, &dep->de_lockf, dep->de_FileSize)); } +static int +msdosfs_vptofh(ap) + struct vop_vptofh_args /* { + struct vnode *a_vp; + struct fid *a_fhp; + } */ *ap; +{ + struct denode *dep; + struct defid *defhp; + + dep = VTODE(ap->a_vp); + defhp = (struct defid *)ap->a_fhp; + defhp->defid_len = sizeof(struct defid); + defhp->defid_dirclust = dep->de_dirclust; + defhp->defid_dirofs = dep->de_diroffset; + /* defhp->defid_gen = dep->de_gen; */ + return (0); +} + /* Global vfs data structures for msdosfs */ struct vop_vector msdosfs_vnodeops = { .vop_default = &default_vnodeops, @@ -1934,4 +1954,5 @@ struct vop_vector msdosfs_vnodeops = { .vop_strategy = msdosfs_strategy, .vop_symlink = msdosfs_symlink, .vop_write = msdosfs_write, + .vop_vptofh = msdosfs_vptofh, }; diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index 1f46d01..30c7a59 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -80,7 +80,6 @@ static vfs_mount_t ntfs_mount; static vfs_root_t ntfs_root; static vfs_statfs_t ntfs_statfs; static vfs_unmount_t ntfs_unmount; -static vfs_vptofh_t ntfs_vptofh; static b_strategy_t ntfs_bufstrategy; @@ -622,24 +621,6 @@ ntfs_fhtovp( return (0); } -static int -ntfs_vptofh( - struct vnode *vp, - struct fid *fhp) -{ - register struct ntnode *ntp; - register struct ntfid *ntfhp; - - ddprintf(("ntfs_fhtovp(): %p\n", vp)); - - ntp = VTONT(vp); - ntfhp = (struct ntfid *)fhp; - ntfhp->ntfid_len = sizeof(struct ntfid); - ntfhp->ntfid_ino = ntp->i_number; - /* ntfhp->ntfid_gen = ntp->i_gen; */ - return (0); -} - int ntfs_vgetex( struct mount *mp, @@ -787,7 +768,6 @@ static struct vfsops ntfs_vfsops = { .vfs_uninit = ntfs_uninit, .vfs_unmount = ntfs_unmount, .vfs_vget = ntfs_vget, - .vfs_vptofh = ntfs_vptofh, }; VFS_SET(ntfs_vfsops, ntfs, 0); MODULE_VERSION(ntfs, 1); diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c index 0b90b60..bc30044 100644 --- a/sys/fs/ntfs/ntfs_vnops.c +++ b/sys/fs/ntfs/ntfs_vnops.c @@ -80,6 +80,7 @@ static vop_readdir_t ntfs_readdir; static vop_cachedlookup_t ntfs_lookup; static vop_fsync_t ntfs_fsync; static vop_pathconf_t ntfs_pathconf; +static vop_vptofh_t ntfs_vptofh; int ntfs_prtactive = 1; /* 1 => print out reclaim of active vnodes */ @@ -731,6 +732,26 @@ ntfs_pathconf(ap) /* NOTREACHED */ } +int +ntfs_vptofh(ap) + struct vop_vptofh_args /* { + struct vnode *a_vp; + struct fid *a_fhp; + } */ *ap; +{ + register struct ntnode *ntp; + register struct ntfid *ntfhp; + + ddprintf(("ntfs_fhtovp(): %p\n", ap->a_vp)); + + ntp = VTONT(ap->a_vp); + ntfhp = (struct ntfid *)ap->a_fhp; + ntfhp->ntfid_len = sizeof(struct ntfid); + ntfhp->ntfid_ino = ntp->i_number; + /* ntfhp->ntfid_gen = ntp->i_gen; */ + return (0); +} + /* * Global vfs data structures */ @@ -752,4 +773,5 @@ struct vop_vector ntfs_vnodeops = { .vop_reclaim = ntfs_reclaim, .vop_strategy = ntfs_strategy, .vop_write = ntfs_write, + .vop_vptofh = ntfs_vptofh, }; diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index 125c67a..7094cfb 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -63,7 +63,6 @@ static vfs_sync_t nullfs_sync; static vfs_statfs_t nullfs_statfs; static vfs_unmount_t nullfs_unmount; static vfs_vget_t nullfs_vget; -static vfs_vptofh_t nullfs_vptofh; static vfs_extattrctl_t nullfs_extattrctl; /* @@ -344,17 +343,6 @@ nullfs_fhtovp(mp, fidp, vpp) return (null_nodeget(mp, *vpp, vpp)); } -static int -nullfs_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - struct vnode *lvp; - - lvp = NULLVPTOLOWERVP(vp); - return VFS_VPTOFH(lvp, fhp); -} - static int nullfs_extattrctl(mp, cmd, filename_vp, namespace, attrname, td) struct mount *mp; @@ -381,7 +369,6 @@ static struct vfsops null_vfsops = { .vfs_uninit = nullfs_uninit, .vfs_unmount = nullfs_unmount, .vfs_vget = nullfs_vget, - .vfs_vptofh = nullfs_vptofh, }; VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK); diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 4459fe1..fb20667 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -708,6 +708,15 @@ null_getwritemount(struct vop_getwritemount_args *ap) return (0); } +static int +null_vptofh(struct vop_vptofh_args *ap) +{ + struct vnode *lvp; + + lvp = NULLVPTOLOWERVP(ap->a_vp); + return VOP_VPTOFH(lvp, ap->a_fhp); +} + /* * Global vfs data structures */ @@ -728,4 +737,5 @@ struct vop_vector null_vnodeops = { .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, .vop_unlock = null_unlock, + .vop_vptofh = null_vptofh, }; diff --git a/sys/fs/udf/udf.h b/sys/fs/udf/udf.h index a43f0cd..05eb2e4 100644 --- a/sys/fs/udf/udf.h +++ b/sys/fs/udf/udf.h @@ -74,6 +74,13 @@ struct udf_dirstream { int fid_fragment; }; +struct ifid { + u_short ifid_len; + u_short ifid_pad; + int ifid_ino; + long ifid_start; +}; + #define VFSTOUDFFS(mp) ((struct udf_mnt *)((mp)->mnt_data)) #define VTON(vp) ((struct udf_node *)((vp)->v_data)) diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c index 78247f3..ee58725 100644 --- a/sys/fs/udf/udf_vfsops.c +++ b/sys/fs/udf/udf_vfsops.c @@ -117,7 +117,6 @@ static vfs_root_t udf_root; static vfs_statfs_t udf_statfs; static vfs_unmount_t udf_unmount; static vfs_fhtovp_t udf_fhtovp; -static vfs_vptofh_t udf_vptofh; static int udf_find_partmaps(struct udf_mnt *, struct logvol_desc *); @@ -130,7 +129,6 @@ static struct vfsops udf_vfsops = { .vfs_uninit = udf_uninit, .vfs_unmount = udf_unmount, .vfs_vget = udf_vget, - .vfs_vptofh = udf_vptofh, }; VFS_SET(udf_vfsops, udf, VFCF_READONLY); @@ -687,13 +685,6 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) return (0); } -struct ifid { - u_short ifid_len; - u_short ifid_pad; - int ifid_ino; - long ifid_start; -}; - static int udf_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) { @@ -719,20 +710,6 @@ udf_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) } static int -udf_vptofh (struct vnode *vp, struct fid *fhp) -{ - struct udf_node *node; - struct ifid *ifhp; - - node = VTON(vp); - ifhp = (struct ifid *)fhp; - ifhp->ifid_len = sizeof(struct ifid); - ifhp->ifid_ino = node->hash_id; - - return (0); -} - -static int udf_find_partmaps(struct udf_mnt *udfmp, struct logvol_desc *lvd) { struct part_map_spare *pms; 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' diff --git a/sys/fs/umapfs/umap_vfsops.c b/sys/fs/umapfs/umap_vfsops.c index 694ce33..d40dd56 100644 --- a/sys/fs/umapfs/umap_vfsops.c +++ b/sys/fs/umapfs/umap_vfsops.c @@ -59,7 +59,6 @@ static vfs_quotactl_t umapfs_quotactl; static vfs_statfs_t umapfs_statfs; static vfs_unmount_t umapfs_unmount; static vfs_fhtovp_t umapfs_fhtovp; -static vfs_vptofh_t umapfs_vptofh; static vfs_checkexp_t umapfs_checkexp; static vfs_vget_t umapfs_vget; static vfs_extattrctl_t umapfs_extattrctl; @@ -384,17 +383,6 @@ umapfs_checkexp(mp, nam, exflagsp, credanonp) } static int -umapfs_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - struct vnode *lvp; - - lvp = UMAPVPTOLOWERVP(vp); - return (VFS_VPTOFH(lvp, fhp)); -} - -static int umapfs_extattrctl(mp, cmd, filename_vp, namespace, attrname, td) struct mount *mp; int cmd; @@ -419,7 +407,6 @@ static struct vfsops umap_vfsops = { .vfs_statfs = umapfs_statfs, .vfs_unmount = umapfs_unmount, .vfs_vget = umapfs_vget, - .vfs_vptofh = umapfs_vptofh, }; VFS_SET(umap_vfsops, umapfs, VFCF_LOOPBACK); diff --git a/sys/fs/umapfs/umap_vnops.c b/sys/fs/umapfs/umap_vnops.c index 92a3bc4..eb78b98 100644 --- a/sys/fs/umapfs/umap_vnops.c +++ b/sys/fs/umapfs/umap_vnops.c @@ -62,6 +62,7 @@ static vop_print_t umap_print; static vop_reclaim_t umap_reclaim; static vop_rename_t umap_rename; static vop_unlock_t umap_unlock; +static vop_vptofh_t umap_vptofh; /* * This is the 10-Apr-92 bypass routine. @@ -498,6 +499,19 @@ umap_rename(ap) return error; } +static int +umap_vptofh(ap) + struct vop_vptofh_args /* { + struct vnode *a_vp; + struct fid *a_fhp; + } */ *ap; +{ + struct vnode *lvp; + + lvp = UMAPVPTOLOWERVP(ap->a_vp); + return (VOP_VPTOFH(lvp, ap->a_fhp)); +} + /* * Global vfs data structures */ @@ -516,4 +530,5 @@ static struct vop_vector umap_vnodeops = { .vop_reclaim = umap_reclaim, .vop_rename = umap_rename, .vop_unlock = umap_unlock, + .vop_vptofh = umap_vptofh, }; diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c index 53baf52..cb7b504 100644 --- a/sys/fs/unionfs/union_vfsops.c +++ b/sys/fs/unionfs/union_vfsops.c @@ -61,7 +61,6 @@ static vfs_sync_t unionfs_sync; static vfs_statfs_t unionfs_statfs; static vfs_unmount_t unionfs_unmount; static vfs_vget_t unionfs_vget; -static vfs_vptofh_t unionfs_vptofh; static vfs_extattrctl_t unionfs_extattrctl; static struct vfsops unionfs_vfsops; @@ -505,12 +504,6 @@ unionfs_checkexp(struct mount *mp, struct sockaddr *nam, int *extflagsp, } static int -unionfs_vptofh(struct vnode *vp, struct fid *fhp) -{ - return (EOPNOTSUPP); -} - -static int unionfs_extattrctl(struct mount *mp, int cmd, struct vnode *filename_vp, int namespace, const char *attrname, struct thread *td) { @@ -542,7 +535,6 @@ static struct vfsops unionfs_vfsops = { .vfs_uninit = unionfs_uninit, .vfs_unmount = unionfs_unmount, .vfs_vget = unionfs_vget, - .vfs_vptofh = unionfs_vptofh, }; VFS_SET(unionfs_vfsops, unionfs, VFCF_LOOPBACK); diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c index 0e35d21..42d6dce 100644 --- a/sys/fs/unionfs/union_vnops.c +++ b/sys/fs/unionfs/union_vnops.c @@ -2229,6 +2229,12 @@ unionfs_setlabel(struct vop_setlabel_args *ap) return (error); } +static int +unionfs_vptofh(struct vop_vptofh_args *ap) +{ + return (EOPNOTSUPP); +} + struct vop_vector unionfs_vnodeops = { .vop_default = &default_vnodeops, @@ -2275,4 +2281,5 @@ struct vop_vector unionfs_vnodeops = { .vop_unlock = unionfs_unlock, .vop_whiteout = unionfs_whiteout, .vop_write = unionfs_write, + .vop_vptofh = unionfs_vptofh, }; |