Page MenuHomeFreeBSD

D59910.id187784.diff
No OneTemporary

D59910.id187784.diff

diff --git a/lib/libsys/stat.2 b/lib/libsys/stat.2
--- a/lib/libsys/stat.2
+++ b/lib/libsys/stat.2
@@ -365,6 +365,10 @@
.Bl -tag -width indent
.It Dv SFBSD_NAMEDATTR
The file is a named attribute or a named attribute directory.
+.It Dv SFBSD_MNTPOINT
+The file is a mount point.
+The reported file attributes describe the root node of the file system
+mounted on it.
.El
.Sh RETURN VALUES
.Rv -std
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -2570,6 +2570,8 @@
}
error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED);
NDFREE_PNBUF(&nd);
+ if (error == 0 && (nd.ni_vp->v_vflag & VV_ROOT) != 0)
+ sbp->st_bsdflags |= SFBSD_MNTPOINT;
vput(nd.ni_vp);
#ifdef __STAT_TIME_T_EXT
sbp->st_atim_ext = 0;
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -1838,6 +1838,8 @@
vn_lock(vp, LK_SHARED | LK_RETRY);
error = VOP_STAT(vp, sb, active_cred, fp->f_cred);
+ if (error == 0 && (vp->v_vflag & VV_ROOT) != 0)
+ sb->st_bsdflags |= SFBSD_MNTPOINT;
VOP_UNLOCK(vp);
return (error);
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -343,6 +343,7 @@
/* st_bsdflags */
#define SFBSD_NAMEDATTR 0x0001 /* file is named attribute or dir */
+#define SFBSD_MNTPOINT 0x0002 /* file is a mount point */
#ifdef _KERNEL
/*

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 2, 1:50 AM (32 m, 37 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40020480
Default Alt Text
D59910.id187784.diff (1 KB)

Event Timeline