Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1563664

[PATCH 1/2] nilfs2: use i_blocksize()

From Geliang Tang <geliangtang@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/2] nilfs2: use i_blocksize()
Date 2017-01-20 15:40 +0100
Message-ID <t1Iwa-8q4-11@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Since i_blocksize() helper has been defined in fs.h, use it instead
of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 fs/nilfs2/alloc.c | 2 +-
 fs/nilfs2/btree.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/nilfs2/alloc.c b/fs/nilfs2/alloc.c
index 2c90e28..03b8ba9 100644
--- a/fs/nilfs2/alloc.c
+++ b/fs/nilfs2/alloc.c
@@ -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);
 }
 
diff --git a/fs/nilfs2/btree.c b/fs/nilfs2/btree.c
index 2e315f9..d75238a 100644
--- a/fs/nilfs2/btree.c
+++ b/fs/nilfs2/btree.c
@@ -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)
-- 
2.9.3

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] nilfs2: use i_blocksize() Geliang Tang <geliangtang@gmail.com> - 2017-01-20 15:40 +0100
  Re: [PATCH 1/2] nilfs2: use i_blocksize() kbuild test robot <lkp@intel.com> - 2017-01-21 06:40 +0100
  Re: [PATCH 1/2] nilfs2: use i_blocksize() Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2017-01-23 02:30 +0100

csiph-web