aboutsummaryrefslogtreecommitdiff
path: root/sys/fs/nullfs
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2020-08-10 10:31:17 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2020-08-10 10:31:17 +0000
commitfc9fcee01a1798efd08cc16249504ddb9171e138 (patch)
tree822790a8111cc45207001cedf06b2175d692acda /sys/fs/nullfs
parentf8024c39154c7b433c7bc631588f2bd7b5143a07 (diff)
downloadsrc-fc9fcee01a1798efd08cc16249504ddb9171e138.tar.gz
src-fc9fcee01a1798efd08cc16249504ddb9171e138.zip
nullfs: add missing VOP_STAT handling
Tested by: pho
Notes
Notes: svn path=/head/; revision=364063
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r--sys/fs/nullfs/null_vnops.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c
index 4dd555a18dbe..60fd2a2c3660 100644
--- a/sys/fs/nullfs/null_vnops.c
+++ b/sys/fs/nullfs/null_vnops.c
@@ -182,6 +182,7 @@
#include <sys/namei.h>
#include <sys/sysctl.h>
#include <sys/vnode.h>
+#include <sys/stat.h>
#include <fs/nullfs/null.h>
@@ -484,9 +485,21 @@ null_setattr(struct vop_setattr_args *ap)
}
/*
- * We handle getattr only to change the fsid.
+ * We handle stat and getattr only to change the fsid.
*/
static int
+null_stat(struct vop_stat_args *ap)
+{
+ int error;
+
+ if ((error = null_bypass((struct vop_generic_args *)ap)) != 0)
+ return (error);
+
+ ap->a_sb->st_dev = ap->a_vp->v_mount->mnt_stat.f_fsid.val[0];
+ return (0);
+}
+
+static int
null_getattr(struct vop_getattr_args *ap)
{
int error;
@@ -918,6 +931,7 @@ struct vop_vector null_vnodeops = {
.vop_accessx = null_accessx,
.vop_advlockpurge = vop_stdadvlockpurge,
.vop_bmap = VOP_EOPNOTSUPP,
+ .vop_stat = null_stat,
.vop_getattr = null_getattr,
.vop_getwritemount = null_getwritemount,
.vop_inactive = null_inactive,