Commit 9900ba34 authored by Mingming Cao's avatar Mingming Cao Committed by 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: default avatarMingming Cao <cmm@us.ibm.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 740d9dcd
...@@ -410,38 +410,32 @@ static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr) ...@@ -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) static inline int vfs_dq_prealloc_block_nodirty(struct inode *inode, qsize_t nr)
{ {
return vfs_dq_prealloc_space_nodirty(inode, return vfs_dq_prealloc_space_nodirty(inode, nr << inode->i_blkbits);
nr << inode->i_sb->s_blocksize_bits);
} }
static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr) static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr)
{ {
return vfs_dq_prealloc_space(inode, return vfs_dq_prealloc_space(inode, nr << inode->i_blkbits);
nr << inode->i_sb->s_blocksize_bits);
} }
static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr) static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr)
{ {
return vfs_dq_alloc_space_nodirty(inode, return vfs_dq_alloc_space_nodirty(inode, nr << inode->i_blkbits);
nr << inode->i_sb->s_blocksize_bits);
} }
static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr) static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr)
{ {
return vfs_dq_alloc_space(inode, return vfs_dq_alloc_space(inode, nr << inode->i_blkbits);
nr << inode->i_sb->s_blocksize_bits);
} }
static inline int vfs_dq_reserve_block(struct inode *inode, qsize_t nr) static inline int vfs_dq_reserve_block(struct inode *inode, qsize_t nr)
{ {
return vfs_dq_reserve_space(inode, return vfs_dq_reserve_space(inode, nr << inode->i_blkbits);
nr << inode->i_blkbits);
} }
static inline int vfs_dq_claim_block(struct inode *inode, qsize_t nr) static inline int vfs_dq_claim_block(struct inode *inode, qsize_t nr)
{ {
return vfs_dq_claim_space(inode, return vfs_dq_claim_space(inode, nr << inode->i_blkbits);
nr << inode->i_blkbits);
} }
static inline static inline
...@@ -452,12 +446,12 @@ void vfs_dq_release_reservation_block(struct inode *inode, qsize_t nr) ...@@ -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) 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) 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment