From: Jan Kara <jack@suse.cz>
To: Mingming Cao <cmm@us.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, tytso <tytso@mit.edu>,
linux-ext4 <linux-ext4@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH V2 1/2] QUOTA cleanup: Use inode->i_blkbits to get block bits
Date: Mon, 15 Dec 2008 13:42:42 +0100 [thread overview]
Message-ID: <20081215124242.GA15464@duck.suse.cz> (raw)
In-Reply-To: <1229114886.7646.29.camel@mingming-laptop>
On Fri 12-12-08 12:48:06, Mingming Cao wrote:
> quota: Use inode->i_blkbits to get block bits
>
> From: Mingming Cao <cmm@us.ibm.com>
>
> Andrew has suggested to use inode->i_blkbits to get the block bits info,
> rather than use super block's blockbits. That should be faster and emit
> less code.
>
> Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Acked-by: Jan Kara <jack@suse.cz>
Honza
> ---
> include/linux/quotaops.h | 22 ++++++++--------------
> 1 file changed, 8 insertions(+), 14 deletions(-)
>
> Index: linux-2.6.28-rc2/include/linux/quotaops.h
> ===================================================================
> --- linux-2.6.28-rc2.orig/include/linux/quotaops.h 2008-12-12 12:21:49.000000000 -0800
> +++ linux-2.6.28-rc2/include/linux/quotaops.h 2008-12-12 12:32:21.000000000 -0800
> @@ -398,39 +398,33 @@ static inline void vfs_dq_free_space(str
>
> static inline int vfs_dq_prealloc_block_nodirty(struct inode *inode, qsize_t nr)
> {
> - return vfs_dq_prealloc_space_nodirty(inode,
> - nr << inode->i_sb->s_blocksize_bits);
> + return vfs_dq_prealloc_space_nodirty(inode, nr << inode->i_blkbits);
> }
>
> static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr)
> {
> - return vfs_dq_prealloc_space(inode,
> - nr << inode->i_sb->s_blocksize_bits);
> + return vfs_dq_prealloc_space(inode, nr << inode->i_blkbits);
> }
>
> static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr)
> {
> - return vfs_dq_alloc_space_nodirty(inode,
> - nr << inode->i_sb->s_blocksize_bits);
> + return vfs_dq_alloc_space_nodirty(inode, nr << inode->i_blkbits);
> }
>
>
> static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr)
> {
> - return vfs_dq_alloc_space(inode,
> - nr << inode->i_sb->s_blocksize_bits);
> + return vfs_dq_alloc_space(inode, nr << inode->i_blkbits);
> }
>
> static inline int vfs_dq_reserve_block(struct inode *inode, qsize_t nr)
> {
> - return vfs_dq_reserve_space(inode,
> - nr << inode->i_blkbits);
> + return vfs_dq_reserve_space(inode, nr << inode->i_blkbits);
> }
>
> static inline int vfs_dq_claim_block(struct inode *inode, qsize_t nr)
> {
> - return vfs_dq_claim_space(inode,
> - nr << inode->i_blkbits);
> + return vfs_dq_claim_space(inode, nr << inode->i_blkbits);
> }
>
> static inline
> @@ -441,12 +435,12 @@ void vfs_dq_release_reservation_block(st
>
> static inline void vfs_dq_free_block_nodirty(struct inode *inode, qsize_t nr)
> {
> - vfs_dq_free_space_nodirty(inode, nr << inode->i_sb->s_blocksize_bits);
> + vfs_dq_free_space_nodirty(inode, nr << inode->i_blkbits);
> }
>
> static inline void vfs_dq_free_block(struct inode *inode, qsize_t nr)
> {
> - vfs_dq_free_space(inode, nr << inode->i_sb->s_blocksize_bits);
> + vfs_dq_free_space(inode, nr << inode->i_blkbits);
> }
>
> /*
>
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
prev parent reply other threads:[~2008-12-15 12:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-12 20:48 [PATCH V2 1/2] QUOTA cleanup: Use inode->i_blkbits to get block bits Mingming Cao
2008-12-15 12:42 ` Jan Kara [this message]
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=20081215124242.GA15464@duck.suse.cz \
--to=jack@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=cmm@us.ibm.com \
--cc=hch@lst.de \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@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;
as well as URLs for NNTP newsgroup(s).