From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-fsdevel@vger.kernel.org
Cc: Dmitry Monakhov <dmonakhov@openvz.org>
Subject: [PATCH 2/6] quota: switch reservation space management to aux_attribute
Date: Thu, 18 Feb 2010 19:45:26 +0300 [thread overview]
Message-ID: <1266511530-10533-3-git-send-email-dmonakhov@openvz.org> (raw)
In-Reply-To: <1266511530-10533-2-git-send-email-dmonakhov@openvz.org>
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
fs/ext4/super.c | 11 +++++++----
fs/quota/dquot.c | 7 ++++---
include/linux/fs.h | 5 +++++
include/linux/quota.h | 3 ---
4 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 735c20d..84a51d9 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1018,9 +1018,6 @@ static const struct dquot_operations ext4_quota_operations = {
.reserve_space = dquot_reserve_space,
.claim_space = dquot_claim_space,
.release_rsv = dquot_release_reserved_space,
-#ifdef CONFIG_QUOTA
- .get_reserved_space = ext4_get_reserved_space,
-#endif
.alloc_inode = dquot_alloc_inode,
.free_space = dquot_free_space,
.free_inode = dquot_free_inode,
@@ -1033,7 +1030,13 @@ static const struct dquot_operations ext4_quota_operations = {
.alloc_dquot = dquot_alloc,
.destroy_dquot = dquot_destroy,
};
-
+static const struct aux_attributes ext4_aux_attr =
+{
+ .supported = 1,
+#ifdef CONFIG_QUOTA
+ .reserved_space = ext4_get_reserved_space,
+#endif
+};
static const struct quotactl_ops ext4_qctl_operations = {
.quota_on = ext4_quota_on,
.quota_off = vfs_quota_off,
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 4d2041f..de4b8fc 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1405,8 +1405,8 @@ static qsize_t *inode_reserved_space(struct inode * inode)
{
/* Filesystem must explicitly define it's own method in order to use
* quota reservation interface */
- BUG_ON(!inode->i_sb->dq_op->get_reserved_space);
- return inode->i_sb->dq_op->get_reserved_space(inode);
+ BUG_ON(!inode->i_sb->s_aux_attr->reserved_space);
+ return inode->i_sb->s_aux_attr->reserved_space(inode);
}
void inode_add_rsv_space(struct inode *inode, qsize_t number)
@@ -1438,7 +1438,8 @@ static qsize_t inode_get_rsv_space(struct inode *inode)
{
qsize_t ret;
- if (!inode->i_sb->dq_op->get_reserved_space)
+ if (!inode->i_sb->s_aux_attr ||
+ !inode->i_sb->s_aux_attr->reserved_space)
return 0;
spin_lock(&inode->i_lock);
ret = *inode_reserved_space(inode);
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c510ef7..0cd0105 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1581,6 +1581,11 @@ struct super_operations {
struct aux_attributes
{
int supported;
+#ifdef CONFIG_QUOTA
+ /* Delay allocation space reservation managed internally by quota,
+ * and protected by i_lock similar to i_blocks+i_bytes. */
+ qsize_t* (*reserved_space)(struct inode *inode);
+#endif
};
/*
* Inode state bits. Protected by inode_lock.
diff --git a/include/linux/quota.h b/include/linux/quota.h
index edf34f2..680605d 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -315,9 +315,6 @@ struct dquot_operations {
int (*claim_space) (struct inode *, qsize_t);
/* release rsved quota for delayed alloc */
void (*release_rsv) (struct inode *, qsize_t);
- /* get reserved quota for delayed alloc, value returned is managed by
- * quota code only */
- qsize_t *(*get_reserved_space) (struct inode *);
};
/* Operations handling requests from userspace */
--
1.6.6
next prev parent reply other threads:[~2010-02-18 16:51 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 ` Dmitry Monakhov [this message]
2010-02-18 16:45 ` [PATCH 3/6] vfs: Add additional owner identifier Dmitry Monakhov
2010-02-18 16:45 ` [PATCH 4/6] quota: Implement metagroup support for quota Dmitry Monakhov
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-3-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).