linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: use i_blocksize()
@ 2017-01-20 14:29 Geliang Tang
  2017-01-20 14:29 ` [PATCH] fs/buffer: " Geliang Tang
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Geliang Tang @ 2017-01-20 14:29 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: Geliang Tang, linux-ext4, linux-kernel

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/ext4/move_extent.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 578f8c3..60222ed 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -382,7 +382,7 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
 	/* Perform all necessary steps similar write_begin()/write_end()
 	 * but keeping in mind that i_size will not change */
 	if (!page_has_buffers(pagep[0]))
-		create_empty_buffers(pagep[0], 1 << orig_inode->i_blkbits, 0);
+		create_empty_buffers(pagep[0], i_blocksize(orig_inode), 0);
 	bh = page_buffers(pagep[0]);
 	for (i = 0; i < data_offset_in_page; i++)
 		bh = bh->b_this_page;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] fs/buffer: use i_blocksize()
  2017-01-20 14:29 [PATCH] ext4: use i_blocksize() Geliang Tang
@ 2017-01-20 14:29 ` Geliang Tang
  2017-01-20 14:29 ` [PATCH] isofs: " Geliang Tang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Geliang Tang @ 2017-01-20 14:29 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Geliang Tang, linux-fsdevel, linux-kernel

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/buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 28484b3..53612c4 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -243,7 +243,7 @@ __find_get_block_slow(struct block_device *bdev, sector_t block)
 		printk("b_state=0x%08lx, b_size=%zu\n",
 			bh->b_state, bh->b_size);
 		printk("device %pg blocksize: %d\n", bdev,
-			1 << bd_inode->i_blkbits);
+			i_blocksize(bd_inode));
 	}
 out_unlock:
 	spin_unlock(&bd_mapping->private_lock);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] isofs: use i_blocksize()
  2017-01-20 14:29 [PATCH] ext4: use i_blocksize() Geliang Tang
  2017-01-20 14:29 ` [PATCH] fs/buffer: " Geliang Tang
@ 2017-01-20 14:29 ` Geliang Tang
  2017-01-20 14:29 ` [PATCH] md/bitmap: " Geliang Tang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Geliang Tang @ 2017-01-20 14:29 UTC (permalink / raw)
  To: Al Viro, Mike Rapoport; +Cc: Geliang Tang, linux-kernel

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/isofs/rock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c
index 0ec1373..038728b 100644
--- a/fs/isofs/rock.c
+++ b/fs/isofs/rock.c
@@ -84,7 +84,7 @@ static void init_rock_state(struct rock_state *rs, struct inode *inode)
 static int rock_continue(struct rock_state *rs)
 {
 	int ret = 1;
-	int blocksize = 1 << rs->inode->i_blkbits;
+	int blocksize = i_blocksize(rs->inode);
 	const int min_de_size = offsetof(struct rock_ridge, u);
 
 	kfree(rs->buffer);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] md/bitmap: use i_blocksize()
  2017-01-20 14:29 [PATCH] ext4: use i_blocksize() Geliang Tang
  2017-01-20 14:29 ` [PATCH] fs/buffer: " Geliang Tang
  2017-01-20 14:29 ` [PATCH] isofs: " Geliang Tang
@ 2017-01-20 14:29 ` Geliang Tang
  2017-01-20 15:00   ` Coly Li
  2017-01-21 18:13   ` Shaohua Li
  2017-01-20 14:29 ` [PATCH] staging: lustre: " Geliang Tang
  2017-01-20 14:29 ` [PATCH] truncate: " Geliang Tang
  4 siblings, 2 replies; 12+ messages in thread
From: Geliang Tang @ 2017-01-20 14:29 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Geliang Tang, linux-raid, linux-kernel

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

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/md/bitmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 9fb2cca..30b1b89 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -367,7 +367,7 @@ static int read_page(struct file *file, unsigned long index,
 	pr_debug("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE,
 		 (unsigned long long)index << PAGE_SHIFT);
 
-	bh = alloc_page_buffers(page, 1<<inode->i_blkbits, 0);
+	bh = alloc_page_buffers(page, i_blocksize(inode), 0);
 	if (!bh) {
 		ret = -ENOMEM;
 		goto out;
@@ -385,10 +385,10 @@ static int read_page(struct file *file, unsigned long index,
 				goto out;
 			}
 			bh->b_bdev = inode->i_sb->s_bdev;
-			if (count < (1<<inode->i_blkbits))
+			if (count < i_blocksize(inode))
 				count = 0;
 			else
-				count -= (1<<inode->i_blkbits);
+				count -= i_blocksize(inode);
 
 			bh->b_end_io = end_bitmap_write;
 			bh->b_private = bitmap;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] staging: lustre: use i_blocksize()
  2017-01-20 14:29 [PATCH] ext4: use i_blocksize() Geliang Tang
                   ` (2 preceding siblings ...)
  2017-01-20 14:29 ` [PATCH] md/bitmap: " Geliang Tang
@ 2017-01-20 14:29 ` Geliang Tang
  2017-01-20 23:34   ` James Simmons
  2017-01-20 14:29 ` [PATCH] truncate: " Geliang Tang
  4 siblings, 1 reply; 12+ messages in thread
