From: Pavel Emelyanov <xemul@openvz.org>
To: Andreas Dilger <adilger@sun.com>, "Theodore Ts'o" <tytso@mit.edu>,
Andrew Morton <akpm@linux-foundation.org>,
linux-ext4@vger.kernel.org
Cc: Dmitri Monakhov <dmonakhov@openvz.org>
Subject: [PATCH] A request to reserve a "tree id" field on ext[34] inodes
Date: Tue, 17 Nov 2009 17:04:59 +0300 [thread overview]
Message-ID: <4B02AD8B.2030202@openvz.org> (raw)
Hi.
We have a proposal to implement a 2-level disk quota on ext3 and ext4.
In two words - the aim is to have directories on ext3/4 partitions
which are limited by its disk usage and the number of inodes. Further
the plan is to allow configuring uid and gid quotas within them.
The main usage of this is containers. When two or more of them are
located on one disk their roots will be marked with a unique tree id
and thus the disk consumption of each container will be limited. While
achieving this goal having an id of what tree an inode belongs to is
a key requirement.
So first we would like to ask to reserve a place on ext3 and ext4 inodes
for that ID.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 26d3cf8..0fda97c 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -471,7 +471,7 @@ struct ext4_inode {
__le16 l_i_file_acl_high;
__le16 l_i_uid_high; /* these 2 fields */
__le16 l_i_gid_high; /* were reserved2[0] */
- __u32 l_i_reserved2;
+ __u32 l_i_tree_id; /* reserved for 2-level disk quota */
} linux2;
struct {
__le16 h_i_reserved1; /* Obsoleted fragment number/size which are removed in ext4 */
@@ -585,7 +585,7 @@ do { \
#define i_gid_low i_gid
#define i_uid_high osd2.linux2.l_i_uid_high
#define i_gid_high osd2.linux2.l_i_gid_high
-#define i_reserved2 osd2.linux2.l_i_reserved2
+#define i_tree_id osd2.linux2.l_i_tree_id
#elif defined(__GNU__)
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 7499b36..d9f633d 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -320,7 +320,7 @@ struct ext3_inode {
__u16 i_pad1;
__le16 l_i_uid_high; /* these 2 fields */
__le16 l_i_gid_high; /* were reserved2[0] */
- __u32 l_i_reserved2;
+ __u32 l_i_tree_id; /* reserved for 2-level disk quota */
} linux2;
struct {
__u8 h_i_frag; /* Fragment number */
@@ -351,7 +351,7 @@ struct ext3_inode {
#define i_gid_low i_gid
#define i_uid_high osd2.linux2.l_i_uid_high
#define i_gid_high osd2.linux2.l_i_gid_high
-#define i_reserved2 osd2.linux2.l_i_reserved2
+#define i_tree_id osd2.linux2.l_i_tree_id
#elif defined(__GNU__)
next reply other threads:[~2009-11-17 14:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 14:04 Pavel Emelyanov [this message]
2009-11-17 17:06 ` [PATCH] A request to reserve a "tree id" field on ext[34] inodes Andreas Dilger
2009-11-17 21:19 ` Dmitry Monakhov
2009-11-18 17:43 ` Dmitry Monakhov
2009-11-19 6:33 ` Andreas Dilger
2009-11-17 17:12 ` Jan Kara
2009-11-17 17:55 ` Pavel Emelyanov
2009-11-17 18:47 ` Jan Kara
2009-11-17 21:19 ` 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=4B02AD8B.2030202@openvz.org \
--to=xemul@openvz.org \
--cc=adilger@sun.com \
--cc=akpm@linux-foundation.org \
--cc=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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