stat(2): report mount points using st_bsdflags SFBSD_MNTPOINT flag

Reviewed by:	jah, sobomax, markj, olce
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D59910
This commit is contained in:
Konstantin Belousov committed 2026-10-01 00:36:03 +03:00
1 parent 9cf774a577
commit 0d5d887293
3 files changed
+5

No files matched your search

+2
View File
@@ -2570,6 +2570,8 @@ kern_statat(struct thread *td, int flag, int fd, const char *path,
}
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;
+2
View File
@@ -1838,6 +1838,8 @@ vn_statfile(struct file *fp, struct stat *sb, struct ucred *active_cred)
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);
+1
View File
@@ -343,6 +343,7 @@ struct nstat {
/* st_bsdflags */
#define SFBSD_NAMEDATTR 0x0001 /* file is named attribute or dir */
#define SFBSD_MNTPOINT 0x0002 /* file is a mount point */
#ifdef _KERNEL
/*