git: b8044a0ccef0 - stable/15 - vnode: move VIRF_KNOTE to v_v2flag

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sun, 21 Jun 2026 10:16:07 UTC
The branch stable/15 has been updated by kib:

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

commit b8044a0ccef0700de08951bf98701d1e3890f11a
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-05-09 19:14:56 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-06-21 10:05:32 +0000

    vnode: move VIRF_KNOTE to v_v2flag
    
    (cherry picked from commit 64467d2ec3ede11430554fea68b317d27bf4b5c3)
---
 sys/kern/vfs_subr.c | 5 ++---
 sys/sys/mount.h     | 4 ++--
 sys/sys/vnode.h     | 7 ++++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7cc13be5109a..00795bdd08e7 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -6655,7 +6655,7 @@ vfs_knlunlock(void *arg)
 	struct vnode *vp = arg;
 
 	if (KNLIST_EMPTY(&vp->v_pollinfo->vpi_selinfo.si_note))
-		vn_irflag_unset(vp, VIRF_KNOTE);
+		vp->v_v2flag &= ~V2_KNOTE;
 	VOP_UNLOCK(vp);
 }
 
@@ -6705,8 +6705,7 @@ vfs_kqfilter(struct vop_kqfilter_args *ap)
 	vhold(vp);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
 	knlist_add(knl, kn, 1);
-	if ((vn_irflag_read(vp) & VIRF_KNOTE) == 0)
-		vn_irflag_set(vp, VIRF_KNOTE);
+	vp->v_v2flag |= V2_KNOTE;
 	VOP_UNLOCK(vp);
 
 	return (0);
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 7e56d4b90b0e..a1e5e4efd460 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -967,7 +967,7 @@ VFS_PURGE(struct mount *mp)
 static inline void
 VFS_KNOTE_LOCKED(struct vnode *vp, int hint)
 {
-	if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) {
+	if ((vp->v_v2flag & V2_KNOTE) != 0) {
 		KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note,
 		    hint, KNF_LISTLOCKED | KNF_NOKQLOCK);
 	}
@@ -976,7 +976,7 @@ VFS_KNOTE_LOCKED(struct vnode *vp, int hint)
 static inline void
 VFS_KNOTE_UNLOCKED(struct vnode *vp, int hint)
 {
-	if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) {
+	if ((vp->v_v2flag & V2_KNOTE) != 0) {
 		KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note,
 		    hint, KNF_NOKQLOCK);
 	}
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index cf6afe8792b8..0e84127cbc32 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -229,7 +229,7 @@ _Static_assert(sizeof(struct vnode) <= 448, "vnode size crosses 448 bytes");
 #define v_object	v_bufobj.bo_object
 
 #define VN_KNOTE(vp, b, a) do {                    			\
-	if ((vn_irflag_read(vp) & VIRF_KNOTE) != 0) {			\
+	if ((vp->v_v2flag & V2_KNOTE) != 0) {			\
 		KNOTE(&vp->v_pollinfo->vpi_selinfo.si_note, (b),	\
 		    (a) | KNF_NOKQLOCK);				\
 	}								\
@@ -261,7 +261,8 @@ _Static_assert(sizeof(struct vnode) <= 448, "vnode size crosses 448 bytes");
 #define	VIRF_INOTIFY	0x0080	/* This vnode is being watched */
 #define	VIRF_INOTIFY_PARENT 0x0100 /* A parent of this vnode may be being
 				      watched */
-#define	VIRF_KNOTE	0x0200	/* Has knlist */
+
+#define	V2_KNOTE	0x0001	/* Has knlist */
 
 #define	VI_UNUSED0	0x0001	/* unused */
 #define	VI_MOUNT	0x0002	/* Mount in progress */
@@ -1064,7 +1065,7 @@ void	vop_rename_fail(struct vop_rename_args *ap);
 	off_t osize, ooffset, noffset;					\
 									\
 	osize = ooffset = noffset = 0;					\
-	if ((vn_irflag_read((ap)->a_vp) & VIRF_KNOTE) != 0) {		\
+	if (((ap)->a_vp->v_v2flag & V2_KNOTE) != 0) {			\
 		error = VOP_GETATTR((ap)->a_vp, &va, (ap)->a_cred);	\
 		if (error)						\
 			return (error);					\