Skip to content

Commit 8dddb25

Browse files
authored
FreeBSD: incorporate changes to the VFS_QUOTACTL(9) KPI
VFS_QUOTACTL(9) has been updated to allow each filesystem to indicate whether it has changed the busy state of the mount. The filesystem may still assume that its .vfs_quotactl entrypoint is always called with the mount busied, but only needs to unbusy the mount (and clear *mp_busy) if it does something that actually requires the mount to be unbusied. It no longer needs to blindly copy-paste the UFS protocol for calling vfs_unbusy(9) for the Q_QUOTAOFF and Q_QUOTAON commands. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Jason Harmening <[email protected]> Closes #12052
1 parent 1f8e5b6 commit 8dddb25

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

module/os/freebsd/zfs/zfs_vfsops.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ SYSCTL_INT(_vfs_zfs_version, OID_AUTO, zpl, CTLFLAG_RD, &zfs_version_zpl, 0,
102102
"ZPL_VERSION");
103103
/* END CSTYLED */
104104

105+
#if __FreeBSD_version >= 1400018
106+
static int zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg,
107+
bool *mp_busy);
108+
#else
105109
static int zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg);
110+
#endif
106111
static int zfs_mount(vfs_t *vfsp);
107112
static int zfs_umount(vfs_t *vfsp, int fflag);
108113
static int zfs_root(vfs_t *vfsp, int flags, vnode_t **vpp);
@@ -267,7 +272,11 @@ zfs_getquota(zfsvfs_t *zfsvfs, uid_t id, int isgroup, struct dqblk64 *dqp)
267272
}
268273

269274
static int
275+
#if __FreeBSD_version >= 1400018
276+
zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg, bool *mp_busy)
277+
#else
270278
zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg)
279+
#endif
271280
{
272281
zfsvfs_t *zfsvfs = vfsp->vfs_data;
273282
struct thread *td;
@@ -291,8 +300,10 @@ zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg)
291300
break;
292301
default:
293302
error = EINVAL;
303+
#if __FreeBSD_version < 1400018
294304
if (cmd == Q_QUOTAON || cmd == Q_QUOTAOFF)
295305
vfs_unbusy(vfsp);
306+
#endif
296307
goto done;
297308
}
298309
}
@@ -351,11 +362,15 @@ zfs_quotactl(vfs_t *vfsp, int cmds, uid_t id, void *arg)
351362
case Q_QUOTAON:
352363
// As far as I can tell, you can't turn quotas on or off on zfs
353364
error = 0;
365+
#if __FreeBSD_version < 1400018
354366
vfs_unbusy(vfsp);
367+
#endif
355368
break;
356369
case Q_QUOTAOFF:
357370
error = ENOTSUP;
371+
#if __FreeBSD_version < 1400018
358372
vfs_unbusy(vfsp);
373+
#endif
359374
break;
360375
case Q_SETQUOTA:
361376
error = copyin(arg, &dqblk, sizeof (dqblk));

0 commit comments

Comments
 (0)