Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162369562
D27794.id81462.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D27794.id81462.diff
View Options
Index: sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c
===================================================================
--- sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c
+++ sys/contrib/openzfs/module/os/freebsd/spl/spl_vfs.c
@@ -240,9 +240,9 @@
#endif
VI_LOCK(vp);
vp->v_iflag &= ~VI_MOUNT;
- VI_UNLOCK(vp);
-
+ vn_irflag_set_locked(vp, VIRF_MOUNTPOINT);
vp->v_mountedhere = mp;
+ VI_UNLOCK(vp);
/* Put the new filesystem on the mount list. */
mtx_lock(&mountlist_mtx);
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
Index: sys/kern/vfs_cache.c
===================================================================
--- sys/kern/vfs_cache.c
+++ sys/kern/vfs_cache.c
@@ -4818,21 +4818,10 @@
static bool
cache_fplookup_is_mp(struct cache_fpl *fpl)
{
- struct mount *mp;
struct vnode *vp;
vp = fpl->tvp;
-
- /*
- * Hack: while this is a union, the pointer tends to be NULL so save on
- * a branch.
- */
- mp = atomic_load_ptr(&vp->v_mountedhere);
- if (mp == NULL)
- return (false);
- if (vp->v_type == VDIR)
- return (true);
- return (false);
+ return ((vn_irflag_read(vp) & VIRF_MOUNTPOINT) != 0);
}
/*
Index: sys/kern/vfs_mount.c
===================================================================
--- sys/kern/vfs_mount.c
+++ sys/kern/vfs_mount.c
@@ -1034,8 +1034,9 @@
cache_purge(vp);
VI_LOCK(vp);
vp->v_iflag &= ~VI_MOUNT;
- VI_UNLOCK(vp);
+ vn_irflag_set_locked(vp, VIRF_MOUNTPOINT);
vp->v_mountedhere = mp;
+ VI_UNLOCK(vp);
/* Place the new filesystem at the end of the mount list. */
mtx_lock(&mountlist_mtx);
TAILQ_INSERT_TAIL(&mountlist, mp, mnt_list);
@@ -1881,8 +1882,11 @@
mtx_unlock(&mountlist_mtx);
EVENTHANDLER_DIRECT_INVOKE(vfs_unmounted, mp, td);
if (coveredvp != NULL) {
+ VI_LOCK(coveredvp);
+ vn_irflag_unset_locked(coveredvp, VIRF_MOUNTPOINT);
coveredvp->v_mountedhere = NULL;
- vn_seqc_write_end(coveredvp);
+ vn_seqc_write_end_locked(coveredvp);
+ VI_UNLOCK(coveredvp);
VOP_UNLOCK(coveredvp);
vdrop(coveredvp);
}
Index: sys/kern/vfs_mountroot.c
===================================================================
--- sys/kern/vfs_mountroot.c
+++ sys/kern/vfs_mountroot.c
@@ -335,8 +335,9 @@
VI_LOCK(vporoot);
vporoot->v_iflag &= ~VI_MOUNT;
- VI_UNLOCK(vporoot);
+ vn_irflag_unset_locked(vporoot, VIRF_MOUNTPOINT);
vporoot->v_mountedhere = NULL;
+ VI_UNLOCK(vporoot);
mporoot->mnt_flag &= ~MNT_ROOTFS;
mporoot->mnt_vnodecovered = NULL;
vput(vporoot);
@@ -393,11 +394,17 @@
vpdevfs = mpdevfs->mnt_vnodecovered;
if (vpdevfs != NULL) {
cache_purge(vpdevfs);
+ VI_LOCK(vpdevfs);
+ vn_irflag_unset_locked(vpdevfs, VIRF_MOUNTPOINT);
vpdevfs->v_mountedhere = NULL;
+ VI_UNLOCK(vpdevfs);
vrele(vpdevfs);
}
+ VI_LOCK(vp);
mpdevfs->mnt_vnodecovered = vp;
+ vn_irflag_set_locked(vp, VIRF_MOUNTPOINT);
vp->v_mountedhere = mpdevfs;
+ VI_UNLOCK(vp);
VOP_UNLOCK(vp);
} else
vput(vp);
Index: sys/kern/vfs_subr.c
===================================================================
--- sys/kern/vfs_subr.c
+++ sys/kern/vfs_subr.c
@@ -4042,7 +4042,9 @@
strlcat(buf, "|VIRF_DOOMED", sizeof(buf));
if (irflag & VIRF_PGREAD)
strlcat(buf, "|VIRF_PGREAD", sizeof(buf));
- flags = irflag & ~(VIRF_DOOMED | VIRF_PGREAD);
+ if (irflag & VIRF_MOUNTPOINT)
+ strlcat(buf, "|VIRF_MOUNTPOINT", sizeof(buf));
+ flags = irflag & ~(VIRF_DOOMED | VIRF_PGREAD | VIRF_MOUNTPOINT);
if (flags != 0) {
snprintf(buf2, sizeof(buf2), "|VIRF(0x%lx)", flags);
strlcat(buf, buf2, sizeof(buf));
Index: sys/sys/vnode.h
===================================================================
--- sys/sys/vnode.h
+++ sys/sys/vnode.h
@@ -246,6 +246,7 @@
#define VIRF_DOOMED 0x0001 /* This vnode is being recycled */
#define VIRF_PGREAD 0x0002 /* Direct reads from the page cache are permitted,
never cleared once set */
+#define VIRF_MOUNTPOINT 0x0004 /* This vnode is mounted on */
#define VI_TEXT_REF 0x0001 /* Text ref grabbed use ref */
#define VI_MOUNT 0x0002 /* Mount in progress */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 13, 2:07 PM (31 m, 18 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35034869
Default Alt Text
D27794.id81462.diff (3 KB)
Attached To
Mode
D27794: vfs: denote vnode being a mount point with VIRF_MOUNTPOINT
Attached
Detach File
Event Timeline
Log In to Comment