nilfs2: use i_blocksize()
authorGeliang Tang <geliangtang@gmail.com>
Mon, 27 Feb 2017 22:28:38 +0000 (14:28 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 28 Feb 2017 02:43:46 +0000 (18:43 -0800)
Since i_blocksize() helper has been defined in fs.h, use it instead of
open-coding.

Link: http://lkml.kernel.org/r/1485184655-3895-3-git-send-email-konishi.ryusuke@lab.ntt.co.jp
Signed-off-by: Geliang Tang <geliangtang@gmail.com>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nilfs2/alloc.c
fs/nilfs2/btree.c

index 2c90e285d7c6725089641bc2a3fcb336b35d054b..03b8ba933eb2a3dcc781eaf9e57594da5a40f48b 100644 (file)
@@ -34,7 +34,7 @@
 static inline unsigned long
 nilfs_palloc_groups_per_desc_block(const struct inode *inode)
 {
-       return (1UL << inode->i_blkbits) /
+       return i_blocksize(inode) /
                sizeof(struct nilfs_palloc_group_desc);
 }
 
index 9c7ea176ab0f8816a5662ebcde53c8c529e11475..06ffa135dfa651590a7a0dc25c76d0cb632bfe94 100644 (file)
@@ -119,7 +119,7 @@ nilfs_btree_node_set_nchildren(struct nilfs_btree_node *node, int nchildren)
 
 static int nilfs_btree_node_size(const struct nilfs_bmap *btree)
 {
-       return 1 << btree->b_inode->i_blkbits;
+       return i_blocksize(btree->b_inode);
 }
 
 static int nilfs_btree_nchildren_per_block(const struct nilfs_bmap *btree)