quota: Use inode->i_blkbits to get block bits

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>
Signed-off-by: Jan Kara <jack@suse.cz>
This commit is contained in:
Mingming Cao 2009-01-14 16:18:57 +01:00 committed by Jan Kara
parent 740d9dcd94
commit 9900ba3487

View file

@ -410,38 +410,32 @@ static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr)
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
@ -452,12 +446,12 @@ void vfs_dq_release_reservation_block(struct inode *inode, qsize_t nr)
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);
}
/*