The branch releng/13.0 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6a61e5e0a1ed058515860b4806d17196cc51195e

commit 6a61e5e0a1ed058515860b4806d17196cc51195e
Author:     Konstantin Belousov <k...@freebsd.org>
AuthorDate: 2021-01-28 12:20:48 +0000
Commit:     Konstantin Belousov <k...@freebsd.org>
CommitDate: 2021-02-25 20:48:13 +0000

    Merge ufs_fhtovp() into ffs_inotovp().
    
    Approved by:    re (delphij, gjb)
    
    (cherry picked from commit 89fd61d955ada4fdb20030253206201bc279cdf0)
---
 sys/ufs/ffs/ffs_vfsops.c | 21 +++++++++++++++++----
 sys/ufs/ufs/ufs_extern.h |  1 -
 sys/ufs/ufs/ufs_vfsops.c | 25 -------------------------
 3 files changed, 17 insertions(+), 30 deletions(-)

diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 596e2f4b4b5f..540dd02c9631 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -2170,6 +2170,7 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags)
 {
        struct ufsmount *ump;
        struct vnode *nvp;
+       struct inode *ip;
        struct fs *fs;
        struct cg *cgp;
        struct buf *bp;
@@ -2178,6 +2179,8 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags)
 
        ump = VFSTOUFS(mp);
        fs = ump->um_fs;
+       *vpp = NULL;
+
        if (ino < UFS_ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg)
                return (ESTALE);
 
@@ -2198,10 +2201,20 @@ ffs_inotovp(mp, ino, gen, lflags, vpp, ffs_flags)
        }
 
        error = ffs_vgetf(mp, ino, lflags, &nvp, ffs_flags);
-       if (error == 0)
-               error = ufs_fhtovp(mp, nvp, gen);
-       *vpp = error == 0 ? nvp : NULLVP;
-       return (error);
+       if (error != 0)
+               return (error);
+
+       ip = VTOI(nvp);
+       if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) {
+               if (ip->i_mode == 0)
+                       vgone(nvp);
+               vput(nvp);
+               return (ESTALE);
+       }
+
+       vnode_create_vobject(nvp, DIP(ip, i_size), curthread);
+       *vpp = nvp;
+       return (0);
 }
 
 /*
diff --git a/sys/ufs/ufs/ufs_extern.h b/sys/ufs/ufs/ufs_extern.h
index ab26750455e8..1697f2c0ba61 100644
--- a/sys/ufs/ufs/ufs_extern.h
+++ b/sys/ufs/ufs/ufs_extern.h
@@ -59,7 +59,6 @@ int    ufs_bmap(struct vop_bmap_args *);
 int     ufs_bmaparray(struct vnode *, ufs2_daddr_t, ufs2_daddr_t *,
            struct buf *, int *, int *);
 int     ufs_bmap_seekdata(struct vnode *, off_t *);
-int     ufs_fhtovp(struct mount *, struct vnode *, u_int64_t);
 int     ufs_checkpath(ino_t, ino_t, struct inode *, struct ucred *, ino_t *);
 void    ufs_dirbad(struct inode *, doff_t, char *);
 int     ufs_dirbadentry(struct vnode *, struct direct *, int);
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index 1a63e92b3e2c..0f45baed634f 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -214,28 +214,3 @@ ufs_uninit(vfsp)
 #endif
        return (0);
 }
-
-/*
- * This is the generic part of fhtovp called after the underlying
- * filesystem has validated the file handle.
- *
- * Call the VFS_CHECKEXP beforehand to verify access.
- */
-int
-ufs_fhtovp(mp, nvp, gen)
-       struct mount *mp;
-       struct vnode *nvp;
-       u_int64_t gen;
-{
-       struct inode *ip;
-
-       ip = VTOI(nvp);
-       if (ip->i_mode == 0 || ip->i_gen != gen || ip->i_effnlink <= 0) {
-               if (ip->i_mode == 0)
-                       vgone(nvp);
-               vput(nvp);
-               return (ESTALE);
-       }
-       vnode_create_vobject(nvp, DIP(ip, i_size), curthread);
-       return (0);
-}
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to