aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quotaops.h
diff options
context:
space:
mode:
authorMingming Cao <cmm@us.ibm.com>2009-01-14 10:18:57 -0500
committerJan Kara <jack@suse.cz>2009-03-25 21:18:34 -0400
commit9900ba3487f9ba392db30e12d210f768a90abb13 (patch)
treed74890b42f6ffae21908d8dc9bed34a40f066123 /include/linux/quotaops.h
parent740d9dcd949a986c88886a591054a0cdb89ef669 (diff)
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>
Diffstat (limited to 'include/linux/quotaops.h')
-rw-r--r--include/linux/quotaops.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 7369d04e0a86..69b502e5eba0 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -410,38 +410,32 @@ static inline void vfs_dq_free_space(struct inode *inode, qsize_t nr)
410 410
411static inline int vfs_dq_prealloc_block_nodirty(struct inode *inode, qsize_t nr) 411static inline int vfs_dq_prealloc_block_nodirty(struct inode *inode, qsize_t nr)
412{ 412{
413 return vfs_dq_prealloc_space_nodirty(inode, 413 return vfs_dq_prealloc_space_nodirty(inode, nr << inode->i_blkbits);
414 nr << inode->i_sb->s_blocksize_bits);
415} 414}
416 415
417static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr) 416static inline int vfs_dq_prealloc_block(struct inode *inode, qsize_t nr)
418{ 417{
419 return vfs_dq_prealloc_space(inode, 418 return vfs_dq_prealloc_space(inode, nr << inode->i_blkbits);
420 nr << inode->i_sb->s_blocksize_bits);
421} 419}
422 420
423static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr) 421static inline int vfs_dq_alloc_block_nodirty(struct inode *inode, qsize_t nr)
424{ 422{
425 return vfs_dq_alloc_space_nodirty(inode, 423 return vfs_dq_alloc_space_nodirty(inode, nr << inode->i_blkbits);
426 nr << inode->i_sb->s_blocksize_bits);
427} 424}
428 425
429static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr) 426static inline int vfs_dq_alloc_block(struct inode *inode, qsize_t nr)
430{ 427{
431 return vfs_dq_alloc_space(inode, 428 return vfs_dq_alloc_space(inode, nr << inode->i_blkbits);
432 nr << inode->i_sb->s_blocksize_bits);
433} 429}
434 430
435static inline int vfs_dq_reserve_block(struct inode *inode, qsize_t nr) 431static inline int vfs_dq_reserve_block(struct inode *inode, qsize_t nr)
436{ 432{
437 return vfs_dq_reserve_space(inode, 433 return vfs_dq_reserve_space(inode, nr << inode->i_blkbits);
438 nr << inode->i_blkbits);
439} 434}
440 435
441static inline int vfs_dq_claim_block(struct inode *inode, qsize_t nr) 436static inline int vfs_dq_claim_block(struct inode *inode, qsize_t nr)
442{ 437{
443 return vfs_dq_claim_space(inode, 438 return vfs_dq_claim_space(inode, nr << inode->i_blkbits);
444 nr << inode->i_blkbits);
445} 439}
446 440
447static inline 441static inline
@@ -452,12 +446,12 @@ void vfs_dq_release_reservation_block(struct inode *inode, qsize_t nr)
452 446
453static inline void vfs_dq_free_block_nodirty(struct inode *inode, qsize_t nr) 447static inline void vfs_dq_free_block_nodirty(struct inode *inode, qsize_t nr)
454{ 448{
455 vfs_dq_free_space_nodirty(inode, nr << inode->i_sb->s_blocksize_bits); 449 vfs_dq_free_space_nodirty(inode, nr << inode->i_blkbits);
456} 450}
457 451
458static inline void vfs_dq_free_block(struct inode *inode, qsize_t nr) 452static inline void vfs_dq_free_block(struct inode *inode, qsize_t nr)
459{ 453{
460 vfs_dq_free_space(inode, nr << inode->i_sb->s_blocksize_bits); 454 vfs_dq_free_space(inode, nr << inode->i_blkbits);
461} 455}
462 456
463/* 457/*