]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
quota: Make _SUSPENDED just a flag
authorJan Kara <jack@suse.cz>
Wed, 20 Aug 2008 14:21:01 +0000 (16:21 +0200)
committerMark Fasheh <mfasheh@suse.com>
Mon, 5 Jan 2009 16:36:56 +0000 (08:36 -0800)
Upto now, DQUOT_USR_SUSPENDED behaved like a state - i.e., either quota
was enabled or suspended or none. Now allowed states are 0, ENABLED,
ENABLED | SUSPENDED. This will be useful later when we implement separate
enabling of quota usage tracking and limits enforcement because we need to
keep track of a state which has been suspended.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/dquot.c
include/linux/quotaops.h

index c88330602ddd4a9ce909352138898208d380ec8c..22340c610e1a2b9c50c59ad5b683dd8f2871d400 100644 (file)
@@ -1570,18 +1570,20 @@ static inline void reset_enable_flags(struct quota_info *dqopt, int type,
 {
        switch (type) {
                case USRQUOTA:
-                       dqopt->flags &= ~DQUOT_USR_ENABLED;
                        if (remount)
                                dqopt->flags |= DQUOT_USR_SUSPENDED;
-                       else
+                       else {
+                               dqopt->flags &= ~DQUOT_USR_ENABLED;
                                dqopt->flags &= ~DQUOT_USR_SUSPENDED;
+                       }
                        break;
                case GRPQUOTA:
-                       dqopt->flags &= ~DQUOT_GRP_ENABLED;
                        if (remount)
                                dqopt->flags |= DQUOT_GRP_SUSPENDED;
-                       else
+                       else {
+                               dqopt->flags &= ~DQUOT_GRP_ENABLED;
                                dqopt->flags &= ~DQUOT_GRP_SUSPENDED;
+                       }
                        break;
        }
 }
index adcc7ba3accb09f454a28226c906476c5ffcc0f3..ffd97071cd1e5082a3376d6824acaf8a01f29eda 100644 (file)
@@ -67,8 +67,10 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
 static inline int sb_has_quota_enabled(struct super_block *sb, int type)
 {
        if (type == USRQUOTA)
-               return sb_dqopt(sb)->flags & DQUOT_USR_ENABLED;
-       return sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED;
+               return (sb_dqopt(sb)->flags & DQUOT_USR_ENABLED)
+                       && !(sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED);
+       return (sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED)
+               && !(sb_dqopt(sb)->flags & DQUOT_GROUP_SUSPENDED);
 }
 
 static inline int sb_any_quota_enabled(struct super_block *sb)