]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.suse/quota-Make-_SUSPENDED-just-a-flag.patch
5e5f1e1764da944ce4bc82e2dafeeac79c9bbb48
[ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / quota-Make-_SUSPENDED-just-a-flag.patch
1 From: Jan Kara <jack@suse.cz>
2 References: fate#302681
3 Subject: [PATCH 04/28] quota: Make _SUSPENDED just a flag
4 Patch-mainline: 2.6.29?
5
6 Upto now, DQUOT_USR_SUSPENDED behaved like a state - i.e., either quota
7 was enabled or suspended or none. Now allowed states are 0, ENABLED,
8 ENABLED | SUSPENDED. This will be useful later when we implement separate
9 enabling of quota usage tracking and limits enforcement because we need to
10 keep track of a state which has been suspended.
11
12 Signed-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
18 diff --git a/fs/dquot.c b/fs/dquot.c
19 index 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 }
47 diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
48 index 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 --
65 1.5.2.4
66