diff mbox

[14/29] btrfs: remove unused parameter from submit_extent_page

Message ID ac49126de7d3f5dbdea72584f46befd549d084f4.1486977712.git.dsterba@suse.com (mailing list archive)
State Accepted
Headers show

Commit Message

David Sterba Feb. 13, 2017, 9:34 a.m. UTC
This used to hold number of maximum pages to allocate, but this is now
limited by BIO_MAX_PAGES.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/extent_io.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Liu Bo Feb. 14, 2017, 7:10 p.m. UTC | #1
On Mon, Feb 13, 2017 at 10:34:04AM +0100, David Sterba wrote:
> This used to hold number of maximum pages to allocate, but this is now
> limited by BIO_MAX_PAGES.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/extent_io.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 9df6ed30de00..00f3be5c4f2d 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -2759,7 +2759,6 @@ static int submit_extent_page(int op, int op_flags, struct extent_io_tree *tree,
>  			      size_t size, unsigned long offset,
>  			      struct block_device *bdev,
>  			      struct bio **bio_ret,
> -			      unsigned long max_pages,
>  			      bio_end_io_t end_io_func,
>  			      int mirror_num,
>  			      unsigned long prev_bio_flags,
> @@ -3063,7 +3062,7 @@ static int __do_readpage(struct extent_io_tree *tree,
>  		pnr -= page->index;
>  		ret = submit_extent_page(REQ_OP_READ, read_flags, tree, NULL,
>  					 page, sector, disk_io_size, pg_offset,
> -					 bdev, bio, pnr,
> +					 bdev, bio,
>  					 end_bio_extent_readpage, mirror_num,
>  					 *bio_flags,
>  					 this_bio_flag,

@pnr is only used here, it can be removed, too.

> @@ -3434,7 +3433,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
>  
>  		ret = submit_extent_page(REQ_OP_WRITE, write_flags, tree, wbc,
>  					 page, sector, iosize, pg_offset,
> -					 bdev, &epd->bio, max_nr,
> +					 bdev, &epd->bio,
>  					 end_bio_extent_writepage,
>  					 0, 0, 0, false);
>  		if (ret) {

So does @max_nr.

With removing those two,

Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> @@ -3751,7 +3750,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
>  		set_page_writeback(p);
>  		ret = submit_extent_page(REQ_OP_WRITE, write_flags, tree, wbc,
>  					 p, offset >> 9, PAGE_SIZE, 0, bdev,
> -					 &epd->bio, -1,
> +					 &epd->bio,
>  					 end_bio_extent_buffer_writepage,
>  					 0, epd->bio_flags, bio_flags, false);
>  		epd->bio_flags = bio_flags;
> -- 
> 2.10.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Sterba Feb. 15, 2017, 3:17 p.m. UTC | #2
On Tue, Feb 14, 2017 at 11:10:32AM -0800, Liu Bo wrote:
> @pnr is only used here, it can be removed, too.
> 
> So does @max_nr.

Right, thanks. Patch udpated. I've tried if this can be caught by
'-Wunused-but-set-variable', strangely only max_nr is reported:

fs/btrfs/extent_io.c: In function ‘__extent_writepage_io’:
fs/btrfs/extent_io.c:3368:17: warning: variable ‘max_nr’ set but not used [-Wunused-but-set-variable]
   unsigned long max_nr;
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 9df6ed30de00..00f3be5c4f2d 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2759,7 +2759,6 @@  static int submit_extent_page(int op, int op_flags, struct extent_io_tree *tree,
 			      size_t size, unsigned long offset,
 			      struct block_device *bdev,
 			      struct bio **bio_ret,
-			      unsigned long max_pages,
 			      bio_end_io_t end_io_func,
 			      int mirror_num,
 			      unsigned long prev_bio_flags,
@@ -3063,7 +3062,7 @@  static int __do_readpage(struct extent_io_tree *tree,
 		pnr -= page->index;
 		ret = submit_extent_page(REQ_OP_READ, read_flags, tree, NULL,
 					 page, sector, disk_io_size, pg_offset,
-					 bdev, bio, pnr,
+					 bdev, bio,
 					 end_bio_extent_readpage, mirror_num,
 					 *bio_flags,
 					 this_bio_flag,
@@ -3434,7 +3433,7 @@  static noinline_for_stack int __extent_writepage_io(struct inode *inode,
 
 		ret = submit_extent_page(REQ_OP_WRITE, write_flags, tree, wbc,
 					 page, sector, iosize, pg_offset,
-					 bdev, &epd->bio, max_nr,
+					 bdev, &epd->bio,
 					 end_bio_extent_writepage,
 					 0, 0, 0, false);
 		if (ret) {
@@ -3751,7 +3750,7 @@  static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
 		set_page_writeback(p);
 		ret = submit_extent_page(REQ_OP_WRITE, write_flags, tree, wbc,
 					 p, offset >> 9, PAGE_SIZE, 0, bdev,
-					 &epd->bio, -1,
+					 &epd->bio,
 					 end_bio_extent_buffer_writepage,
 					 0, epd->bio_flags, bio_flags, false);
 		epd->bio_flags = bio_flags;