git: 269c564b90d3 - main - vfs: retire NDFREE

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Mon, 19 Dec 2022 08:14:38 UTC
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=269c564b90d3f95ac3afbd4bd1adad36681f2b93

commit 269c564b90d3f95ac3afbd4bd1adad36681f2b93
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-11-17 16:59:20 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-12-19 08:07:54 +0000

    vfs: retire NDFREE
    
    There are no consumers anymore. Interested parties can NDFREE_PNBUF
    and vput or vrele relevant vnodes.
    
    Tested by:      pho
---
 sys/kern/vfs_lookup.c | 47 -----------------------------------------------
 sys/sys/namei.h       |  2 --
 2 files changed, 49 deletions(-)

diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 404c41a1bf2c..ac5617616e30 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -1556,53 +1556,6 @@ bad:
 	return (error);
 }
 
-void
-(NDFREE)(struct nameidata *ndp, const u_int flags)
-{
-	int unlock_dvp;
-	int unlock_vp;
-
-	unlock_dvp = 0;
-	unlock_vp = 0;
-
-	if (!(flags & NDF_NO_FREE_PNBUF)) {
-		NDFREE_PNBUF(ndp);
-	}
-	if (!(flags & NDF_NO_VP_UNLOCK) &&
-	    (ndp->ni_cnd.cn_flags & LOCKLEAF) && ndp->ni_vp)
-		unlock_vp = 1;
-	if (!(flags & NDF_NO_DVP_UNLOCK) &&
-	    (ndp->ni_cnd.cn_flags & LOCKPARENT) &&
-	    ndp->ni_dvp != ndp->ni_vp)
-		unlock_dvp = 1;
-	if (!(flags & NDF_NO_VP_RELE) && ndp->ni_vp) {
-		if (unlock_vp) {
-			vput(ndp->ni_vp);
-			unlock_vp = 0;
-		} else
-			vrele(ndp->ni_vp);
-		ndp->ni_vp = NULL;
-	}
-	if (unlock_vp)
-		VOP_UNLOCK(ndp->ni_vp);
-	if (!(flags & NDF_NO_DVP_RELE) &&
-	    (ndp->ni_cnd.cn_flags & (LOCKPARENT|WANTPARENT))) {
-		if (unlock_dvp) {
-			vput(ndp->ni_dvp);
-			unlock_dvp = 0;
-		} else
-			vrele(ndp->ni_dvp);
-		ndp->ni_dvp = NULL;
-	}
-	if (unlock_dvp)
-		VOP_UNLOCK(ndp->ni_dvp);
-	if (!(flags & NDF_NO_STARTDIR_RELE) &&
-	    (ndp->ni_cnd.cn_flags & SAVESTART)) {
-		vrele(ndp->ni_startdir);
-		ndp->ni_startdir = NULL;
-	}
-}
-
 #ifdef INVARIANTS
 /*
  * Validate the final state of ndp after the lookup.
diff --git a/sys/sys/namei.h b/sys/sys/namei.h
index 75e4051d8879..d527d4a3bed0 100644
--- a/sys/sys/namei.h
+++ b/sys/sys/namei.h
@@ -290,8 +290,6 @@ do {										\
 	_ndp->ni_cnd.cn_pnbuf = NULL;						\
 } while (0)
 
-void NDFREE(struct nameidata *, const u_int);
-
 int	namei(struct nameidata *ndp);
 int	vfs_lookup(struct nameidata *ndp);
 int	vfs_relookup(struct vnode *dvp, struct vnode **vpp,