From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org
Subject: Re: [PATCH] quota: manage reserved space even when quota is not active
Date: Thu, 17 Dec 2009 15:28:08 +0100 [thread overview]
Message-ID: <20091217142807.GA3544@quack.suse.cz> (raw)
In-Reply-To: <1261010125-14248-1-git-send-email-dmonakhov@openvz.org>
On Thu 17-12-09 03:35:25, Dmitry Monakhov wrote:
> Hi, Jan.
> I've prepared additional patch for quota reserved space management.
> Initially I've overlooked case when quota is not active, but in fact
> it seems reasonable to generalize reservation to that case as we do
> for i_block/i_bytes reservation.
> Possibly it should be folded in to c35fc5af93955aa22efc6568e5ae5b2cadbc086f
>
> CHANGE_LOG:
> quota: manage reserved space even when quota is not active
> Since we implemented generic reserved space management interface,
> then it is possible to account reserved space even quota when quota
> is not active (similar to i_blocks/i_bytes).
Yes, that's reasonable. I'll fold the patch into your
"quota: decouple fs reserved space from quota reservation" but please fix
things I write below.
> diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
> index dea86ab..de7e7de 100644
> --- a/fs/quota/dquot.c
> +++ b/fs/quota/dquot.c
> @@ -1351,15 +1351,14 @@ static qsize_t *inode_reserved_space(struct inode * inode)
> return inode->i_sb->dq_op->get_reserved_space(inode);
> }
>
> -static void inode_add_rsv_space(struct inode *inode, qsize_t number)
> +void inode_add_rsv_space(struct inode *inode, qsize_t number)
> {
> spin_lock(&inode->i_lock);
> *inode_reserved_space(inode) += number;
> spin_unlock(&inode->i_lock);
> }
>
> -
> -static void inode_claim_rsv_space(struct inode *inode, qsize_t number)
> +void inode_claim_rsv_space(struct inode *inode, qsize_t number)
> {
> spin_lock(&inode->i_lock);
> *inode_reserved_space(inode) -= number;
> @@ -1367,14 +1366,14 @@ static void inode_claim_rsv_space(struct inode *inode, qsize_t number)
> spin_unlock(&inode->i_lock);
> }
>
> -static void inode_sub_rsv_space(struct inode *inode, qsize_t number)
> +void inode_sub_rsv_space(struct inode *inode, qsize_t number)
> {
> spin_lock(&inode->i_lock);
> *inode_reserved_space(inode) -= number;
> spin_unlock(&inode->i_lock);
> }
The above three functions need to be exported (needed when ext4 is a
module).
> -static qsize_t inode_get_rsv_space(struct inode *inode)
> +qsize_t inode_get_rsv_space(struct inode *inode)
I think this does not need to be visible outside.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2009-12-17 14:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 0:35 [PATCH] quota: manage reserved space even when quota is not active Dmitry Monakhov
2009-12-17 14:28 ` Jan Kara [this message]
2009-12-17 15:25 ` [PATCH] quota: manage reserved space when quota is not active [v2] Dmitry Monakhov
2009-12-17 16:14 ` Jan Kara
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=20091217142807.GA3544@quack.suse.cz \
--to=jack@suse.cz \
--cc=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.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).