diff mbox series

[3/3] btrfs: Remove unused extent_state argument from btrfs_writepage_endio_finish_ordered

Message ID 20181108081808.16920-4-nborisov@suse.com (mailing list archive)
State New, archived
Headers show
Series Cleanups following optional extent_io_ops callbacks removal | expand

Commit Message

Nikolay Borisov Nov. 8, 2018, 8:18 a.m. UTC
This parameter was never used, yet was part of the interface of the
function ever since its introduction as extent_io_ops::writepage_end_io_hook
in e6dcd2dc9c48 ("Btrfs: New data=ordered implementation"). Now that
NULL is passed everywhere as a value for this parameter let's remove it
for good. No functional changes.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/compression.c |  6 ++++--
 fs/btrfs/ctree.h       |  4 ++--
 fs/btrfs/extent_io.c   | 12 +++++-------
 fs/btrfs/inode.c       |  7 +++----
 4 files changed, 14 insertions(+), 15 deletions(-)

Comments

David Sterba Nov. 12, 2018, 7:02 p.m. UTC | #1
On Thu, Nov 08, 2018 at 10:18:08AM +0200, Nikolay Borisov wrote:
> This parameter was never used, yet was part of the interface of the
> function ever since its introduction as extent_io_ops::writepage_end_io_hook
> in e6dcd2dc9c48 ("Btrfs: New data=ordered implementation"). Now that
> NULL is passed everywhere as a value for this parameter let's remove it
> for good. No functional changes.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  fs/btrfs/compression.c |  6 ++++--
>  fs/btrfs/ctree.h       |  4 ++--
>  fs/btrfs/extent_io.c   | 12 +++++-------
>  fs/btrfs/inode.c       |  7 +++----
>  4 files changed, 14 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index bde8d0487bbb..717d9300dd18 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -251,8 +251,10 @@ static void end_compressed_bio_write(struct bio *bio)
>  	tree = &BTRFS_I(inode)->io_tree;
>  	cb->compressed_pages[0]->mapping = cb->inode->i_mapping;
>  	btrfs_writepage_endio_finish_ordered(cb->compressed_pages[0],
> -			cb->start, cb->start + cb->len - 1, NULL,
> -			bio->bi_status ? BLK_STS_OK : BLK_STS_NOTSUPP);
> +					     cb->start,
> +					     cb->start + cb->len - 1,
> +					     bio->bi_status ?
> +					     BLK_STS_OK : BLK_STS_NOTSUPP);

Please not how the ternary operator had to be split to two lines just to
satisfy the 'arguments align under opening brace' formatting, that I
don't like but tolerate in many cases unless it looks too ugly or breaks
expression unnecessarily.
diff mbox series

Patch

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index bde8d0487bbb..717d9300dd18 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -251,8 +251,10 @@  static void end_compressed_bio_write(struct bio *bio)
 	tree = &BTRFS_I(inode)->io_tree;
 	cb->compressed_pages[0]->mapping = cb->inode->i_mapping;
 	btrfs_writepage_endio_finish_ordered(cb->compressed_pages[0],
-			cb->start, cb->start + cb->len - 1, NULL,
-			bio->bi_status ? BLK_STS_OK : BLK_STS_NOTSUPP);
+					     cb->start,
+					     cb->start + cb->len - 1,
+					     bio->bi_status ?
+					     BLK_STS_OK : BLK_STS_NOTSUPP);
 	cb->compressed_pages[0]->mapping = NULL;
 
 	end_compressed_writeback(inode, cb);
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 8b41ec42f405..c48fcaf4004d 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3179,7 +3179,7 @@  int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
 			     struct btrfs_root *new_root,
 			     struct btrfs_root *parent_root,
 			     u64 new_dirid);
