From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-fsdevel@vger.kernel.org
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 4/6] quota: Implement metagroup support for quota
Date: Thu, 18 Feb 2010 19:45:28 +0300 [thread overview]
Message-ID: <1266511530-10533-5-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1266511530-10533-4-git-send-email-dmonakhov@openvz.org>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/quota/dquot.c | 12 ++++++++++++
fs/quota/quotaio_v2.h | 6 ++++--
include/linux/quota.h | 12 +++++++++++-
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index de4b8fc..40075ea 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1090,6 +1090,11 @@ static int need_print_warning(struct dquot *dquot)
return current_fsuid() == dquot->dq_id;
case GRPQUOTA:
return in_group_p(dquot->dq_id);
+ case MGRQUOTA:
+ /* XXX: Currently there is no way to understand
+ which metagroup this task belonges to, So print
+ a warn message unconditionally. -dmon */
+ return 1;
}
return 0;
}
@@ -1322,6 +1327,13 @@ int dquot_initialize(struct inode *inode, int type)
case GRPQUOTA:
id = inode->i_gid;
break;
+ case MGRQUOTA:
+ if (inode->i_sb->s_aux_attr &&
+ inode->i_sb->s_aux_attr->metagroup)
+ id = *inode->i_sb->s_aux_attr->metagroup(inode);
+ else
+ BUG_ON(sb_has_quota_loaded(inode->i_sb, MGRQUOTA));
+ break;
}
got[cnt] = dqget(sb, id, cnt);
}
diff --git a/fs/quota/quotaio_v2.h b/fs/quota/quotaio_v2.h
index f1966b4..c65c7fc 100644
--- a/fs/quota/quotaio_v2.h
+++ b/fs/quota/quotaio_v2.h
@@ -13,12 +13,14 @@
*/
#define V2_INITQMAGICS {\
0xd9c01f11, /* USRQUOTA */\
- 0xd9c01927 /* GRPQUOTA */\
+ 0xd9c01927, /* GRPQUOTA */\
+ 0xd9c03f14 /* MRGQUOTA */\
}
#define V2_INITQVERSIONS {\
1, /* USRQUOTA */\
- 1 /* GRPQUOTA */\
+ 1, /* GRPQUOTA */ \
+ 1 /* MGRQUOTA */\
}
/* First generic header */
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 680605d..a8f6cbe 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -36,18 +36,28 @@
#include <linux/errno.h>
#include <linux/types.h>
-#define __DQUOT_VERSION__ "dquot_6.5.2"
+#define __DQUOT_VERSION__ "dquot_6.6.0"
+#ifdef CONFIG_METAGROUP
+#define MAXQUOTAS 3
+#else
#define MAXQUOTAS 2
+#endif
+
#define USRQUOTA 0 /* element used for user quotas */
#define GRPQUOTA 1 /* element used for group quotas */
+#ifdef CONFIG_METAGROUP
+#define MGRQUOTA 2 /* element used for metagroup quotas */
+#endif
+
/*
* Definitions for the default names of the quotas files.
*/
#define INITQFNAMES { \
"user", /* USRQUOTA */ \
"group", /* GRPQUOTA */ \
+ "metagroup", /* MGRQUOTA */ \
"undefined", \
};
--
1.6.6
next prev parent reply other threads:[~2010-02-18 16:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-18 16:45 [PATCH 0/6] RFC: introduce extended inode owner identifier v4 Dmitry Monakhov
2010-02-18 16:45 ` [PATCH 1/6] vfs: add per-sb auxiliary inode attribute table Dmitry Monakhov
2010-02-18 16:45 ` [PATCH 2/6] quota: switch reservation space management to aux_attribute Dmitry Monakhov
2010-02-18 16:45 ` [PATCH 3/6] vfs: Add additional owner identifier Dmitry Monakhov
2010-02-18 16:45 ` Dmitry Monakhov [this message]
2010-02-18 16:45 ` [PATCH 5/6] ext4: enlarge mount option field Dmitry Monakhov
2010-02-18 16:45 ` [PATCH 6/6] ext4: Implement metagroup support for ext4 filesystem Dmitry Monakhov
2010-02-18 19:00 ` [PATCH 1/6] vfs: add per-sb auxiliary inode attribute table Brad Boyer
2010-02-18 19:34 ` Dmitry Monakhov
2010-02-18 23:31 ` [PATCH 0/6] RFC: introduce extended inode owner identifier v4 Dave Chinner
2010-02-19 10:16 ` Dmitry Monakhov
2010-02-19 23:31 ` Dave Chinner
2010-02-20 10:58 ` Dmitry Monakhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1266511530-10533-5-git-send-email-dmonakhov@openvz.org \
--to=dmonakhov@openvz.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).