From a783c51f76bb983dddc962773f656cf84bfd4dd2 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Tue, 9 Nov 2021 23:56:55 +0100 Subject: [PATCH] quota: quota-util - Simplify quota_is_over() --- src/plugins/quota/quota-util.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/plugins/quota/quota-util.c b/src/plugins/quota/quota-util.c index 3ea95d7b49..0e0738c610 100644 --- a/src/plugins/quota/quota-util.c +++ b/src/plugins/quota/quota-util.c @@ -90,16 +90,12 @@ quota_is_over(uoff_t alloc, int64_t used, uint64_t ceil, uint64_t over) return TRUE; } } - } else if (alloc == 0) { - /* Nothing was allocated in this transaction. We need to - explicitly test this case, since the generic check would fail - if user is already over quota. */ + } else { + /* Resource usage increased in this transaction. */ if (over > 0) { /* Resource usage is already over quota. */ return TRUE; } - } else { - /* Resource usage increased in this transaction. */ if (ceil < alloc || (ceil - alloc) < (uint64_t)used) { /* Limit reached. */ return TRUE; -- 2.47.3