aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib
diff options
context:
space:
mode:
authorJason A. Harmening <jah@FreeBSD.org>2021-05-11 15:54:58 +0000
committerJason A. Harmening <jah@FreeBSD.org>2021-05-30 21:53:47 +0000
commita4b07a2701f568c2c0f0c0426091f1489244a92d (patch)
tree1bf8f8a593fa6fa67eafd61a2449d71069e0de7e /sys/contrib
parent505dc43562d9ef4ea1f72e261139456f1d35387c (diff)
downloadsrc-a4b07a2701f568c2c0f0c0426091f1489244a92d.tar.gz
src-a4b07a2701f568c2c0f0c0426091f1489244a92d.zip
VFS_QUOTACTL(9): allow implementation to indicate busy state changes
Instead of requiring all implementations of vfs_quotactl to unbusy the mount for Q_QUOTAON and Q_QUOTAOFF, add an "mp_busy" in/out param to VFS_QUOTACTL(9). The implementation may then indicate to the caller whether it needed to unbusy the mount. Also, add stbool.h to libprocstat modules which #define _KERNEL before including sys/mount.h. Otherwise they'll pull in sys/types.h before defining _KERNEL and therefore won't have the bool definition they need for mp_busy. Reviewed By: kib, markj Differential Revision: https://reviews.freebsd.org/D30556
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
index a537342f9678..4f2d7df87fc0 100644
--- a/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
+++ b/sys/contrib/openzfs/module/os/freebsd/zfs/zfs_vfsops.c
@@ -102,7 +102,12 @@ SYSCTL_INT(_vfs_zfs_version, OID_AUTO, zpl, CTLFLAG_RD, &zfs_version_zpl, 0,
"ZPL_VERSION");
/* END CSTYLED */
+#if __FreeBSD_version >= 1400018
+static int zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg,
+ bool *mp_busy);
+#else
static int zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg);
+#endif
static int zfs_mount(vfs_t *vfsp);
static int zfs_umount(vfs_t *vfsp, int fflag);
static int zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp);
@@ -267,7 +272,11 @@ done:
}
static int
+#if __FreeBSD_version >= 1400018
+zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg, bool *mp_busy)
+#else
zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg)
+#endif
{
zfsvfs_t *zfsvfs = vfsp->vfs_data;
struct thread *td;
@@ -291,8 +300,10 @@ zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg)
break;
default:
error = EINVAL;
+#if __FreeBSD_version < 1400018
if (cmd == Q_QUOTAON || cmd == Q_QUOTAOFF)
vfs_unbusy(vfsp);
+#endif
goto done;
}
}
@@ -351,11 +362,15 @@ zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg)
case Q_QUOTAON:
// As far as I can tell, you can't turn quotas on or off on zfs
error = 0;
+#if __FreeBSD_version < 1400018
vfs_unbusy(vfsp);
+#endif
break;
case Q_QUOTAOFF:
error = ENOTSUP;
+#if __FreeBSD_version < 1400018
vfs_unbusy(vfsp);
+#endif
break;
case Q_SETQUOTA:
error = copyin(arg, &dqblk, sizeof (dqblk));