From: Geliang Tang @ 2017-01-20 14:29 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: Geliang Tang, lustre-devel, devel, linux-kernel

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

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/staging/lustre/lustre/llite/file.c    | 2 +-
 drivers/staging/lustre/lustre/obdclass/obdo.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index d93f06a..3ee546f 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2967,7 +2967,7 @@ int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat)
 	stat->atime = inode->i_atime;
 	stat->mtime = inode->i_mtime;
 	stat->ctime = inode->i_ctime;
-	stat->blksize = 1 << inode->i_blkbits;
+	stat->blksize = i_blocksize(inode);
 
 	stat->nlink = inode->i_nlink;
 	stat->size = i_size_read(inode);
diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c
index b1dfa16..b9be7db 100644
--- a/drivers/staging/lustre/lustre/obdclass/obdo.c
+++ b/drivers/staging/lustre/lustre/obdclass/obdo.c
@@ -84,7 +84,7 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid)
 		newvalid |= OBD_MD_FLBLOCKS;
 	}
 	if (valid & OBD_MD_FLBLKSZ) {   /* optimal block size */
-		dst->o_blksize = 1 << src->i_blkbits;
+		dst->o_blksize = i_blocksize(src);
 		newvalid |= OBD_MD_FLBLKSZ;
 	}
 	if (valid & OBD_MD_FLTYPE) {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH] truncate: use i_blocksize()
  2017-01-20 14:29 [PATCH] ext4: use i_blocksize() Geliang Tang
                   ` (3 preceding siblings ...)
  2017-01-20 14:29 ` [PATCH] staging: lustre: " Geliang Tang
@ 2017-01-20 14:29 ` Geliang Tang
  2017-01-20 17:39   ` Ross Zwisler
  4 siblings, 1 reply; 12+ messages in thread
From: Geliang Tang @ 2017-01-20 14:29 UTC (permalink / raw)
  To: Andrew Morton, Johannes Weiner, Ross Zwisler, Jan Kara
  Cc: Geliang Tang, linux-mm, linux-kernel

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

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 mm/truncate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/truncate.c b/mm/truncate.c
index dd7b24e..4c49a9b 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -785,7 +785,7 @@ EXPORT_SYMBOL(truncate_setsize);
  */
 void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to)
 {
-	int bsize = 1 << inode->i_blkbits;
+	int bsize = i_blocksize(inode);
 	loff_t rounded_from;
 	struct page *page;
 	pgoff_t index;
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] md/bitmap: use i_blocksize()
  2017-01-20 14:29 ` [PATCH] md/bitmap: " Geliang Tang
@ 2017-01-20 15:00   ` Coly Li
  2017-01-21 18:13   ` Shaohua Li
  1 sibling, 0 replies; 12+ messages in thread
From: Coly Li @ 2017-01-20 15:00 UTC (permalink / raw)
  To: Geliang Tang, Shaohua Li; +Cc: linux-raid, linux-kernel

On 2017/1/20 下午10:29, 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>
> ---
>  drivers/md/bitmap.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
> index 9fb2cca..30b1b89 100644
> --- a/drivers/md/bitmap.c
> +++ b/drivers/md/bitmap.c
> @@ -367,7 +367,7 @@ static int read_page(struct file *file, unsigned long index,
>  	pr_debug("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE,
>  		 (unsigned long long)index << PAGE_SHIFT);
>  
> -	bh = alloc_page_buffers(page, 1<<inode->i_blkbits, 0);
> +	bh = alloc_page_buffers(page, i_blocksize(inode), 0);
>  	if (!bh) {
>  		ret = -ENOMEM;
>  		goto out;
> @@ -385,10 +385,10 @@ static int read_page(struct file *file, unsigned long index,
>  				goto out;
>  			}
>  			bh->b_bdev = inode->i_sb->s_bdev;
> -			if (count < (1<<inode->i_blkbits))
> +			if (count < i_blocksize(inode))
>  				count = 0;
>  			else
> -				count -= (1<<inode->i_blkbits);
> +				count -= i_blocksize(inode);
>  
>  			bh->b_end_io = end_bitmap_write;
>  			bh->b_private = bitmap;
> 

Acked-by: Coly Li <colyli@suse.de>

I agree with this. Thanks.

Coly

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] truncate: use i_blocksize()
  2017-01-20 14:29 ` [PATCH] truncate: " Geliang Tang
