aboutsummaryrefslogtreecommitdiff
path: root/sys/ufs/ufs/ufs_vfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ufs/ufs/ufs_vfsops.c')
-rw-r--r--sys/ufs/ufs/ufs_vfsops.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sys/ufs/ufs/ufs_vfsops.c b/sys/ufs/ufs/ufs_vfsops.c
index 0f45baed634f..33ef7bc2c3d1 100644
--- a/sys/ufs/ufs/ufs_vfsops.c
+++ b/sys/ufs/ufs/ufs_vfsops.c
@@ -87,17 +87,14 @@ ufs_root(mp, flags, vpp)
* Do operations associated with quotas
*/
int
-ufs_quotactl(mp, cmds, id, arg)
+ufs_quotactl(mp, cmds, id, arg, mp_busy)
struct mount *mp;
int cmds;
uid_t id;
void *arg;
+ bool *mp_busy;
{
#ifndef QUOTA
- if ((cmds >> SUBCMDSHIFT) == Q_QUOTAON ||
- (cmds >> SUBCMDSHIFT) == Q_QUOTAOFF)
- vfs_unbusy(mp);
-
return (EOPNOTSUPP);
#else
struct thread *td;
@@ -117,25 +114,23 @@ ufs_quotactl(mp, cmds, id, arg)
break;
default:
- if (cmd == Q_QUOTAON || cmd == Q_QUOTAOFF)
- vfs_unbusy(mp);
return (EINVAL);
}
}
- if ((u_int)type >= MAXQUOTAS) {
- if (cmd == Q_QUOTAON || cmd == Q_QUOTAOFF)
- vfs_unbusy(mp);
+ if ((u_int)type >= MAXQUOTAS)
return (EINVAL);
- }
switch (cmd) {
case Q_QUOTAON:
- error = quotaon(td, mp, type, arg);
+ error = quotaon(td, mp, type, arg, mp_busy);
break;
case Q_QUOTAOFF:
vfs_ref(mp);
+ KASSERT(*mp_busy,
+ ("%s called without busied mount", __func__));
vfs_unbusy(mp);
+ *mp_busy = false;
vn_start_write(NULL, &mp, V_WAIT | V_MNTREF);
error = quotaoff(td, mp, type);
vn_finished_write(mp);