Document update
[ct-quota-pq.git] / quota-add-treeid.patch
blobf6f333559084701d6ea781b6129c352b494b7634
1 quota: add generic treeid quota support
3 Just introduce new and update macros.
4 It will be used later.
5 diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
6 index 13503af..b03c26a 100644
7 --- a/fs/quota/dquot.c
8 +++ b/fs/quota/dquot.c
9 @@ -1021,6 +1021,11 @@ static int need_print_warning(struct dquot *dquot)
10 return current_fsuid() == dquot->dq_id;
11 case GRPQUOTA:
12 return in_group_p(dquot->dq_id);
13 + case TRQUOTA:
14 + //// FIXME: Figure out in which container this task
15 + //// belongs to. It is strange, but seems it is
16 + //// impossible to understand from current->css_set.
17 + return 1;
19 return 0;
21 diff --git a/fs/quota/quota.c b/fs/quota/quota.c
22 index 95c5b42..a957a72 100644
23 --- a/fs/quota/quota.c
24 +++ b/fs/quota/quota.c
25 @@ -84,6 +84,9 @@ static int generic_quotactl_valid(struct super_block *sb, int type, int cmd,
26 if (((type == USRQUOTA && current_euid() != id) ||
27 (type == GRPQUOTA && !in_egroup_p(id))) &&
28 !capable(CAP_SYS_ADMIN))
29 + //// FIXME: Figure out in which container this task
30 + //// belongs to. It is strange, but seems it is
31 + //// impossible to understand from current->css_set.
32 return -EPERM;
34 else if (cmd != Q_GETFMT && cmd != Q_SYNC && cmd != Q_GETINFO)
35 diff --git a/fs/quota/quotaio_v2.h b/fs/quota/quotaio_v2.h
36 index 530fe58..d6261ef 100644
37 --- a/fs/quota/quotaio_v2.h
38 +++ b/fs/quota/quotaio_v2.h
39 @@ -13,12 +13,14 @@
41 #define V2_INITQMAGICS {\
42 0xd9c01f11, /* USRQUOTA */\
43 - 0xd9c01927 /* GRPQUOTA */\
44 + 0xd9c01927, /* GRPQUOTA */ \
45 + 0xd9c03f14 /* TRQUOTA */\
48 #define V2_INITQVERSIONS {\
49 0, /* USRQUOTA */\
50 - 0 /* GRPQUOTA */\
51 + 0, /* GRPQUOTA */ \
52 + 0 /* TRPQUOTA */\
55 /* First generic header */
56 diff --git a/include/linux/quota.h b/include/linux/quota.h
57 index 675ca18..eb080c3 100644
58 --- a/include/linux/quota.h
59 +++ b/include/linux/quota.h
60 @@ -36,11 +36,13 @@
61 #include <linux/errno.h>
62 #include <linux/types.h>
64 -#define __DQUOT_VERSION__ "dquot_6.5.2"
65 +////FIXME: dmon implement trquota support for quota-tools
66 +#define __DQUOT_VERSION__ "dquot_7.0.0"
68 -#define MAXQUOTAS 2
69 +#define MAXQUOTAS 3
70 #define USRQUOTA 0 /* element used for user quotas */
71 #define GRPQUOTA 1 /* element used for group quotas */
72 +#define TRQUOTA 2 /* element used for directory tree quotas */
75 * Definitions for the default names of the quotas files.
76 @@ -48,6 +50,7 @@
77 #define INITQFNAMES { \
78 "user", /* USRQUOTA */ \
79 "group", /* GRPQUOTA */ \
80 + "tree", /* TRQUOTA */ \
81 "undefined", \