aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs/ufs/ufs_vfsops.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-01-26 11:52:59 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-02-12 01:02:20 +0000
commit5952c86c78b177b5e904bf139e6b56519897c7e0 (patch)
treeb2e95ad0235abce010c22b1a67f6bafa2c9e9689 /sys/ufs/ufs/ufs_vfsops.c
parentf16c26b1c009fd0d87d07d3b1cf0d5078ad7f511 (diff)
downloadsrc-5952c86c78b177b5e904bf139e6b56519897c7e0.tar.gz
src-5952c86c78b177b5e904bf139e6b56519897c7e0.zip
ffs_inotovp(): interface to convert (ino, gen) into alive vnode
It generalizes the VFS_FHTOVP() interface, making it possible to fetch the inode without faking filehandle. Also it adds the ffs flags argument which allows to control ffs_vgetf() call. Requested by: mckusick Reviewed by: chs, mckusick Tested by: pho MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/ufs/ufs/ufs_vfsops.c')
-rw-r--r--sys/ufs/ufs/ufs_vfsops.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index 4813ac7db763..1a63e92b3e2c 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -222,31 +222,20 @@ ufs_uninit(vfsp)
* Call the VFS_CHECKEXP beforehand to verify access.
*/
int
-ufs_fhtovp(mp, ufhp, flags, vpp)
+ufs_fhtovp(mp, nvp, gen)
struct mount *mp;
- struct ufid *ufhp;
- int flags;
- struct vnode **vpp;
+ struct vnode *nvp;
+ u_int64_t gen;
{
struct inode *ip;
- struct vnode *nvp;
- int error;
- error = VFS_VGET(mp, ufhp->ufid_ino, flags, &nvp);
- if (error) {
- *vpp = NULLVP;
- return (error);
- }
ip = VTOI(nvp);
- if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen ||
- ip->i_effnlink <= 0) {
+ if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) {
if (ip->i_mode == 0)
vgone(nvp);
vput(nvp);
- *vpp = NULLVP;
return (ESTALE);
}
- *vpp = nvp;
- vnode_create_vobject(*vpp, DIP(ip, i_size), curthread);
+ vnode_create_vobject(nvp, DIP(ip, i_size), curthread);
return (0);
}