@ 2017-01-20 17:39   ` Ross Zwisler
  0 siblings, 0 replies; 12+ messages in thread
From: Ross Zwisler @ 2017-01-20 17:39 UTC (permalink / raw)
  To: Geliang Tang
  Cc: Andrew Morton, Johannes Weiner, Ross Zwisler, Jan Kara, linux-mm,
	linux-kernel

On Fri, Jan 20, 2017 at 10:29:54PM +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>

Sure this seems correct.
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: lustre: use i_blocksize()
  2017-01-20 14:29 ` [PATCH] staging: lustre: " Geliang Tang
@ 2017-01-20 23:34   ` James Simmons
  0 siblings, 0 replies; 12+ messages in thread
From: James Simmons @ 2017-01-20 23:34 UTC (permalink / raw)
  To: Geliang Tang
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel


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

The i_blocksize() work hasn't landed to the staging-next tree
so this can't land just yet.
 
> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
>  drivers/staging/lustre/lustre/llite/file.c    | 2 +-
>  drivers/staging/lustre/lustre/obdclass/obdo.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
> index d93f06a..3ee546f 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -2967,7 +2967,7 @@ int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat)
>  	stat->atime = inode->i_atime;
>  	stat->mtime = inode->i_mtime;
>  	stat->ctime = inode->i_ctime;
> -	stat->blksize = 1 << inode->i_blkbits;
> +	stat->blksize = i_blocksize(inode);
>  
>  	stat->nlink = inode->i_nlink;
>  	stat->size = i_size_read(inode);
> diff --git a/drivers/staging/lustre/lustre/obdclass/obdo.c b/drivers/staging/lustre/lustre/obdclass/obdo.c
> index b1dfa16..b9be7db 100644
> --- a/drivers/staging/lustre/lustre/obdclass/obdo.c
> +++ b/drivers/staging/lustre/lustre/obdclass/obdo.c
> @@ -84,7 +84,7 @@ void obdo_from_inode(struct obdo *dst, struct inode *src, u32 valid)
>  		newvalid |= OBD_MD_FLBLOCKS;
>  	}
>  	if (valid & OBD_MD_FLBLKSZ) {   /* optimal block size */
> -		dst->o_blksize = 1 << src->i_blkbits;
> +		dst->o_blksize = i_blocksize(src);
>  		newvalid |= OBD_MD_FLBLKSZ;
>  	}
>  	if (valid & OBD_MD_FLTYPE) {
> -- 
> 2.9.3
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] md/bitmap: use i_blocksize()
  2017-01-20 14:29 ` [PATCH] md/bitmap: " Geliang Tang
  2017-01-20 15:00   ` Coly Li
@ 2017-01-21 18:13   ` Shaohua Li
  2017-01-22  1:50     ` Geliang Tang
  1 sibling, 1 reply; 12+ messages in thread
From: Shaohua Li @ 2017-01-21 18:13 UTC (permalink / raw)
  To: Geliang Tang; +Cc: linux-raid, linux-kernel

On Fri, Jan 20, 2017 at 10:29:52PM +0800, Geliang Tang wrote:
> Since i_blocksize() helper has been defined in fs.h, use it instead
> of open-coding.

which tree is this patch applied to? I can't find it in Linus's tree

> Signed-off-by: Geliang Tang <geliangtang@gmail.com>
> ---
>  drivers/md/bitmap.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
> index 9fb2cca..30b1b89 100644
> --- a/drivers/md/bitmap.c
> +++ b/drivers/md/bitmap.c
> @@ -367,7 +367,7 @@ static int read_page(struct file *file, unsigned long index,
>  	pr_debug("read bitmap file (%dB @ %llu)\n", (int)PAGE_SIZE,
>  		 (unsigned long long)index << PAGE_SHIFT);
>  
> -	bh = alloc_page_buffers(page, 1<<inode->i_blkbits, 0);
> +	bh = alloc_page_buffers(page, i_blocksize(inode), 0);
>  	if (!bh) {
>  		ret = -ENOMEM;
>  		goto out;
> @@ -385,10 +385,10 @@ static int read_page(struct file *file, unsigned long index,
>  				goto out;
>  			}
>  			bh->b_bdev = inode->i_sb->s_bdev;
> -			if (count < (1<<inode->i_blkbits))
> +			if (count < i_blocksize(inode))
>  				count = 0;
>  			else
> -				count -= (1<<inode->i_blkbits);
> +				count -= i_blocksize(inode);
>  
>  			bh->b_end_io = end_bitmap_write;
>  			bh->b_private = bitmap;
> -- 
> 2.9.3
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] md/bitmap: use i_blocksize()
  2017-01-21 18:13   ` Shaohua Li
