Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ufs Patch from Edgar Fu? on tech-kern:
details: https://anonhg.NetBSD.org/src/rev/5bcbce56ceaa
branches: trunk
changeset: 326450:5bcbce56ceaa
user: bouyer <bouyer%NetBSD.org@localhost>
date: Wed Jan 29 20:13:04 2014 +0000
description:
Patch from Edgar Fu? on tech-kern:
set grace time if lowering the limit cause the user/group to now be overquota.
diffstat:
sys/ufs/ufs/ufs_quota2.c | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diffs (42 lines):
diff -r f354eca4f9a0 -r 5bcbce56ceaa sys/ufs/ufs/ufs_quota2.c
--- a/sys/ufs/ufs/ufs_quota2.c Wed Jan 29 19:00:08 2014 +0000
+++ b/sys/ufs/ufs/ufs_quota2.c Wed Jan 29 20:13:04 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ufs_quota2.c,v 1.36 2013/10/20 00:29:10 htodd Exp $ */
+/* $NetBSD: ufs_quota2.c,v 1.37 2014/01/29 20:13:04 bouyer Exp $ */
/*-
* Copyright (c) 2010 Manuel Bouyer
* All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_quota2.c,v 1.36 2013/10/20 00:29:10 htodd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_quota2.c,v 1.37 2014/01/29 20:13:04 bouyer Exp $");
#include <sys/buf.h>
#include <sys/param.h>
@@ -42,6 +42,7 @@
#include <sys/wapbl.h>
#include <sys/quota.h>
#include <sys/quotactl.h>
+#include <sys/timevar.h>
#include <ufs/ufs/quota2.h>
#include <ufs/ufs/inode.h>
@@ -627,6 +628,15 @@
goto out_il;
quota2_ufs_rwq2e(q2ep, &q2e, needswap);
+ /*
+ * Reset time limit if previously had no soft limit or were
+ * under it, but now have a soft limit and are over it.
+ */
+ if (val->qv_softlimit &&
+ q2e.q2e_val[key->qk_objtype].q2v_cur >= val->qv_softlimit &&
+ (q2e.q2e_val[key->qk_objtype].q2v_softlimit == 0 ||
+ q2e.q2e_val[key->qk_objtype].q2v_cur < q2e.q2e_val[key->qk_objtype].q2v_softlimit))
+ q2e.q2e_val[key->qk_objtype].q2v_time = time_second + val->qv_grace;
quota2_dict_update_q2e_limits(key->qk_objtype, val, &q2e);
quota2_ufs_rwq2e(&q2e, q2ep, needswap);
quota2_bwrite(ump->um_mountp, bp);
Home |
Main Index |
Thread Index |
Old Index