--- fs/hpfs/hpfs_vfsops.c 2006/09/26 04:16:10 +++ fs/hpfs/hpfs_vfsops.c 2007/02/01 22:35:56 @@ -68,7 +68,6 @@ 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 @@ } 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 @@ .vfs_statfs = hpfs_statfs, .vfs_unmount = hpfs_unmount, .vfs_vget = hpfs_vget, - .vfs_vptofh = hpfs_vptofh, }; VFS_SET(hpfs_vfsops, hpfs, 0); --- fs/hpfs/hpfs_vnops.c 2006/11/06 13:48:07 +++ fs/hpfs/hpfs_vnops.c 2007/02/02 18:55:59 @@ -78,6 +78,7 @@ 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 @@ /* 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 @@ .vop_setattr = hpfs_setattr, .vop_strategy = hpfs_strategy, .vop_write = hpfs_write, + .vop_vptofh = hpfs_vptofh, }; --- fs/msdosfs/msdosfs_vfsops.c 2007/01/30 08:06:50 +++ fs/msdosfs/msdosfs_vfsops.c 2007/02/01 22:35:56 @@ -112,7 +112,6 @@ 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 @@ -963,23 +962,6 @@ return (0); } -static int -msdosfs_vptofh(vp, fhp) - 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, @@ -988,7 +970,6 @@ .vfs_statfs = msdosfs_statfs, .vfs_sync = msdosfs_sync, .vfs_unmount = msdosfs_unmount, - .vfs_vptofh = msdosfs_vptofh, }; VFS_SET(msdosfs_vfsops, msdosfs, 0); --- fs/msdosfs/msdosfs_vnops.c 2007/01/30 08:06:50 +++ fs/msdosfs/msdosfs_vnops.c 2007/02/02 18:55:59 @@ -107,6 +107,7 @@ 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 @@ 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 @@ .vop_strategy = msdosfs_strategy, .vop_symlink = msdosfs_symlink, .vop_write = msdosfs_write, + .vop_vptofh = msdosfs_vptofh, }; --- fs/ntfs/ntfs_vfsops.c 2006/09/26 04:16:10 +++ fs/ntfs/ntfs_vfsops.c 2007/02/01 22:35:56 @@ -80,7 +80,6 @@ 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 @@ 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 @@ .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); --- fs/ntfs/ntfs_vnops.c 2006/11/20 19:32:14 +++ fs/ntfs/ntfs_vnops.c 2007/02/02 18:55:59 @@ -80,6 +80,7 @@ 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 @@ /* 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 @@ .vop_reclaim = ntfs_reclaim, .vop_strategy = ntfs_strategy, .vop_write = ntfs_write, + .vop_vptofh = ntfs_vptofh, }; --- fs/nullfs/null_vfsops.c 2006/09/26 04:16:10 +++ fs/nullfs/null_vfsops.c 2007/02/01 22:35:56 @@ -63,7 +63,6 @@ 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 @@ 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 @@ .vfs_uninit = nullfs_uninit, .vfs_unmount = nullfs_unmount, .vfs_vget = nullfs_vget, - .vfs_vptofh = nullfs_vptofh, }; VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK); --- fs/nullfs/null_vnops.c 2006/11/13 05:56:49 +++ fs/nullfs/null_vnops.c 2007/02/02 18:55:59 @@ -708,6 +708,15 @@ 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 @@ .vop_setattr = null_setattr, .vop_strategy = VOP_EOPNOTSUPP, .vop_unlock = null_unlock, + .vop_vptofh = null_vptofh, }; --- fs/udf/udf.h 2005/03/16 08:13:28 +++ fs/udf/udf.h 2007/02/02 18:55:59 @@ -74,6 +74,13 @@ 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)) --- fs/udf/udf_vfsops.c 2007/01/10 16:24:35 +++ fs/udf/udf_vfsops.c 2007/02/02 18:55:59 @@ -117,7 +117,6 @@ 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 @@ .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 @@ 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 @@ } 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; --- fs/udf/udf_vnops.c 2007/01/15 18:47:08 +++ fs/udf/udf_vnops.c 2007/02/02 16:50:56 @@ -67,6 +67,7 @@ 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 @@ .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 @@ 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' --- fs/umapfs/umap_vfsops.c 2006/11/06 13:48:07 +++ fs/umapfs/umap_vfsops.c 2007/02/01 22:35:56 @@ -59,7 +59,6 @@ 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 @@ } 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 @@ .vfs_statfs = umapfs_statfs, .vfs_unmount = umapfs_unmount, .vfs_vget = umapfs_vget, - .vfs_vptofh = umapfs_vptofh, }; VFS_SET(umap_vfsops, umapfs, VFCF_LOOPBACK); --- fs/umapfs/umap_vnops.c 2005/03/13 12:20:25 +++ fs/umapfs/umap_vnops.c 2007/02/02 18:55:59 @@ -62,6 +62,7 @@ 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 @@ 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 @@ .vop_reclaim = umap_reclaim, .vop_rename = umap_rename, .vop_unlock = umap_unlock, + .vop_vptofh = umap_vptofh, }; --- fs/unionfs/union_vfsops.c 2006/12/09 17:26:35 +++ fs/unionfs/union_vfsops.c 2007/02/01 22:35:56 @@ -61,7 +61,6 @@ 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 @@ } 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 @@ .vfs_uninit = unionfs_uninit, .vfs_unmount = unionfs_unmount, .vfs_vget = unionfs_vget, - .vfs_vptofh = unionfs_vptofh, }; VFS_SET(unionfs_vfsops, unionfs, VFCF_LOOPBACK); --- fs/unionfs/union_vnops.c 2007/01/05 02:26:47 +++ fs/unionfs/union_vnops.c 2007/02/01 22:35:56 @@ -2229,6 +2229,12 @@ 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 @@ .vop_unlock = unionfs_unlock, .vop_whiteout = unionfs_whiteout, .vop_write = unionfs_write, + .vop_vptofh = unionfs_vptofh, }; --- gnu/fs/ext2fs/ext2_vfsops.c 2006/11/18 18:26:04 +++ gnu/fs/ext2fs/ext2_vfsops.c 2007/02/01 22:35:56 @@ -92,7 +92,6 @@ static vfs_sync_t ext2_sync; static vfs_vget_t ext2_vget; static vfs_fhtovp_t ext2_fhtovp; -static vfs_vptofh_t ext2_vptofh; static vfs_mount_t ext2_mount; MALLOC_DEFINE(M_EXT2NODE, "ext2_node", "EXT2 vnode private part"); @@ -106,7 +105,6 @@ .vfs_sync = ext2_sync, .vfs_unmount = ext2_unmount, .vfs_vget = ext2_vget, - .vfs_vptofh = ext2_vptofh, }; VFS_SET(ext2fs_vfsops, ext2fs, 0); @@ -1099,26 +1097,6 @@ } /* - * Vnode pointer to File handle - */ -/* ARGSUSED */ -static int -ext2_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); -} - -/* * Write a superblock and associated information back to disk. */ static int --- gnu/fs/ext2fs/ext2_vnops.c 2006/11/06 13:48:07 +++ gnu/fs/ext2fs/ext2_vnops.c 2007/02/02 18:55:59 @@ -107,6 +107,7 @@ static vop_strategy_t ext2_strategy; static vop_symlink_t ext2_symlink; static vop_write_t ext2_write; +static vop_vptofh_t ext2_vptofh; static vop_close_t ext2fifo_close; static vop_kqfilter_t ext2fifo_kqfilter; static int filt_ext2read(struct knote *kn, long hint); @@ -147,6 +148,7 @@ .vop_strategy = ext2_strategy, .vop_symlink = ext2_symlink, .vop_write = ext2_write, + .vop_vptofh = ext2_vptofh, }; struct vop_vector ext2_fifoops = { @@ -162,6 +164,7 @@ .vop_reclaim = ext2_reclaim, .vop_setattr = ext2_setattr, .vop_write = VOP_PANIC, + .vop_vptofh = ext2_vptofh, }; #include @@ -1542,6 +1545,28 @@ } /* + * Vnode pointer to File handle + */ +/* ARGSUSED */ +static int +ext2_vptofh(ap) + struct vop_vptofh_args /* { + struct vnode *a_vp; + struct fid *a_fhp; + } */ *ap; +{ + 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); +} + +/* * Initialize the vnode associated with a new inode, handle aliased * vnodes. */ --- gnu/fs/reiserfs/reiserfs_vfsops.c 2006/11/06 13:48:07 +++ gnu/fs/reiserfs/reiserfs_vfsops.c 2007/02/01 22:35:56 @@ -26,7 +26,6 @@ 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 @@ 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 @@ .vfs_statfs = reiserfs_statfs, //.vfs_sync = reiserfs_sync, //.vfs_vget = reiserfs_vget, - .vfs_vptofh = reiserfs_vptofh, }; VFS_SET(reiser_vfsops, reiserfs, VFCF_READONLY); --- gnu/fs/reiserfs/reiserfs_vnops.c 2005/06/18 17:10:36 +++ gnu/fs/reiserfs/reiserfs_vnops.c 2007/02/02 16:50:56 @@ -16,6 +16,7 @@ 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 @@ .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 @@ 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); +} --- gnu/fs/xfs/FreeBSD/xfs_mountops.c 2007/01/23 10:03:31 +++ gnu/fs/xfs/FreeBSD/xfs_mountops.c 2007/02/01 22:35:56 @@ -81,7 +81,6 @@ static vfs_sync_t _xfs_sync; static vfs_vget_t _xfs_vget; static vfs_fhtovp_t _xfs_fhtovp; -static vfs_vptofh_t _xfs_vptofh; static vfs_init_t _xfs_init; static vfs_uninit_t _xfs_uninit; static vfs_extattrctl_t _xfs_extattrctl; @@ -383,15 +382,6 @@ } static int -_xfs_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - printf("xfs_vptofh"); - return ENOSYS; -} - -static int _xfs_extattrctl(struct mount *mp, int cm, struct vnode *filename_v, int attrnamespace, const char *attrname, @@ -429,7 +419,6 @@ .vfs_sync = _xfs_sync, .vfs_vget = _xfs_vget, .vfs_fhtovp = _xfs_fhtovp, - .vfs_vptofh = _xfs_vptofh, .vfs_init = _xfs_init, .vfs_uninit = _xfs_uninit, .vfs_extattrctl = _xfs_extattrctl, --- gnu/fs/xfs/FreeBSD/xfs_vnops.c 2006/06/11 03:35:52 +++ gnu/fs/xfs/FreeBSD/xfs_vnops.c 2007/02/02 16:50:56 @@ -115,6 +115,7 @@ static vop_strategy_t _xfs_strategy; static vop_symlink_t _xfs_symlink; static vop_write_t _xfs_write; +static vop_vptofh_t _xfs_vptofh; struct vop_vector xfs_vnops = { .vop_default = &default_vnodeops, @@ -148,6 +149,7 @@ .vop_strategy = _xfs_strategy, .vop_symlink = _xfs_symlink, .vop_write = _xfs_write, + .vop_vptofh = _xfs_vptofh, }; /* @@ -171,6 +173,7 @@ .vop_reclaim = _xfs_reclaim, .vop_setattr = _xfs_setattr, .vop_write = _xfsfifo_write, + .vop_vptofh = _xfs_vptofh, }; static int @@ -1681,3 +1684,16 @@ ap->a_cred, error); return (error); } + +static int +_xfs_vptofh(struct vop_vptofh_args *ap) +/* +vop_vptofh { + IN struct vnode *a_vp; + IN struct fid *a_fhp; +}; +*/ +{ + printf("xfs_vptofh"); + return ENOSYS; +} --- isofs/cd9660/cd9660_vfsops.c 2006/11/06 13:48:07 +++ isofs/cd9660/cd9660_vfsops.c 2007/02/02 18:55:59 @@ -75,7 +75,6 @@ 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 @@ .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 @@ * - 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 @@ *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; -} --- isofs/cd9660/cd9660_vnops.c 2006/01/09 20:49:39 +++ isofs/cd9660/cd9660_vnops.c 2007/02/02 16:50:56 @@ -74,6 +74,7 @@ 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 @@ } /* + * 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 @@ .vop_reclaim = cd9660_reclaim, .vop_setattr = cd9660_setattr, .vop_strategy = cd9660_strategy, + .vop_vptofh = cd9660_vptofh, }; /* @@ -830,4 +858,5 @@ .vop_inactive = cd9660_inactive, .vop_reclaim = cd9660_reclaim, .vop_setattr = cd9660_setattr, + .vop_vptofh = cd9660_vptofh, }; --- isofs/cd9660/iso.h 2005/10/18 13:35:24 +++ isofs/cd9660/iso.h 2007/02/02 18:55:59 @@ -249,6 +249,13 @@ 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) --- kern/vfs_default.c 2006/11/13 05:56:49 +++ kern/vfs_default.c 2007/02/02 16:50:56 @@ -96,6 +96,7 @@ .vop_revoke = VOP_PANIC, .vop_strategy = vop_nostrategy, .vop_unlock = vop_stdunlock, + .vop_vptofh = vop_stdvptofh, }; /* @@ -511,6 +512,12 @@ ap->a_sync, ap->a_rtvals); } +int +vop_stdvptofh(struct vop_vptofh_args *ap) +{ + return VFS_VPTOFH(ap->a_vp, ap->a_fhp); +} + /* * vfs default ops * used to fill the vfs function table to get reasonable default return values. @@ -536,6 +543,7 @@ return (EOPNOTSUPP); } +/* Backward compatibility: vfs_vptofh is now vop_vptofh. */ int vfs_stdvptofh (vp, fhp) struct vnode *vp; --- kern/vfs_export.c 2007/01/23 06:22:39 +++ kern/vfs_export.c 2007/02/02 15:49:27 @@ -337,7 +337,7 @@ if ((error = VFS_ROOT(mp, LK_EXCLUSIVE, &rvp, curthread /* XXX */))) return (error); - if ((error = VFS_VPTOFH(rvp, &nfs_pub.np_handle.fh_fid))) + if ((error = VOP_VPTOFH(rvp, &nfs_pub.np_handle.fh_fid))) return (error); vput(rvp); --- kern/vfs_init.c 2006/06/26 18:35:58 +++ kern/vfs_init.c 2007/02/02 15:49:27 @@ -215,6 +215,7 @@ if (vfsops->vfs_checkexp == NULL) /* check if file system is exported */ vfsops->vfs_checkexp = vfs_stdcheckexp; + /* Backward compatibility: vfs_vptofh is now vop_vptofh. */ if (vfsops->vfs_vptofh == NULL) /* turn a vnode into an NFS file handle */ vfsops->vfs_vptofh = vfs_stdvptofh; --- kern/vfs_syscalls.c 2006/12/23 00:13:06 +++ kern/vfs_syscalls.c 2007/02/02 15:49:27 @@ -3979,7 +3979,7 @@ vp = nd.ni_vp; bzero(&fh, sizeof(fh)); fh.fh_fsid = vp->v_mount->mnt_stat.f_fsid; - error = VFS_VPTOFH(vp, &fh.fh_fid); + error = VOP_VPTOFH(vp, &fh.fh_fid); vput(vp); VFS_UNLOCK_GIANT(vfslocked); if (error) @@ -4018,7 +4018,7 @@ vp = nd.ni_vp; bzero(&fh, sizeof(fh)); fh.fh_fsid = vp->v_mount->mnt_stat.f_fsid; - error = VFS_VPTOFH(vp, &fh.fh_fid); + error = VOP_VPTOFH(vp, &fh.fh_fid); vput(vp); VFS_UNLOCK_GIANT(vfslocked); if (error) --- kern/vnode_if.src 2006/11/13 05:56:49 +++ kern/vnode_if.src 2007/02/02 16:50:56 @@ -579,3 +579,11 @@ IN struct ucred *cred; IN struct thread *td; }; + + +%% setlabel vp = = = + +vop_vptofh { + IN struct vnode *vp; + IN struct fid *fhp; +}; --- nfsserver/nfs_serv.c 2006/11/24 11:56:21 +++ nfsserver/nfs_serv.c 2007/02/02 15:49:27 @@ -628,7 +628,7 @@ vp = ndp->ni_vp; bzero((caddr_t)fhp, sizeof(nfh)); fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; - error = VFS_VPTOFH(vp, &fhp->fh_fid); + error = VOP_VPTOFH(vp, &fhp->fh_fid); if (!error) error = VOP_GETATTR(vp, vap, cred, td); @@ -1971,7 +1971,7 @@ if (!error) { bzero((caddr_t)fhp, sizeof(nfh)); fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; - error = VFS_VPTOFH(nd.ni_vp, &fhp->fh_fid); + error = VOP_VPTOFH(nd.ni_vp, &fhp->fh_fid); if (!error) error = VOP_GETATTR(nd.ni_vp, vap, cred, td); } @@ -2199,7 +2199,7 @@ if (!error) { bzero((caddr_t)fhp, sizeof(nfh)); fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid; - error = VFS_VPTOFH(vp, &fhp->fh_fid); + error = VOP_VPTOFH(vp, &fhp->fh_fid); if (!error) error = VOP_GETATTR(vp, vap, cred, td); } @@ -2946,7 +2946,7 @@ if (error == 0) { bzero((caddr_t)fhp, sizeof(nfh)); fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; - error = VFS_VPTOFH(nd.ni_vp, &fhp->fh_fid); + error = VOP_VPTOFH(nd.ni_vp, &fhp->fh_fid); if (!error) error = VOP_GETATTR(nd.ni_vp, vap, cred, td); @@ -3124,7 +3124,7 @@ if (!error) { bzero((caddr_t)fhp, sizeof(nfh)); fhp->fh_fsid = nd.ni_vp->v_mount->mnt_stat.f_fsid; - error = VFS_VPTOFH(nd.ni_vp, &fhp->fh_fid); + error = VOP_VPTOFH(nd.ni_vp, &fhp->fh_fid); if (!error) error = VOP_GETATTR(nd.ni_vp, vap, cred, td); } @@ -3941,7 +3941,7 @@ */ KASSERT(nvp->v_mount == vp->v_mount, ("nfsrv_readdirplus: nvp mount != vp mount")); - if (VFS_VPTOFH(nvp, &nfhp->fh_fid)) { + if (VOP_VPTOFH(nvp, &nfhp->fh_fid)) { vput(nvp); nvp = NULL; goto invalid; --- sys/mount.h 2006/12/16 15:46:30 +++ sys/mount.h 2007/02/02 15:49:27 @@ -525,6 +525,7 @@ typedef int vfs_fhtovp_t(struct mount *mp, struct fid *fhp, struct vnode **vpp); typedef int vfs_checkexp_t(struct mount *mp, struct sockaddr *nam, int *extflagsp, struct ucred **credanonp); +/* Backward compatibility: vfs_vptofh is now vop_vptofh. */ typedef int vfs_vptofh_t(struct vnode *vp, struct fid *fhp); typedef int vfs_init_t(struct vfsconf *); typedef int vfs_uninit_t(struct vfsconf *); @@ -546,6 +547,7 @@ vfs_vget_t *vfs_vget; vfs_fhtovp_t *vfs_fhtovp; vfs_checkexp_t *vfs_checkexp; + /* Backward compatibility: vfs_vptofh is now vop_vptofh. */ vfs_vptofh_t *vfs_vptofh; vfs_init_t *vfs_init; vfs_uninit_t *vfs_uninit; @@ -566,7 +568,8 @@ (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) #define VFS_FHTOVP(MP, FIDP, VPP) \ (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP) -#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) +/* Backward compatibility: vfs_vptofh is now vop_vptofh. */ +#define VFS_VPTOFH(VP, FIDP) (*(VP)->v_mount->mnt_op->vfs_vptofh)(VP, FIDP) #define VFS_CHECKEXP(MP, NAM, EXFLG, CRED) \ (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED) #define VFS_EXTATTRCTL(MP, C, FN, NS, N, P) \ @@ -693,6 +696,7 @@ vfs_vget_t vfs_stdvget; vfs_fhtovp_t vfs_stdfhtovp; vfs_checkexp_t vfs_stdcheckexp; +/* Backward compatibility: vfs_vptofh is now vop_vptofh. */ vfs_vptofh_t vfs_stdvptofh; vfs_init_t vfs_stdinit; vfs_uninit_t vfs_stduninit; --- sys/vnode.h 2006/12/14 14:21:53 +++ sys/vnode.h 2007/02/02 15:49:27 @@ -652,6 +652,7 @@ int vop_nopoll(struct vop_poll_args *); int vop_stdpathconf(struct vop_pathconf_args *); int vop_stdpoll(struct vop_poll_args *); +int vop_stdvptofh(struct vop_vptofh_args *ap); int vop_eopnotsupp(struct vop_generic_args *ap); int vop_ebadf(struct vop_generic_args *ap); int vop_einval(struct vop_generic_args *ap); --- ufs/ffs/ffs_vfsops.c 2007/01/23 10:03:31 +++ ufs/ffs/ffs_vfsops.c 2007/02/01 22:35:56 @@ -87,7 +87,6 @@ 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 @@ .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 @@ } /* - * 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 --- ufs/ffs/ffs_vnops.c 2006/11/13 05:56:49 +++ ufs/ffs/ffs_vnops.c 2007/02/02 16:50:56 @@ -118,6 +118,7 @@ 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 @@ .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 @@ .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 @@ .vop_listextattr = ffs_listextattr, .vop_openextattr = ffs_openextattr, .vop_setextattr = ffs_setextattr, + .vop_vptofh = ffs_vptofh, }; /* @@ -1690,3 +1695,26 @@ 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); +}