git: e72d3b0dc00e - main - mntfs: store the owning mount point in the v_data of the mntfs vnode

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Thu, 19 Nov 2026 12:18:23 UTC
The branch main has been updated by kib:

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

commit e72d3b0dc00ed8181dad11f74dc417d2a41d3619
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-11-18 01:42:13 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-11-19 12:17:46 +0000

    mntfs: store the owning mount point in the v_data of the mntfs vnode
    
    Tested by:      pho
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 sys/fs/mntfs/mntfs_vnops.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/fs/mntfs/mntfs_vnops.c b/sys/fs/mntfs/mntfs_vnops.c
index edb1e8d407ae..45c429c34c07 100644
--- a/sys/fs/mntfs/mntfs_vnops.c
+++ b/sys/fs/mntfs/mntfs_vnops.c
@@ -46,6 +46,7 @@ mntfs_reclaim(struct vop_reclaim_args *ap)
 {
 	struct vnode *vp = ap->a_vp;
 
+	vp->v_data = NULL;
 	dev_rel(vp->v_rdev);
 	return (0);
 }
@@ -77,7 +78,7 @@ mntfs_allocvp(struct mount *mp, struct vnode *ovp)
 
 	getnewvnode("mntfs", mp, &mntfs_vnodeops, &vp);
 	vp->v_type = VCHR;
-	vp->v_data = NULL;
+	vp->v_data = mp;
 	dev_ref(dev);
 	vp->v_rdev = dev;