提交 9900ba34 编写于 作者: M Mingming Cao 提交者: Jan Kara

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: NMingming Cao <cmm@us.ibm.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 740d9dcd
......@@ -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);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册