@ 2017-01-22  1:50     ` Geliang Tang
  2017-05-02 14:33       ` Geliang Tang
  0 siblings, 1 reply; 12+ messages in thread
From: Geliang Tang @ 2017-01-22  1:50 UTC (permalink / raw)
  To: Shaohua Li; +Cc: Coly Li, linux-raid, linux-kernel

On Sat, Jan 21, 2017 at 10:13:07AM -0800, Shaohua Li wrote:
> On Fri, Jan 20, 2017 at 10:29:52PM +0800, Geliang Tang wrote:
> > Since i_blocksize() helper has been defined in fs.h, use it instead
> > of open-coding.
> 
> which tree is this patch applied to? I can't find it in Linus's tree
> 

This patch is against the last linux-next tree, next-20170120. It
depends on the patch '2651ed7 fs: add i_blocksize()' which isn't merged
into Linus's tree yet.

-Geliang

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] md/bitmap: use i_blocksize()
  2017-01-22  1:50     ` Geliang Tang
@ 2017-05-02 14:33       ` Geliang Tang
  0 siblings, 0 replies; 12+ messages in thread
From: Geliang Tang @ 2017-05-02 14:33 UTC (permalink / raw)
  To: Shaohua Li; +Cc: linux-raid, linux-kernel, Coly Li

On Sun, Jan 22, 2017 at 09:50:30AM +0800, Geliang Tang wrote:
> On Sat, Jan 21, 2017 at 10:13:07AM -0800, Shaohua Li wrote:
> > On Fri, Jan 20, 2017 at 10:29:52PM +0800, Geliang Tang wrote:
> > > Since i_blocksize() helper has been defined in fs.h, use it instead
> > > of open-coding.
> > 
> > which tree is this patch applied to? I can't find it in Linus's tree
> > 
> 
> This patch is against the last linux-next tree, next-20170120. It
> depends on the patch '2651ed7 fs: add i_blocksize()' which isn't merged
> into Linus's tree yet.
> 
> -Geliang

Hi Shaohua,

The i_blocksize() helper has been merged into Linus's tree already, and
this patch is still valid. Could you please reconsider it if this patch
can be applied?

Thanks.

-Geliang

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-05-02 14:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 14:29 [PATCH] ext4: use i_blocksize() Geliang Tang
2017-01-20 14:29 ` [PATCH] fs/buffer: " Geliang Tang
2017-01-20 14:29 ` [PATCH] isofs: " Geliang Tang
2017-01-20 14:29 ` [PATCH] md/bitmap: " Geliang Tang
2017-01-20 15:00   ` Coly Li
2017-01-21 18:13   ` Shaohua Li
2017-01-22  1:50     ` Geliang Tang
2017-05-02 14:33       ` Geliang Tang
2017-01-20 14:29 ` [PATCH] staging: lustre: " Geliang Tang
2017-01-20 23:34   ` James Simmons
2017-01-20 14:29 ` [PATCH] truncate: " Geliang Tang
2017-01-20 17:39   ` Ross Zwisler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).