-void btrfs_set_delalloc_extent(struct inode *inode, struct extent_state *state,
+ void btrfs_set_delalloc_extent(struct inode *inode, struct extent_state *state,
 			       unsigned *bits);
 void btrfs_clear_delalloc_extent(struct inode *inode,
 				 struct extent_state *state, unsigned *bits);
@@ -3231,7 +3231,7 @@  int btrfs_run_delalloc_range(void *private_data, struct page *locked_page,
 		struct writeback_control *wbc);
 int btrfs_writepage_cow_fixup(struct page *page, u64 start, u64 end);
 void btrfs_writepage_endio_finish_ordered(struct page *page, u64 start,
-		u64 end, struct extent_state *state, int uptodate);
+					  u64 end, int uptodate);
 extern const struct dentry_operations btrfs_dentry_operations;
 
 /* ioctl.c */
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index cca9d3cbe74a..f3bf7f9c13c0 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2408,7 +2408,7 @@  void end_extent_writepage(struct page *page, int err, u64 start, u64 end)
 
 	tree = &BTRFS_I(page->mapping->host)->io_tree;
 
-	btrfs_writepage_endio_finish_ordered(page, start, end, NULL, uptodate);
+	btrfs_writepage_endio_finish_ordered(page, start, end, uptodate);
 
 	if (!uptodate) {
 		ClearPageUptodate(page);
@@ -3329,8 +3329,7 @@  static noinline_for_stack int __extent_writepage_io(struct inode *inode,
 
 	end = page_end;
 	if (i_size <= start) {
-		btrfs_writepage_endio_finish_ordered(page, start, page_end,
-						     NULL, 1);
+		btrfs_writepage_endio_finish_ordered(page, start, page_end, 1);
 		goto done;
 	}
 
@@ -3342,7 +3341,7 @@  static noinline_for_stack int __extent_writepage_io(struct inode *inode,
 
 		if (cur >= i_size) {
 			btrfs_writepage_endio_finish_ordered(page, cur,
-							     page_end, NULL, 1);
+							     page_end, 1);
 			break;
 		}
 		em = btrfs_get_extent(BTRFS_I(inode), page, pg_offset, cur,
@@ -3379,7 +3378,7 @@  static noinline_for_stack int __extent_writepage_io(struct inode *inode,
 			if (!compressed)
 				btrfs_writepage_endio_finish_ordered(page, cur,
 							    cur + iosize - 1,
-							    NULL, 1);
+							    1);
 			else if (compressed) {
 				/* we don't want to end_page_writeback on
 				 * a compressed extent.  this happens
@@ -4066,8 +4065,7 @@  int extent_write_locked_range(struct inode *inode, u64 start, u64 end,
 			ret = __extent_writepage(page, &wbc_writepages, &epd);
 		else {
 			btrfs_writepage_endio_finish_ordered(page, start,
-						    start + PAGE_SIZE - 1,
-						    NULL, 1);
+						    start + PAGE_SIZE - 1, 1);
 			unlock_page(page);
 		}
 		put_page(page);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a097f5fde31d..c3f540933238 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -852,8 +852,7 @@  static noinline void submit_compressed_extents(struct inode *inode,
 			const u64 end = start + async_extent->ram_size - 1;
 
 			p->mapping = inode->i_mapping;
-			btrfs_writepage_endio_finish_ordered(p, start, end,
-							     NULL, 0);
+			btrfs_writepage_endio_finish_ordered(p, start, end, 0);
 
 			p->mapping = NULL;
 			extent_clear_unlock_delalloc(inode, start, end, end,
@@ -3152,8 +3151,8 @@  static void finish_ordered_fn(struct btrfs_work *work)
 	btrfs_finish_ordered_io(ordered_extent);
 }
 
-void btrfs_writepage_endio_finish_ordered(struct page *page, u64 start, u64 end,
-				struct extent_state *state, int uptodate)
+void btrfs_writepage_endio_finish_ordered(struct page *page, u64 start,
+					  u64 end, int uptodate)
 {
 	struct inode *inode = page->mapping->host;
 	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);