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


Groups > linux.kernel > #1563664 > unrolled thread

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

Started byGeliang Tang <geliangtang@gmail.com>
First post2017-01-20 15:40 +0100
Last post2017-01-23 02:30 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [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

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

FromGeliang Tang <geliangtang@gmail.com>
Date2017-01-20 15:40 +0100
Subject[PATCH 1/2] nilfs2: use i_blocksize()
Message-ID<t1Iwa-8q4-11@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1564054

Fromkbuild test robot <lkp@intel.com>
Date2017-01-21 06:40 +0100
Message-ID<t1Wz8-aS-1@gated-at.bofh.it>
In reply to#1563664

[Multipart message — attachments visible in raw view] — view raw

Hi Geliang,

[auto build test ERROR on v4.9-rc8]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Geliang-Tang/nilfs2-use-i_blocksize/20170121-114142
config: x86_64-randconfig-n0-01211226 (attached as .config)
compiler: gcc-4.8 (Debian 4.8.4-1) 4.8.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   fs/nilfs2/btree.c: In function 'nilfs_btree_node_size':
>> fs/nilfs2/btree.c:122:2: error: implicit declaration of function 'i_blocksize' [-Werror=implicit-function-declaration]
     return i_blocksize(btree->b_inode);
     ^
   cc1: some warnings being treated as errors
--
   fs/nilfs2/alloc.c: In function 'nilfs_palloc_groups_per_desc_block':
>> fs/nilfs2/alloc.c:37:2: error: implicit declaration of function 'i_blocksize' [-Werror=implicit-function-declaration]
     return i_blocksize(inode) /
     ^
   cc1: some warnings being treated as errors

vim +/i_blocksize +122 fs/nilfs2/btree.c

   116	{
   117		node->bn_nchildren = cpu_to_le16(nchildren);
   118	}
   119	
   120	static int nilfs_btree_node_size(const struct nilfs_bmap *btree)
   121	{
 > 122		return i_blocksize(btree->b_inode);
   123	}
   124	
   125	static int nilfs_btree_nchildren_per_block(const struct nilfs_bmap *btree)

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1564629

FromRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Date2017-01-23 02:30 +0100
Message-ID<t2BCh-8lT-3@gated-at.bofh.it>
In reply to#1563664
On Fri, 20 Jan 2017 22:34:57 +0800, Geliang Tang wrote:
> Since i_blocksize() helper has been defined in fs.h, use it instead
> of open-coding.
> 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>

i_blocksize() doesn't exist in the mainline kernel.

This needs another patch titled "fs: add i_blocksize()" which I found
in the latest -mm tree.

I will send this to the -mm tree along with this dependency.

Regards,
Ryusuke Konishi

> ---
>  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
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web