]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.suse/quota-Make-_SUSPENDED-just-a-flag.patch
Revert "Move xen patchset to new version's subdir."
[people/teissler/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.suse / quota-Make-_SUSPENDED-just-a-flag.patch
CommitLineData
00e5a55c
BS
1From: Jan Kara <jack@suse.cz>
2References: fate#302681
3Subject: [PATCH 04/28] quota: Make _SUSPENDED just a flag
4Patch-mainline: 2.6.29?
5
6Upto now, DQUOT_USR_SUSPENDED behaved like a state - i.e., either quota
7was enabled or suspended or none. Now allowed states are 0, ENABLED,
8ENABLED | SUSPENDED. This will be useful later when we implement separate
9enabling of quota usage tracking and limits enforcement because we need to
10keep track of a state which has been suspended.
11
12Signed-off-by: Jan Kara <jack@suse.cz>
13---
14 fs/dquot.c | 10 ++++++----
15 include/linux/quotaops.h | 6 ++++--
16 2 files changed, 10 insertions(+), 6 deletions(-)
17
18diff --git a/fs/dquot.c b/fs/dquot.c
19index e95ad55..aea7bf9 100644
20--- a/fs/dquot.c
21+++ b/fs/dquot.c
22@@ -1568,18 +1568,20 @@ static inline void reset_enable_flags(struct quota_info *dqopt, int type,
23 {
24 switch (type) {
25 case USRQUOTA:
26- dqopt->flags &= ~DQUOT_USR_ENABLED;
27 if (remount)
28 dqopt->flags |= DQUOT_USR_SUSPENDED;
29- else
30+ else {
31+ dqopt->flags &= ~DQUOT_USR_ENABLED;
32 dqopt->flags &= ~DQUOT_USR_SUSPENDED;
33+ }
34 break;
35 case GRPQUOTA:
36- dqopt->flags &= ~DQUOT_GRP_ENABLED;
37 if (remount)
38 dqopt->flags |= DQUOT_GRP_SUSPENDED;
39- else
40+ else {
41+ dqopt->flags &= ~DQUOT_GRP_ENABLED;
42 dqopt->flags &= ~DQUOT_GRP_SUSPENDED;
43+ }
44 break;
45 }
46 }
47diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
48index 9e7bc4b..12363cc 100644
49--- a/include/linux/quotaops.h
50+++ b/include/linux/quotaops.h
51@@ -70,8 +70,10 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
52 static inline int sb_has_quota_enabled(struct super_block *sb, int type)
53 {
54 if (type == USRQUOTA)
55- return sb_dqopt(sb)->flags & DQUOT_USR_ENABLED;
56- return sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED;
57+ return (sb_dqopt(sb)->flags & DQUOT_USR_ENABLED)
58+ && !(sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED);
59+ return (sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED)
60+ && !(sb_dqopt(sb)->flags & DQUOT_GROUP_SUSPENDED);
61 }
62
63 static inline int sb_any_quota_enabled(struct super_block *sb)
64--
651.5.2.4
66