git: a755fb921ed2 - main - vfs: retire the V_MNTREF flag

From: Mateusz Guzik <mjg_at_FreeBSD.org>
Date: Wed, 14 Sep 2022 18:16:58 UTC
The branch main has been updated by mjg:

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

commit a755fb921ed2b72f369f8664b8b23854d992eec1
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2022-09-10 20:13:19 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
CommitDate: 2022-09-14 18:16:36 +0000

    vfs: retire the V_MNTREF flag
    
    Reviewed by:    kib, mckusick
    Differential Revision:  https://reviews.freebsd.org/D36521
---
 sys/kern/vfs_vnops.c | 10 ++--------
 sys/sys/vnode.h      |  1 -
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 60a1bd7302a2..2e39d8a9e4d2 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1904,9 +1904,6 @@ vn_start_write(struct vnode *vp, struct mount **mpp, int flags)
 	struct mount *mp;
 	int error;
 
-	KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL),
-	    ("V_MNTREF requires mp"));
-
 	error = 0;
 	/*
 	 * If a vnode is provided, get and return the mount point that
@@ -1930,7 +1927,7 @@ vn_start_write(struct vnode *vp, struct mount **mpp, int flags)
 	 * refcount for the provided mountpoint too, in order to
 	 * emulate a vfs_ref().
 	 */
-	if (vp == NULL && (flags & V_MNTREF) == 0)
+	if (vp == NULL)
 		vfs_ref(mp);
 
 	return (vn_start_write_refed(mp, flags, false));
@@ -1949,9 +1946,6 @@ vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags)
 	struct mount *mp;
 	int error;
 
-	KASSERT((flags & V_MNTREF) == 0 || (*mpp != NULL && vp == NULL),
-	    ("V_MNTREF requires mp"));
-
  retry:
 	if (vp != NULL) {
 		if ((error = VOP_GETWRITEMOUNT(vp, mpp)) != 0) {
@@ -1976,7 +1970,7 @@ vn_start_secondary_write(struct vnode *vp, struct mount **mpp, int flags)
 	 * emulate a vfs_ref().
 	 */
 	MNT_ILOCK(mp);
-	if (vp == NULL && (flags & V_MNTREF) == 0)
+	if (vp == NULL)
 		MNT_REF(mp);
 	if ((mp->mnt_kern_flag & (MNTK_SUSPENDED | MNTK_SUSPEND2)) == 0) {
 		mp->mnt_secondary_writes++;
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index ed292835c12f..30b74fef0902 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -431,7 +431,6 @@ extern int		vttoif_tab[];
 #define	V_WAIT		0x0001	/* vn_start_write: sleep for suspend */
 #define	V_NOWAIT	0x0002	/* vn_start_write: don't sleep for suspend */
 #define	V_XSLEEP	0x0004	/* vn_start_write: just return after sleep */
-#define	V_MNTREF	0x0010	/* vn_start_write: mp is already ref-ed */
 
 #define	VR_START_WRITE	0x0001	/* vfs_write_resume: start write atomically */
 #define	VR_NO_SUSPCLR	0x0002	/* vfs_write_resume: do not clear suspension */