vfs: retire the V_MNTREF flag

Reviewed by:	kib, mckusick
Differential Revision:	https://reviews.freebsd.org/D36521
This commit is contained in:
Mateusz Guzik 2022-09-10 22:13:19 +02:00
parent 61a1d5dde2
commit a755fb921e
2 changed files with 2 additions and 9 deletions

View File

@ -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++;

View File

@ -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 */