All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/29] Cleanup of unused parameters
@ 2017-02-13  9:33 David Sterba
  2017-02-13  9:33 ` [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search David Sterba
                   ` (28 more replies)
  0 siblings, 29 replies; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

There are quite a few places where function parameters are unused and there's
no reason to keep them. The notable exceptions are callbacks that must match a
given prototype. There are several cases where the parameter has not been
removed after refactoring or other changes, but I'm more disappointed by the
numerous cases where parameters were added but never used.

I haven't measured the effects on runtime stack consumption, the estimate
savings can be counted in tens of bytes.

Found by 'make ccflags-y=-Wunused-parameter', applies on top of my current 4.11
queue.

David Sterba (29):
  btrfs: remove unused parameter from read_block_for_search
  btrfs: remove unused parameter from check_async_write
  btrfs: remove unused parameter from clean_tree_block
  btrfs: remove unused parameter from split_item
  btrfs: remove unused parameter from write_dev_supers
  btrfs: merge two superblock writing helpers
  btrfs: remove unused parameter from __push_leaf_right
  btrfs: remove unused parameter from __push_leaf_left
  btrfs: remove unused parameter from btrfs_subvolume_release_metadata
  btrfs: remove unused parameter from btrfs_prepare_extent_commit
  btrfs: remove unused parameter from btrfs_check_super_valid
  btrfs: remove unused parameter from tree_move_down
  btrfs: remove unused parameter from tree_move_next_or_upnext
  btrfs: remove unused parameter from submit_extent_page
  btrfs: remove unused parameter from update_nr_written
  btrfs: remove unused parameter from add_pending_csums
  btrfs: remove unused parameter from extent_write_cache_pages
  btrfs: remove unused parameter from btrfs_fill_super
  btrfs: remove unused parameter from __btrfs_alloc_chunk
  btrfs: remove unused parameter from init_first_rw_device
  btrfs: remove unused parameter from create_snapshot
  btrfs: remove unused parameters from scrub_setup_wr_ctx
  btrfs: remove unused parameter from __add_inline_refs
  btrfs: remove unused parameters from btrfs_cmp_data
  btrfs: remove unused parameter from clone_copy_inline_extent
  btrfs: remove unused parameter from __add_inode_ref
  btrfs: remove unused parameter from cleanup_write_cache_enospc
  btrfs: remove unused parameters from __btrfs_write_out_cache
  btrfs: remove unused parameter from adjust_slots_upwards

 fs/btrfs/backref.c          |  5 ++---
 fs/btrfs/ctree.c            | 51 ++++++++++++++++++++-------------------------
 fs/btrfs/ctree.h            |  6 ++----
 fs/btrfs/disk-io.c          | 29 +++++++++-----------------
 fs/btrfs/disk-io.h          |  6 ++----
 fs/btrfs/extent-tree.c      | 10 ++++-----
 fs/btrfs/extent_io.c        | 21 ++++++++-----------
 fs/btrfs/free-space-cache.c | 16 +++++---------
 fs/btrfs/free-space-tree.c  |  2 +-
 fs/btrfs/inode.c            |  6 ++----
 fs/btrfs/ioctl.c            | 25 +++++++++-------------
 fs/btrfs/qgroup.c           |  7 +++----
 fs/btrfs/scrub.c            | 10 +++------
 fs/btrfs/super.c            |  5 ++---
 fs/btrfs/transaction.c      |  4 ++--
 fs/btrfs/tree-log.c         | 11 +++++-----
 fs/btrfs/volumes.c          | 18 +++++++---------
 17 files changed, 92 insertions(+), 140 deletions(-)

-- 
2.10.1


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

* [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-14  0:59   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 02/29] btrfs: remove unused parameter from check_async_write David Sterba
                   ` (27 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used in that function.

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

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index fbeff20eb194..35e22349c139 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2440,7 +2440,7 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
 static int
 read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
 		      struct extent_buffer **eb_ret, int level, int slot,
-		      const struct btrfs_key *key, u64 time_seq)
+		      const struct btrfs_key *key)
 {
 	struct btrfs_fs_info *fs_info = root->fs_info;
 	u64 blocknr;
@@ -2871,7 +2871,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root,
 			}
 
 			err = read_block_for_search(root, p, &b, level,
-						    slot, key, 0);
+						    slot, key);
 			if (err == -EAGAIN)
 				goto again;
 			if (err) {
@@ -3015,7 +3015,7 @@ int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,
 			}
 
 			err = read_block_for_search(root, p, &b, level,
-						    slot, key, time_seq);
+						    slot, key);
 			if (err == -EAGAIN)
 				goto again;
 			if (err) {
@@ -5786,7 +5786,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
 		next = c;
 		next_rw_lock = path->locks[level];
 		ret = read_block_for_search(root, path, &next, level,
-					    slot, &key, 0);
+					    slot, &key);
 		if (ret == -EAGAIN)
 			goto again;
 
@@ -5836,7 +5836,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
 			break;
 
 		ret = read_block_for_search(root, path, &next, level,
-					    0, &key, 0);
+					    0, &key);
 		if (ret == -EAGAIN)
 			goto again;
 
-- 
2.10.1


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

* [PATCH 02/29] btrfs: remove unused parameter from check_async_write
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
  2017-02-13  9:33 ` [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 20:41   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 03/29] btrfs: remove unused parameter from clean_tree_block David Sterba
                   ` (26 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Added but never used.

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

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 18004169552c..89cd597883fd 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1005,7 +1005,7 @@ static int __btree_submit_bio_done(struct inode *inode, struct bio *bio,
 	return ret;
 }
 
-static int check_async_write(struct inode *inode, unsigned long bio_flags)
+static int check_async_write(unsigned long bio_flags)
 {
 	if (bio_flags & EXTENT_BIO_TREE_LOG)
 		return 0;
@@ -1021,7 +1021,7 @@ static int btree_submit_bio_hook(struct inode *inode, struct bio *bio,
 				 u64 bio_offset)
 {
 	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
-	int async = check_async_write(inode, bio_flags);
+	int async = check_async_write(bio_flags);
 	int ret;
 
 	if (bio_op(bio) != REQ_OP_WRITE) {
-- 
2.10.1


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

* [PATCH 03/29] btrfs: remove unused parameter from clean_tree_block
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
  2017-02-13  9:33 ` [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search David Sterba
  2017-02-13  9:33 ` [PATCH 02/29] btrfs: remove unused parameter from check_async_write David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 21:12   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 04/29] btrfs: remove unused parameter from split_item David Sterba
                   ` (25 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Added but never needed.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ctree.c           | 16 ++++++++--------
 fs/btrfs/disk-io.c         |  3 +--
 fs/btrfs/disk-io.h         |  3 +--
 fs/btrfs/extent-tree.c     |  4 ++--
 fs/btrfs/free-space-tree.c |  2 +-
 fs/btrfs/qgroup.c          |  2 +-
 fs/btrfs/tree-log.c        |  6 +++---
 7 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 35e22349c139..d509dafdb20c 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1074,7 +1074,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
 			ret = btrfs_dec_ref(trans, root, buf, 1);
 			BUG_ON(ret); /* -ENOMEM */
 		}
-		clean_tree_block(trans, fs_info, buf);
+		clean_tree_block(fs_info, buf);
 		*last_ref = 1;
 	}
 	return 0;
@@ -1938,7 +1938,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
 
 		path->locks[level] = 0;
 		path->nodes[level] = NULL;
-		clean_tree_block(trans, fs_info, mid);
+		clean_tree_block(fs_info, mid);
 		btrfs_tree_unlock(mid);
 		/* once for the path */
 		free_extent_buffer(mid);
@@ -1999,7 +1999,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
 		if (wret < 0 && wret != -ENOSPC)
 			ret = wret;
 		if (btrfs_header_nritems(right) == 0) {
-			clean_tree_block(trans, fs_info, right);
+			clean_tree_block(fs_info, right);
 			btrfs_tree_unlock(right);
 			del_ptr(root, path, level + 1, pslot + 1);
 			root_sub_used(root, right->len);
@@ -2043,7 +2043,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
 		BUG_ON(wret == 1);
 	}
 	if (btrfs_header_nritems(mid) == 0) {
-		clean_tree_block(trans, fs_info, mid);
+		clean_tree_block(fs_info, mid);
 		btrfs_tree_unlock(mid);
 		del_ptr(root, path, level + 1, pslot);
 		root_sub_used(root, mid->len);
@@ -3705,7 +3705,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
 	if (left_nritems)
 		btrfs_mark_buffer_dirty(left);
 	else
-		clean_tree_block(trans, fs_info, left);
+		clean_tree_block(fs_info, left);
 
 	btrfs_mark_buffer_dirty(right);
 
@@ -3717,7 +3717,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
 	if (path->slots[0] >= left_nritems) {
 		path->slots[0] -= left_nritems;
 		if (btrfs_header_nritems(path->nodes[0]) == 0)
-			clean_tree_block(trans, fs_info, path->nodes[0]);
+			clean_tree_block(fs_info, path->nodes[0]);
 		btrfs_tree_unlock(path->nodes[0]);
 		free_extent_buffer(path->nodes[0]);
 		path->nodes[0] = right;
@@ -3946,7 +3946,7 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
 	if (right_nritems)
 		btrfs_mark_buffer_dirty(right);
 	else
-		clean_tree_block(trans, fs_info, right);
+		clean_tree_block(fs_info, right);
 
 	btrfs_item_key(right, &disk_key, 0);
 	fixup_low_keys(fs_info, path, &disk_key, 1);
@@ -5009,7 +5009,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
 			btrfs_set_header_level(leaf, 0);
 		} else {
 			btrfs_set_path_blocking(path);
-			clean_tree_block(trans, fs_info, leaf);
+			clean_tree_block(fs_info, leaf);
 			btrfs_del_leaf(trans, root, path, leaf);
 		}
 	} else {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 89cd597883fd..48846d215e97 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1248,8 +1248,7 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
 
 }
 
-void clean_tree_block(struct btrfs_trans_handle *trans,
-		      struct btrfs_fs_info *fs_info,
+void clean_tree_block(struct btrfs_fs_info *fs_info,
 		      struct extent_buffer *buf)
 {
 	if (btrfs_header_generation(buf) ==
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
index 44dcd9af6b7c..1864e7ce9c70 100644
--- a/fs/btrfs/disk-io.h
+++ b/fs/btrfs/disk-io.h
@@ -52,8 +52,7 @@ int reada_tree_block_flagged(struct btrfs_fs_info *fs_info, u64 bytenr,
 struct extent_buffer *btrfs_find_create_tree_block(
 						struct btrfs_fs_info *fs_info,
 						u64 bytenr);
-void clean_tree_block(struct btrfs_trans_handle *trans,
-		      struct btrfs_fs_info *fs_info, struct extent_buffer *buf);
+void clean_tree_block(struct btrfs_fs_info *fs_info, struct extent_buffer *buf);
 int open_ctree(struct super_block *sb,
 	       struct btrfs_fs_devices *fs_devices,
 	       char *options);
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 0992cd1393a6..9e8d6c2e7a64 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -8253,7 +8253,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
 	btrfs_set_header_generation(buf, trans->transid);
 	btrfs_set_buffer_lockdep_class(root->root_key.objectid, buf, level);
 	btrfs_tree_lock(buf);
-	clean_tree_block(trans, fs_info, buf);
+	clean_tree_block(fs_info, buf);
 	clear_bit(EXTENT_BUFFER_STALE, &buf->bflags);
 
 	btrfs_set_lock_blocking(buf);
@@ -8874,7 +8874,7 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
 			btrfs_set_lock_blocking(eb);
 			path->locks[level] = BTRFS_WRITE_LOCK_BLOCKING;
 		}
-		clean_tree_block(trans, fs_info, eb);
+		clean_tree_block(fs_info, eb);
 	}
 
 	if (eb == root->node) {
diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
index ff0c55337c2e..dd7fb22a955a 100644
--- a/fs/btrfs/free-space-tree.c
+++ b/fs/btrfs/free-space-tree.c
@@ -1269,7 +1269,7 @@ int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info)
 	list_del(&free_space_root->dirty_list);
 
 	btrfs_tree_lock(free_space_root->node);
-	clean_tree_block(trans, fs_info, free_space_root->node);
+	clean_tree_block(fs_info, free_space_root->node);
 	btrfs_tree_unlock(free_space_root->node);
 	btrfs_free_tree_block(trans, free_space_root, free_space_root->node,
 			      0, 1);
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 8496dbf3f38b..6d106e623604 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1019,7 +1019,7 @@ int btrfs_quota_disable(struct btrfs_trans_handle *trans,
 	list_del(&quota_root->dirty_list);
 
 	btrfs_tree_lock(quota_root->node);
-	clean_tree_block(trans, fs_info, quota_root->node);
+	clean_tree_block(fs_info, quota_root->node);
 	btrfs_tree_unlock(quota_root->node);
 	btrfs_free_tree_block(trans, quota_root, quota_root->node, 0, 1);
 
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 010cf7685677..cea93ba1f099 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2472,7 +2472,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
 				if (trans) {
 					btrfs_tree_lock(next);
 					btrfs_set_lock_blocking(next);
-					clean_tree_block(trans, fs_info, next);
+					clean_tree_block(fs_info, next);
 					btrfs_wait_tree_block_writeback(next);
 					btrfs_tree_unlock(next);
 				}
@@ -2552,7 +2552,7 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans,
 				if (trans) {
 					btrfs_tree_lock(next);
 					btrfs_set_lock_blocking(next);
-					clean_tree_block(trans, fs_info, next);
+					clean_tree_block(fs_info, next);
 					btrfs_wait_tree_block_writeback(next);
 					btrfs_tree_unlock(next);
 				}
@@ -2630,7 +2630,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans,
 			if (trans) {
 				btrfs_tree_lock(next);
 				btrfs_set_lock_blocking(next);
-				clean_tree_block(trans, fs_info, next);
+				clean_tree_block(fs_info, next);
 				btrfs_wait_tree_block_writeback(next);
 				btrfs_tree_unlock(next);
 			}
-- 
2.10.1


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

* [PATCH 04/29] btrfs: remove unused parameter from split_item
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (2 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 03/29] btrfs: remove unused parameter from clean_tree_block David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 20:43   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 05/29] btrfs: remove unused parameter from write_dev_supers David Sterba
                   ` (24 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used.

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

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index d509dafdb20c..4c5d7c40c8bf 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -4413,8 +4413,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
 	return ret;
 }
 
-static noinline int split_item(struct btrfs_trans_handle *trans,
-			       struct btrfs_fs_info *fs_info,
+static noinline int split_item(struct btrfs_fs_info *fs_info,
 			       struct btrfs_path *path,
 			       const struct btrfs_key *new_key,
 			       unsigned long split_offset)
@@ -4511,7 +4510,7 @@ int btrfs_split_item(struct btrfs_trans_handle *trans,
 	if (ret)
 		return ret;
 
-	ret = split_item(trans, root->fs_info, path, new_key, split_offset);
+	ret = split_item(root->fs_info, path, new_key, split_offset);
 	return ret;
 }
 
-- 
2.10.1


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

* [PATCH 05/29] btrfs: remove unused parameter from write_dev_supers
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (3 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 04/29] btrfs: remove unused parameter from split_item David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-14  1:59   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 06/29] btrfs: merge two superblock writing helpers David Sterba
                   ` (23 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

The barriers are handled by the caller.

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

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 48846d215e97..43e71457c193 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3410,7 +3410,7 @@ struct buffer_head *btrfs_read_dev_super(struct block_device *bdev)
  */
 static int write_dev_supers(struct btrfs_device *device,
 			    struct btrfs_super_block *sb,
-			    int do_barriers, int wait, int max_mirrors)
+			    int wait, int max_mirrors)
 {
 	struct buffer_head *bh;
 	int i;
@@ -3752,7 +3752,7 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
 		flags = btrfs_super_flags(sb);
 		btrfs_set_super_flags(sb, flags | BTRFS_HEADER_FLAG_WRITTEN);
 
-		ret = write_dev_supers(dev, sb, do_barriers, 0, max_mirrors);
+		ret = write_dev_supers(dev, sb, 0, max_mirrors);
 		if (ret)
 			total_errors++;
 	}
@@ -3775,7 +3775,7 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
 		if (!dev->in_fs_metadata || !dev->writeable)
 			continue;
 
-		ret = write_dev_supers(dev, sb, do_barriers, 1, max_mirrors);
+		ret = write_dev_supers(dev, sb, 1, max_mirrors);
 		if (ret)
 			total_errors++;
 	}
-- 
2.10.1


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

* [PATCH 06/29] btrfs: merge two superblock writing helpers
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (4 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 05/29] btrfs: remove unused parameter from write_dev_supers David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 21:05   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 07/29] btrfs: remove unused parameter from __push_leaf_right David Sterba
                   ` (22 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

write_all_supers and write_ctree_super are almost equal, the parameter
'trans' is unused so we can drop it and have just one helper.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/disk-io.c     | 8 +-------
 fs/btrfs/disk-io.h     | 3 +--
 fs/btrfs/transaction.c | 2 +-
 fs/btrfs/tree-log.c    | 2 +-
 4 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 43e71457c193..441a62cd0351 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3695,7 +3695,7 @@ int btrfs_calc_num_tolerated_disk_barrier_failures(
 	return num_tolerated_disk_barrier_failures;
 }
 
-static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
+int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
 {
 	struct list_head *head;
 	struct btrfs_device *dev;
@@ -3789,12 +3789,6 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
 	return 0;
 }
 
-int write_ctree_super(struct btrfs_trans_handle *trans,
-		      struct btrfs_fs_info *fs_info, int max_mirrors)
-{
-	return write_all_supers(fs_info, max_mirrors);
-}
-
 /* Drop a fs root from the radix tree and free it. */
 void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
 				  struct btrfs_root *root)
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
index 1864e7ce9c70..0be2d4fe705b 100644
--- a/fs/btrfs/disk-io.h
+++ b/fs/btrfs/disk-io.h
@@ -57,8 +57,7 @@ int open_ctree(struct super_block *sb,
 	       struct btrfs_fs_devices *fs_devices,
 	       char *options);
 void close_ctree(struct btrfs_fs_info *fs_info);
-int write_ctree_super(struct btrfs_trans_handle *trans,
-		      struct btrfs_fs_info *fs_info, int max_mirrors);
+int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors);
 struct buffer_head *btrfs_read_dev_super(struct block_device *bdev);
 int btrfs_read_dev_one_super(struct block_device *bdev, int copy_num,
 			struct buffer_head **bh_ret);
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 48aabb367f73..7d1d71259cd0 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2261,7 +2261,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 		goto scrub_continue;
 	}
 
-	ret = write_ctree_super(trans, fs_info, 0);
+	ret = write_all_supers(fs_info, 0);
 	if (ret) {
 		mutex_unlock(&fs_info->tree_log_mutex);
 		goto scrub_continue;
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index cea93ba1f099..62dd138018b5 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2961,7 +2961,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
 	 * the running transaction open, so a full commit can't hop
 	 * in and cause problems either.
 	 */
-	ret = write_ctree_super(trans, fs_info, 1);
+	ret = write_all_supers(fs_info, 1);
 	if (ret) {
 		btrfs_set_log_full_commit(fs_info, trans);
 		btrfs_abort_transaction(trans, ret);
-- 
2.10.1


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

* [PATCH 07/29] btrfs: remove unused parameter from __push_leaf_right
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (5 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 06/29] btrfs: merge two superblock writing helpers David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 21:14   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 08/29] btrfs: remove unused parameter from __push_leaf_left David Sterba
                   ` (21 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Unused since long ago.

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

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 4c5d7c40c8bf..2283f92b5484 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -3595,8 +3595,7 @@ noinline int btrfs_leaf_free_space(struct btrfs_fs_info *fs_info,
  * min slot controls the lowest index we're willing to push to the
  * right.  We'll push up to and including min_slot, but no lower
  */
-static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
-				      struct btrfs_fs_info *fs_info,
+static noinline int __push_leaf_right(struct btrfs_fs_info *fs_info,
 				      struct btrfs_path *path,
 				      int data_size, int empty,
 				      struct extent_buffer *right,
@@ -3810,7 +3809,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
 		return 0;
 	}
 
-	return __push_leaf_right(trans, fs_info, path, min_data_size, empty,
+	return __push_leaf_right(fs_info, path, min_data_size, empty,
 				right, free_space, left_nritems, min_slot);
 out_unlock:
 	btrfs_tree_unlock(right);
-- 
2.10.1


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

* [PATCH 08/29] btrfs: remove unused parameter from __push_leaf_left
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (6 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 07/29] btrfs: remove unused parameter from __push_leaf_right David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 21:18   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 09/29] btrfs: remove unused parameter from btrfs_subvolume_release_metadata David Sterba
                   ` (20 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Unused since long ago.

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

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 2283f92b5484..b98e90a3eee7 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -3825,8 +3825,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
  * item at 'max_slot' won't be touched.  Use (u32)-1 to make us do all the
  * items
  */
-static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
-				     struct btrfs_fs_info *fs_info,
+static noinline int __push_leaf_left(struct btrfs_fs_info *fs_info,
 				     struct btrfs_path *path, int data_size,
 				     int empty, struct extent_buffer *left,
 				     int free_space, u32 right_nritems,
@@ -4035,7 +4034,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
 		goto out;
 	}
 
-	return __push_leaf_left(trans, fs_info, path, min_data_size,
+	return __push_leaf_left(fs_info, path, min_data_size,
 			       empty, left, free_space, right_nritems,
 			       max_slot);
 out:
-- 
2.10.1


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

* [PATCH 09/29] btrfs: remove unused parameter from btrfs_subvolume_release_metadata
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (7 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 08/29] btrfs: remove unused parameter from __push_leaf_left David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 21:17   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 10/29] btrfs: remove unused parameter from btrfs_prepare_extent_commit David Sterba
                   ` (19 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Unused since qgroup refactoring that split data and metadata accounting,
the btrfs_qgroup_free helper.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ctree.h       |  3 +--
 fs/btrfs/extent-tree.c |  3 +--
 fs/btrfs/ioctl.c       | 11 ++++-------
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 1692ebb05955..0f5b85772023 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2703,8 +2703,7 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
 				     int nitems,
 				     u64 *qgroup_reserved, bool use_global_rsv);
 void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info,
-				      struct btrfs_block_rsv *rsv,
-				      u64 qgroup_reserved);
+				      struct btrfs_block_rsv *rsv);
 int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes);
 void btrfs_delalloc_release_metadata(struct inode *inode, u64 num_bytes);
 int btrfs_delalloc_reserve_space(struct inode *inode, u64 start, u64 len);
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9e8d6c2e7a64..b33e2c8325c8 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5826,8 +5826,7 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
 }
 
 void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info,
-				      struct btrfs_block_rsv *rsv,
-				      u64 qgroup_reserved)
+				      struct btrfs_block_rsv *rsv)
 {
 	btrfs_block_rsv_release(fs_info, rsv, (u64)-1);
 }
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 77f93a1e65c7..e8c7c313c113 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -487,8 +487,7 @@ static noinline int create_subvol(struct inode *dir,
 	trans = btrfs_start_transaction(root, 0);
 	if (IS_ERR(trans)) {
 		ret = PTR_ERR(trans);
-		btrfs_subvolume_release_metadata(fs_info, &block_rsv,
-						 qgroup_reserved);
+		btrfs_subvolume_release_metadata(fs_info, &block_rsv);
 		goto fail_free;
 	}
 	trans->block_rsv = &block_rsv;
@@ -613,7 +612,7 @@ static noinline int create_subvol(struct inode *dir,
 	kfree(root_item);
 	trans->block_rsv = NULL;
 	trans->bytes_reserved = 0;
-	btrfs_subvolume_release_metadata(fs_info, &block_rsv, qgroup_reserved);
+	btrfs_subvolume_release_metadata(fs_info, &block_rsv);
 
 	if (async_transid) {
 		*async_transid = trans->transid;
@@ -753,9 +752,7 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
 	d_instantiate(dentry, inode);
 	ret = 0;
 fail:
-	btrfs_subvolume_release_metadata(fs_info,
-					 &pending_snapshot->block_rsv,
-					 pending_snapshot->qgroup_reserved);
+	btrfs_subvolume_release_metadata(fs_info, &pending_snapshot->block_rsv);
 dec_and_free:
 	if (atomic_dec_and_test(&root->will_be_snapshoted))
 		wake_up_atomic_t(&root->will_be_snapshoted);
@@ -2555,7 +2552,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
 		err = ret;
 	inode->i_flags |= S_DEAD;
 out_release:
-	btrfs_subvolume_release_metadata(fs_info, &block_rsv, qgroup_reserved);
+	btrfs_subvolume_release_metadata(fs_info, &block_rsv);
 out_up_write:
 	up_write(&fs_info->subvol_sem);
 	if (err) {
-- 
2.10.1


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

* [PATCH 10/29] btrfs: remove unused parameter from btrfs_prepare_extent_commit
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (8 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 09/29] btrfs: remove unused parameter from btrfs_subvolume_release_metadata David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 21:20   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid David Sterba
                   ` (18 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Added but never used.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ctree.h       | 3 +--
 fs/btrfs/extent-tree.c | 3 +--
 fs/btrfs/transaction.c | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 0f5b85772023..e7dbda3dd3b8 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2630,8 +2630,7 @@ int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,
 			       u64 start, u64 len, int delalloc);
 int btrfs_free_and_pin_reserved_extent(struct btrfs_fs_info *fs_info,
 				       u64 start, u64 len);
-void btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans,
-				 struct btrfs_fs_info *fs_info);
+void btrfs_prepare_extent_commit(struct btrfs_fs_info *fs_info);
 int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
 			       struct btrfs_fs_info *fs_info);
 int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b33e2c8325c8..2500e3df3250 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6558,8 +6558,7 @@ static int btrfs_free_reserved_bytes(struct btrfs_block_group_cache *cache,
 	spin_unlock(&space_info->lock);
 	return ret;
 }
-void btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans,
-				struct btrfs_fs_info *fs_info)
+void btrfs_prepare_extent_commit(struct btrfs_fs_info *fs_info)
 {
 	struct btrfs_caching_control *next;
 	struct btrfs_caching_control *caching_ctl;
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 7d1d71259cd0..8bfb5e2c31f9 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -2211,7 +2211,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
 		goto scrub_continue;
 	}
 
-	btrfs_prepare_extent_commit(trans, fs_info);
+	btrfs_prepare_extent_commit(fs_info);
 
 	cur_trans = fs_info->running_transaction;
 
-- 
2.10.1


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

* [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (9 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 10/29] btrfs: remove unused parameter from btrfs_prepare_extent_commit David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-14  2:11   ` Liu Bo
  2017-02-13  9:33 ` [PATCH 12/29] btrfs: remove unused parameter from tree_move_down David Sterba
                   ` (17 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

None of the checks need to know the RO/RW status.

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

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 441a62cd0351..2b06f557c176 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -64,8 +64,7 @@
 static const struct extent_io_ops btree_extent_io_ops;
 static void end_workqueue_fn(struct btrfs_work *work);
 static void free_fs_root(struct btrfs_root *root);
-static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
-				    int read_only);
+static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info);
 static void btrfs_destroy_ordered_extents(struct btrfs_root *root);
 static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
 				      struct btrfs_fs_info *fs_info);
@@ -2801,7 +2800,7 @@ int open_ctree(struct super_block *sb,
 
 	memcpy(fs_info->fsid, fs_info->super_copy->fsid, BTRFS_FSID_SIZE);
 
-	ret = btrfs_check_super_valid(fs_info, sb->s_flags & MS_RDONLY);
+	ret = btrfs_check_super_valid(fs_info);
 	if (ret) {
 		btrfs_err(fs_info, "superblock contains fatal errors");
 		err = -EINVAL;
@@ -4115,8 +4114,7 @@ int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid)
 	return btree_read_extent_buffer_pages(fs_info, buf, parent_transid);
 }
 
-static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
-			      int read_only)
+static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info)
 {
 	struct btrfs_super_block *sb = fs_info->super_copy;
 	u64 nodesize = btrfs_super_nodesize(sb);
-- 
2.10.1


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

* [PATCH 12/29] btrfs: remove unused parameter from tree_move_down
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (10 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid David Sterba
@ 2017-02-13  9:33 ` David Sterba
  2017-02-15 21:21   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 13/29] btrfs: remove unused parameter from tree_move_next_or_upnext David Sterba
                   ` (16 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:33 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never needed.

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

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index b98e90a3eee7..a981c2acd6fa 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -5241,7 +5241,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
 
 static int tree_move_down(struct btrfs_fs_info *fs_info,
 			   struct btrfs_path *path,
-			   int *level, int root_level)
+			   int *level)
 {
 	struct extent_buffer *eb;
 
@@ -5299,7 +5299,7 @@ static int tree_advance(struct btrfs_fs_info *fs_info,
 		ret = tree_move_next_or_upnext(fs_info, path, level,
 					       root_level);
 	} else {
-		ret = tree_move_down(fs_info, path, level, root_level);
+		ret = tree_move_down(fs_info, path, level);
 	}
 	if (ret >= 0) {
 		if (*level == 0)
-- 
2.10.1


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

* [PATCH 13/29] btrfs: remove unused parameter from tree_move_next_or_upnext
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (11 preceding siblings ...)
  2017-02-13  9:33 ` [PATCH 12/29] btrfs: remove unused parameter from tree_move_down David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:22   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page David Sterba
                   ` (15 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Not needed.

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

diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index a981c2acd6fa..1192bc7d2ee7 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -5256,8 +5256,7 @@ static int tree_move_down(struct btrfs_fs_info *fs_info,
 	return 0;
 }
 
-static int tree_move_next_or_upnext(struct btrfs_fs_info *fs_info,
-				    struct btrfs_path *path,
+static int tree_move_next_or_upnext(struct btrfs_path *path,
 				    int *level, int root_level)
 {
 	int ret = 0;
@@ -5296,8 +5295,7 @@ static int tree_advance(struct btrfs_fs_info *fs_info,
 	int ret;
 
 	if (*level == 0 || !allow_down) {
-		ret = tree_move_next_or_upnext(fs_info, path, level,
-					       root_level);
+		ret = tree_move_next_or_upnext(path, level, root_level);
 	} else {
 		ret = tree_move_down(fs_info, path, level);
 	}
-- 
2.10.1


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

* [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (12 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 13/29] btrfs: remove unused parameter from tree_move_next_or_upnext David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-14 19:10   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 15/29] btrfs: remove unused parameter from update_nr_written David Sterba
                   ` (14 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

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,
@@ -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;
-- 
2.10.1


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

* [PATCH 15/29] btrfs: remove unused parameter from update_nr_written
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (13 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:22   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 16/29] btrfs: remove unused parameter from add_pending_csums David Sterba
                   ` (13 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

The logic has been updated in "Btrfs: make mapping->writeback_index
point to the last written page" (a91326679f2a0a4c2) and page is not
needed anymore.

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

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index 00f3be5c4f2d..f683fa5a4b91 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3203,7 +3203,7 @@ int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
 	return ret;
 }
 
-static void update_nr_written(struct page *page, struct writeback_control *wbc,
+static void update_nr_written(struct writeback_control *wbc,
 			      unsigned long nr_written)
 {
 	wbc->nr_to_write -= nr_written;
@@ -3341,7 +3341,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
 			else
 				redirty_page_for_writepage(wbc, page);
 
-			update_nr_written(page, wbc, nr_written);
+			update_nr_written(wbc, nr_written);
 			unlock_page(page);
 			return 1;
 		}
@@ -3351,7 +3351,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
 	 * we don't want to touch the inode after unlocking the page,
 	 * so we update the mapping writeback index now
 	 */
-	update_nr_written(page, wbc, nr_written + 1);
+	update_nr_written(wbc, nr_written + 1);
 
 	end = page_end;
 	if (i_size <= start) {
@@ -3764,7 +3764,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
 			break;
 		}
 		offset += PAGE_SIZE;
-		update_nr_written(p, wbc, 1);
+		update_nr_written(wbc, 1);
 		unlock_page(p);
 	}
 
-- 
2.10.1


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

* [PATCH 16/29] btrfs: remove unused parameter from add_pending_csums
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (14 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 15/29] btrfs: remove unused parameter from update_nr_written David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:23   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages David Sterba
                   ` (12 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used.

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

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7ed693294498..3ac7474f921d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -1961,8 +1961,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
  * at IO completion time based on sums calculated at bio submission time.
  */
 static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
-			     struct inode *inode, u64 file_offset,
-			     struct list_head *list)
+			     struct inode *inode, struct list_head *list)
 {
 	struct btrfs_ordered_sum *sum;
 
@@ -2956,8 +2955,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
 		goto out_unlock;
 	}
 
-	add_pending_csums(trans, inode, ordered_extent->file_offset,
-			  &ordered_extent->list);
+	add_pending_csums(trans, inode, &ordered_extent->list);
 
 	btrfs_ordered_update_i_size(inode, 0, ordered_extent);
 	ret = btrfs_update_inode_fallback(trans, root, inode);
-- 
2.10.1


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

* [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (15 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 16/29] btrfs: remove unused parameter from add_pending_csums David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-14 19:35   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 18/29] btrfs: remove unused parameter from btrfs_fill_super David Sterba
                   ` (11 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

The 'tree' was used to call locking hook that does not exist anymore.

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

diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index f683fa5a4b91..22a2f2fa62c7 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -3916,8 +3916,7 @@ int btree_write_cache_pages(struct address_space *mapping,
  * WB_SYNC_ALL then we were called for data integrity and we must wait for
  * existing IO to complete.
  */
-static int extent_write_cache_pages(struct extent_io_tree *tree,
-			     struct address_space *mapping,
+static int extent_write_cache_pages(struct address_space *mapping,
 			     struct writeback_control *wbc,
 			     writepage_t writepage, void *data,
 			     void (*flush_fn)(void *))
@@ -4158,8 +4157,7 @@ int extent_writepages(struct extent_io_tree *tree,
 		.bio_flags = 0,
 	};
 
-	ret = extent_write_cache_pages(tree, mapping, wbc,
-				       __extent_writepage, &epd,
+	ret = extent_write_cache_pages(mapping, wbc, __extent_writepage, &epd,
 				       flush_write_bio);
 	flush_epd_write_bio(&epd);
 	return ret;
-- 
2.10.1


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

* [PATCH 18/29] btrfs: remove unused parameter from btrfs_fill_super
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (16 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:27   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 19/29] btrfs: remove unused parameter from __btrfs_alloc_chunk David Sterba
                   ` (10 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used for anything meaningful since we have our own superblock
filler.

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

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 93ed29c2a38b..da687dc79cce 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1114,7 +1114,7 @@ static int get_default_subvol_objectid(struct btrfs_fs_info *fs_info, u64 *objec
 
 static int btrfs_fill_super(struct super_block *sb,
 			    struct btrfs_fs_devices *fs_devices,
-			    void *data, int silent)
+			    void *data)
 {
 	struct inode *inode;
 	struct btrfs_fs_info *fs_info = btrfs_sb(sb);
@@ -1611,8 +1611,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
 	} else {
 		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
 		btrfs_sb(s)->bdev_holder = fs_type;
-		error = btrfs_fill_super(s, fs_devices, data,
-					 flags & MS_SILENT ? 1 : 0);
+		error = btrfs_fill_super(s, fs_devices, data);
 	}
 	if (error) {
 		deactivate_locked_super(s);
-- 
2.10.1


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

* [PATCH 19/29] btrfs: remove unused parameter from __btrfs_alloc_chunk
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (17 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 18/29] btrfs: remove unused parameter from btrfs_fill_super David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:28   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 20/29] btrfs: remove unused parameter from init_first_rw_device David Sterba
                   ` (9 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

We grab fs_info from other parameters.

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

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 3c3c69c0eee4..d234625e4e02 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4584,8 +4584,7 @@ static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type)
 				/ sizeof(struct btrfs_stripe) + 1)
 
 static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
-			       struct btrfs_fs_info *fs_info, u64 start,
-			       u64 type)
+			       u64 start, u64 type)
 {
 	struct btrfs_fs_info *info = trans->fs_info;
 	struct btrfs_fs_devices *fs_devices = info->fs_devices;
@@ -5009,7 +5008,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 
 	ASSERT(mutex_is_locked(&fs_info->chunk_mutex));
 	chunk_offset = find_next_chunk(fs_info);
-	return __btrfs_alloc_chunk(trans, fs_info, chunk_offset, type);
+	return __btrfs_alloc_chunk(trans, chunk_offset, type);
 }
 
 static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
@@ -5024,14 +5023,13 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
 
 	chunk_offset = find_next_chunk(fs_info);
 	alloc_profile = btrfs_get_alloc_profile(extent_root, 0);
-	ret = __btrfs_alloc_chunk(trans, fs_info, chunk_offset, alloc_profile);
+	ret = __btrfs_alloc_chunk(trans, chunk_offset, alloc_profile);
 	if (ret)
 		return ret;
 
 	sys_chunk_offset = find_next_chunk(fs_info);
 	alloc_profile = btrfs_get_alloc_profile(fs_info->chunk_root, 0);
-	ret = __btrfs_alloc_chunk(trans, fs_info, sys_chunk_offset,
-				  alloc_profile);
+	ret = __btrfs_alloc_chunk(trans, sys_chunk_offset, alloc_profile);
 	return ret;
 }
 
-- 
2.10.1


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

* [PATCH 20/29] btrfs: remove unused parameter from init_first_rw_device
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (18 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 19/29] btrfs: remove unused parameter from __btrfs_alloc_chunk David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:30   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 21/29] btrfs: remove unused parameter from create_snapshot David Sterba
                   ` (8 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

The 'device' used to be added in that function, but now it's done by the
caller.

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

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d234625e4e02..1fac98728814 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -134,8 +134,7 @@ const int btrfs_raid_mindev_error[BTRFS_NR_RAID_TYPES] = {
 };
 
 static int init_first_rw_device(struct btrfs_trans_handle *trans,
-				struct btrfs_fs_info *fs_info,
-				struct btrfs_device *device);
+				struct btrfs_fs_info *fs_info);
 static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info);
 static void __btrfs_reset_dev_stats(struct btrfs_device *dev);
 static void btrfs_dev_stat_print_on_error(struct btrfs_device *dev);
@@ -2440,7 +2439,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, char *device_path)
 
 	if (seeding_dev) {
 		mutex_lock(&fs_info->chunk_mutex);
-		ret = init_first_rw_device(trans, fs_info, device);
+		ret = init_first_rw_device(trans, fs_info);
 		mutex_unlock(&fs_info->chunk_mutex);
 		if (ret) {
 			btrfs_abort_transaction(trans, ret);
@@ -5012,8 +5011,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
 }
 
 static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
-					 struct btrfs_fs_info *fs_info,
-					 struct btrfs_device *device)
+					 struct btrfs_fs_info *fs_info)
 {
 	struct btrfs_root *extent_root = fs_info->extent_root;
 	u64 chunk_offset;
-- 
2.10.1


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

* [PATCH 21/29] btrfs: remove unused parameter from create_snapshot
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (19 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 20/29] btrfs: remove unused parameter from init_first_rw_device David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-14 19:36   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 22/29] btrfs: remove unused parameters from scrub_setup_wr_ctx David Sterba
                   ` (7 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

The name parameters have never been used, as the name is passed via the
dentry.

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

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index e8c7c313c113..91188a2ac5a1 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -656,7 +656,7 @@ static void btrfs_wait_for_no_snapshoting_writes(struct btrfs_root *root)
 }
 
 static int create_snapshot(struct btrfs_root *root, struct inode *dir,
-			   struct dentry *dentry, char *name, int namelen,
+			   struct dentry *dentry,
 			   u64 *async_transid, bool readonly,
 			   struct btrfs_qgroup_inherit *inherit)
 {
@@ -871,7 +871,7 @@ static noinline int btrfs_mksubvol(const struct path *parent,
 		goto out_up_read;
 
 	if (snap_src) {
-		error = create_snapshot(snap_src, dir, dentry, name, namelen,
+		error = create_snapshot(snap_src, dir, dentry,
 					async_transid, readonly, inherit);
 	} else {
 		error = create_subvol(dir, dentry, name, namelen,
-- 
2.10.1


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

* [PATCH 22/29] btrfs: remove unused parameters from scrub_setup_wr_ctx
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (20 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 21/29] btrfs: remove unused parameter from create_snapshot David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:29   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 23/29] btrfs: remove unused parameter from __add_inline_refs David Sterba
                   ` (6 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used.

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

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 9a94670536a6..f7dffacf61fa 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -282,9 +282,7 @@ static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
 			       u64 *extent_physical,
 			       struct btrfs_device **extent_dev,
 			       int *extent_mirror_num);
-static int scrub_setup_wr_ctx(struct scrub_ctx *sctx,
-			      struct scrub_wr_ctx *wr_ctx,
-			      struct btrfs_fs_info *fs_info,
+static int scrub_setup_wr_ctx(struct scrub_wr_ctx *wr_ctx,
 			      struct btrfs_device *dev,
 			      int is_dev_replace);
 static void scrub_free_wr_ctx(struct scrub_wr_ctx *wr_ctx);
@@ -501,7 +499,7 @@ struct scrub_ctx *scrub_setup_ctx(struct btrfs_device *dev, int is_dev_replace)
 	spin_lock_init(&sctx->stat_lock);
 	init_waitqueue_head(&sctx->list_wait);
 
-	ret = scrub_setup_wr_ctx(sctx, &sctx->wr_ctx, fs_info,
+	ret = scrub_setup_wr_ctx(&sctx->wr_ctx,
 				 fs_info->dev_replace.tgtdev, is_dev_replace);
 	if (ret) {
 		scrub_free_ctx(sctx);
@@ -4084,9 +4082,7 @@ static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
 	btrfs_put_bbio(bbio);
 }
 
-static int scrub_setup_wr_ctx(struct scrub_ctx *sctx,
-			      struct scrub_wr_ctx *wr_ctx,
-			      struct btrfs_fs_info *fs_info,
+static int scrub_setup_wr_ctx(struct scrub_wr_ctx *wr_ctx,
 			      struct btrfs_device *dev,
 			      int is_dev_replace)
 {
-- 
2.10.1


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

* [PATCH 23/29] btrfs: remove unused parameter from __add_inline_refs
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (21 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 22/29] btrfs: remove unused parameters from scrub_setup_wr_ctx David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:32   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 24/29] btrfs: remove unused parameters from btrfs_cmp_data David Sterba
                   ` (5 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used.

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

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index db706595e631..7699e16784d3 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -956,8 +956,7 @@ static int __add_delayed_refs(struct btrfs_delayed_ref_head *head, u64 seq,
 /*
  * add all inline backrefs for bytenr to the list
  */
-static int __add_inline_refs(struct btrfs_fs_info *fs_info,
-			     struct btrfs_path *path, u64 bytenr,
+static int __add_inline_refs(struct btrfs_path *path, u64 bytenr,
 			     int *info_level, struct list_head *prefs,
 			     struct ref_root *ref_tree,
 			     u64 *total_refs, u64 inum)
@@ -1354,7 +1353,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
 		if (key.objectid == bytenr &&
 		    (key.type == BTRFS_EXTENT_ITEM_KEY ||
 		     key.type == BTRFS_METADATA_ITEM_KEY)) {
-			ret = __add_inline_refs(fs_info, path, bytenr,
+			ret = __add_inline_refs(path, bytenr,
 						&info_level, &prefs,
 						ref_tree, &total_refs,
 						inum);
-- 
2.10.1


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

* [PATCH 24/29] btrfs: remove unused parameters from btrfs_cmp_data
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (22 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 23/29] btrfs: remove unused parameter from __add_inline_refs David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-14 19:40   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 25/29] btrfs: remove unused parameter from clone_copy_inline_extent David Sterba
                   ` (4 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

After the page locking has been reworked, we get all pages prepared via
cmp_pages.

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

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 91188a2ac5a1..1f13f8416d29 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3053,8 +3053,7 @@ static int btrfs_cmp_data_prepare(struct inode *src, u64 loff,
 	return 0;
 }
 
-static int btrfs_cmp_data(struct inode *src, u64 loff, struct inode *dst,
-			  u64 dst_loff, u64 len, struct cmp_pages *cmp)
+static int btrfs_cmp_data(u64 len, struct cmp_pages *cmp)
 {
 	int ret = 0;
 	int i;
@@ -3221,7 +3220,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
 	}
 
 	/* pass original length for comparison so we stay within i_size */
-	ret = btrfs_cmp_data(src, loff, dst, dst_loff, olen, &cmp);
+	ret = btrfs_cmp_data(olen, &cmp);
 	if (ret == 0)
 		ret = btrfs_clone(src, dst, loff, olen, len, dst_loff, 1);
 
-- 
2.10.1


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

* [PATCH 25/29] btrfs: remove unused parameter from clone_copy_inline_extent
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (23 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 24/29] btrfs: remove unused parameters from btrfs_cmp_data David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-16  0:10   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 26/29] btrfs: remove unused parameter from __add_inode_ref David Sterba
                   ` (3 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used.

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

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 1f13f8416d29..b9e6f8a4f760 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -3383,8 +3383,7 @@ static void clone_update_extent_map(struct inode *inode,
  * data into the destination inode's inline extent if the later is greater then
  * the former.
  */
-static int clone_copy_inline_extent(struct inode *src,
-				    struct inode *dst,
+static int clone_copy_inline_extent(struct inode *dst,
 				    struct btrfs_trans_handle *trans,
 				    struct btrfs_path *path,
 				    struct btrfs_key *new_key,
@@ -3763,7 +3762,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
 				size -= skip + trim;
 				datal -= skip + trim;
 
-				ret = clone_copy_inline_extent(src, inode,
+				ret = clone_copy_inline_extent(inode,
 							       trans, path,
 							       &new_key,
 							       drop_start,
-- 
2.10.1


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

* [PATCH 26/29] btrfs: remove unused parameter from __add_inode_ref
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (24 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 25/29] btrfs: remove unused parameter from clone_copy_inline_extent David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-16  0:08   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 27/29] btrfs: remove unused parameter from cleanup_write_cache_enospc David Sterba
                   ` (2 subsequent siblings)
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Unused since the helper has been split, eb used in the caller.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/tree-log.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 62dd138018b5..3806853cde08 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -994,7 +994,6 @@ static inline int __add_inode_ref(struct btrfs_trans_handle *trans,
 				  struct btrfs_root *log_root,
 				  struct btrfs_inode *dir,
 				  struct btrfs_inode *inode,
-				  struct extent_buffer *eb,
 				  u64 inode_objectid, u64 parent_objectid,
 				  u64 ref_index, char *name, int namelen,
 				  int *search_done)
@@ -1310,7 +1309,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
 			if (!search_done) {
 				ret = __add_inode_ref(trans, root, path, log,
 						      BTRFS_I(dir),
-						      BTRFS_I(inode), eb,
+						      BTRFS_I(inode),
 						      inode_objectid,
 						      parent_objectid,
 						      ref_index, name, namelen,
-- 
2.10.1


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

* [PATCH 27/29] btrfs: remove unused parameter from cleanup_write_cache_enospc
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (25 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 26/29] btrfs: remove unused parameter from __add_inode_ref David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-15 21:33   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 28/29] btrfs: remove unused parameters from __btrfs_write_out_cache David Sterba
  2017-02-13  9:34 ` [PATCH 29/29] btrfs: remove unused parameter from adjust_slots_upwards David Sterba
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

bitmap_list is unused since the io_ctl framework.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/free-space-cache.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 437580e84d9d..0d02599d22bc 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1128,8 +1128,7 @@ cleanup_bitmap_list(struct list_head *bitmap_list)
 static void noinline_for_stack
 cleanup_write_cache_enospc(struct inode *inode,
 			   struct btrfs_io_ctl *io_ctl,
-			   struct extent_state **cached_state,
-			   struct list_head *bitmap_list)
+			   struct extent_state **cached_state)
 {
 	io_ctl_drop_pages(io_ctl);
 	unlock_extent_cached(&BTRFS_I(inode)->io_tree, 0,
@@ -1365,7 +1364,7 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
 	mutex_unlock(&ctl->cache_writeout_mutex);
 
 out_nospc:
-	cleanup_write_cache_enospc(inode, io_ctl, &cached_state, &bitmap_list);
+	cleanup_write_cache_enospc(inode, io_ctl, &cached_state);
 
 	if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA))
 		up_write(&block_group->data_rwsem);
-- 
2.10.1


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

* [PATCH 28/29] btrfs: remove unused parameters from __btrfs_write_out_cache
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (26 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 27/29] btrfs: remove unused parameter from cleanup_write_cache_enospc David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-14 20:19   ` Liu Bo
  2017-02-13  9:34 ` [PATCH 29/29] btrfs: remove unused parameter from adjust_slots_upwards David Sterba
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Both unused after the call to update_cache_item has been moved to
__btrfs_wait_cache_io.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/free-space-cache.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 0d02599d22bc..c169acef2a23 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1224,8 +1224,6 @@ int btrfs_wait_cache_io(struct btrfs_trans_handle *trans,
  * @ctl - the free space cache we are going to write out
  * @block_group - the block_group for this cache if it belongs to a block_group
  * @trans - the trans handle
- * @path - the path to use
- * @offset - the offset for the key we'll insert
  *
  * This function writes out a free space cache struct to disk for quick recovery
  * on mount.  This will return 0 if it was successful in writing the cache out,
@@ -1235,8 +1233,7 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
 				   struct btrfs_free_space_ctl *ctl,
 				   struct btrfs_block_group_cache *block_group,
 				   struct btrfs_io_ctl *io_ctl,
-				   struct btrfs_trans_handle *trans,
-				   struct btrfs_path *path, u64 offset)
+				   struct btrfs_trans_handle *trans)
 {
 	struct btrfs_fs_info *fs_info = root->fs_info;
 	struct extent_state *cached_state = NULL;
@@ -1394,8 +1391,7 @@ int btrfs_write_out_cache(struct btrfs_fs_info *fs_info,
 		return 0;
 
 	ret = __btrfs_write_out_cache(root, inode, ctl, block_group,
-				      &block_group->io_ctl, trans,
-				      path, block_group->key.objectid);
+				      &block_group->io_ctl, trans);
 	if (ret) {
 #ifdef DEBUG
 		btrfs_err(fs_info,
@@ -3542,8 +3538,7 @@ int btrfs_write_out_ino_cache(struct btrfs_root *root,
 		return 0;
 
 	memset(&io_ctl, 0, sizeof(io_ctl));
-	ret = __btrfs_write_out_cache(root, inode, ctl, NULL, &io_ctl,
-				      trans, path, 0);
+	ret = __btrfs_write_out_cache(root, inode, ctl, NULL, &io_ctl, trans);
 	if (!ret) {
 		/*
 		 * At this point writepages() didn't error out, so our metadata
-- 
2.10.1


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

* [PATCH 29/29] btrfs: remove unused parameter from adjust_slots_upwards
  2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
                   ` (27 preceding siblings ...)
  2017-02-13  9:34 ` [PATCH 28/29] btrfs: remove unused parameters from __btrfs_write_out_cache David Sterba
@ 2017-02-13  9:34 ` David Sterba
  2017-02-16  0:12   ` Liu Bo
  28 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-13  9:34 UTC (permalink / raw)
  To: linux-btrfs; +Cc: David Sterba

Never used.

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

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 6d106e623604..4ef513a392a7 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -1589,8 +1589,7 @@ int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
  * If we increment the root nodes slot counter past the number of
  * elements, 1 is returned to signal completion of the search.
  */
-static int adjust_slots_upwards(struct btrfs_root *root,
-				struct btrfs_path *path, int root_level)
+static int adjust_slots_upwards(struct btrfs_path *path, int root_level)
 {
 	int level = 0;
 	int nr, slot;
@@ -1731,7 +1730,7 @@ int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
 				goto out;
 
 			/* Nonzero return here means we completed our search */
-			ret = adjust_slots_upwards(root, path, root_level);
+			ret = adjust_slots_upwards(path, root_level);
 			if (ret)
 				break;
 
-- 
2.10.1


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

* Re: [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search
  2017-02-13  9:33 ` [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search David Sterba
@ 2017-02-14  0:59   ` Liu Bo
  2017-02-14  1:03     ` Qu Wenruo
  0 siblings, 1 reply; 66+ messages in thread
From: Liu Bo @ 2017-02-14  0:59 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:24AM +0100, David Sterba wrote:
> Never used in that function.

There is already one,
https://patchwork.kernel.org/patch/9546079/

Thanks,

-liubo
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index fbeff20eb194..35e22349c139 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -2440,7 +2440,7 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
>  static int
>  read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
>  		      struct extent_buffer **eb_ret, int level, int slot,
> -		      const struct btrfs_key *key, u64 time_seq)
> +		      const struct btrfs_key *key)
>  {
>  	struct btrfs_fs_info *fs_info = root->fs_info;
>  	u64 blocknr;
> @@ -2871,7 +2871,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>  			}
>  
>  			err = read_block_for_search(root, p, &b, level,
> -						    slot, key, 0);
> +						    slot, key);
>  			if (err == -EAGAIN)
>  				goto again;
>  			if (err) {
> @@ -3015,7 +3015,7 @@ int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,
>  			}
>  
>  			err = read_block_for_search(root, p, &b, level,
> -						    slot, key, time_seq);
> +						    slot, key);
>  			if (err == -EAGAIN)
>  				goto again;
>  			if (err) {
> @@ -5786,7 +5786,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
>  		next = c;
>  		next_rw_lock = path->locks[level];
>  		ret = read_block_for_search(root, path, &next, level,
> -					    slot, &key, 0);
> +					    slot, &key);
>  		if (ret == -EAGAIN)
>  			goto again;
>  
> @@ -5836,7 +5836,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
>  			break;
>  
>  		ret = read_block_for_search(root, path, &next, level,
> -					    0, &key, 0);
> +					    0, &key);
>  		if (ret == -EAGAIN)
>  			goto again;
>  
> -- 
> 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

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

* Re: [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search
  2017-02-14  0:59   ` Liu Bo
@ 2017-02-14  1:03     ` Qu Wenruo
  2017-02-14  1:09       ` Liu Bo
  0 siblings, 1 reply; 66+ messages in thread
From: Qu Wenruo @ 2017-02-14  1:03 UTC (permalink / raw)
  To: bo.li.liu, David Sterba; +Cc: linux-btrfs



At 02/14/2017 08:59 AM, Liu Bo wrote:
> On Mon, Feb 13, 2017 at 10:33:24AM +0100, David Sterba wrote:
>> Never used in that function.
>
> There is already one,
> https://patchwork.kernel.org/patch/9546079/

Hi Liu,

That patch seems to remove @trans, while this is to remove @time_seq.
Or did I missed something?

Thanks,
Qu
>
> Thanks,
>
> -liubo
>>
>> Signed-off-by: David Sterba <dsterba@suse.com>
>> ---
>>  fs/btrfs/ctree.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
>> index fbeff20eb194..35e22349c139 100644
>> --- a/fs/btrfs/ctree.c
>> +++ b/fs/btrfs/ctree.c
>> @@ -2440,7 +2440,7 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
>>  static int
>>  read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
>>  		      struct extent_buffer **eb_ret, int level, int slot,
>> -		      const struct btrfs_key *key, u64 time_seq)
>> +		      const struct btrfs_key *key)
>>  {
>>  	struct btrfs_fs_info *fs_info = root->fs_info;
>>  	u64 blocknr;
>> @@ -2871,7 +2871,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>>  			}
>>
>>  			err = read_block_for_search(root, p, &b, level,
>> -						    slot, key, 0);
>> +						    slot, key);
>>  			if (err == -EAGAIN)
>>  				goto again;
>>  			if (err) {
>> @@ -3015,7 +3015,7 @@ int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,
>>  			}
>>
>>  			err = read_block_for_search(root, p, &b, level,
>> -						    slot, key, time_seq);
>> +						    slot, key);
>>  			if (err == -EAGAIN)
>>  				goto again;
>>  			if (err) {
>> @@ -5786,7 +5786,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
>>  		next = c;
>>  		next_rw_lock = path->locks[level];
>>  		ret = read_block_for_search(root, path, &next, level,
>> -					    slot, &key, 0);
>> +					    slot, &key);
>>  		if (ret == -EAGAIN)
>>  			goto again;
>>
>> @@ -5836,7 +5836,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
>>  			break;
>>
>>  		ret = read_block_for_search(root, path, &next, level,
>> -					    0, &key, 0);
>> +					    0, &key);
>>  		if (ret == -EAGAIN)
>>  			goto again;
>>
>> --
>> 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
>
>



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

* Re: [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search
  2017-02-14  1:03     ` Qu Wenruo
@ 2017-02-14  1:09       ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-14  1:09 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: David Sterba, linux-btrfs

On Tue, Feb 14, 2017 at 09:03:49AM +0800, Qu Wenruo wrote:
> 
> 
> At 02/14/2017 08:59 AM, Liu Bo wrote:
> > On Mon, Feb 13, 2017 at 10:33:24AM +0100, David Sterba wrote:
> > > Never used in that function.
> > 
> > There is already one,
> > https://patchwork.kernel.org/patch/9546079/
> 
> Hi Liu,
> 
> That patch seems to remove @trans, while this is to remove @time_seq.
> Or did I missed something?

Heh, my bad, thanks for spotting this.

Thanks,

-liubo
> 
> Thanks,
> Qu
> > 
> > Thanks,
> > 
> > -liubo
> > > 
> > > Signed-off-by: David Sterba <dsterba@suse.com>
> > > ---
> > >  fs/btrfs/ctree.c | 10 +++++-----
> > >  1 file changed, 5 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> > > index fbeff20eb194..35e22349c139 100644
> > > --- a/fs/btrfs/ctree.c
> > > +++ b/fs/btrfs/ctree.c
> > > @@ -2440,7 +2440,7 @@ noinline void btrfs_unlock_up_safe(struct btrfs_path *path, int level)
> > >  static int
> > >  read_block_for_search(struct btrfs_root *root, struct btrfs_path *p,
> > >  		      struct extent_buffer **eb_ret, int level, int slot,
> > > -		      const struct btrfs_key *key, u64 time_seq)
> > > +		      const struct btrfs_key *key)
> > >  {
> > >  	struct btrfs_fs_info *fs_info = root->fs_info;
> > >  	u64 blocknr;
> > > @@ -2871,7 +2871,7 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root *root,
> > >  			}
> > > 
> > >  			err = read_block_for_search(root, p, &b, level,
> > > -						    slot, key, 0);
> > > +						    slot, key);
> > >  			if (err == -EAGAIN)
> > >  				goto again;
> > >  			if (err) {
> > > @@ -3015,7 +3015,7 @@ int btrfs_search_old_slot(struct btrfs_root *root, const struct btrfs_key *key,
> > >  			}
> > > 
> > >  			err = read_block_for_search(root, p, &b, level,
> > > -						    slot, key, time_seq);
> > > +						    slot, key);
> > >  			if (err == -EAGAIN)
> > >  				goto again;
> > >  			if (err) {
> > > @@ -5786,7 +5786,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
> > >  		next = c;
> > >  		next_rw_lock = path->locks[level];
> > >  		ret = read_block_for_search(root, path, &next, level,
> > > -					    slot, &key, 0);
> > > +					    slot, &key);
> > >  		if (ret == -EAGAIN)
> > >  			goto again;
> > > 
> > > @@ -5836,7 +5836,7 @@ int btrfs_next_old_leaf(struct btrfs_root *root, struct btrfs_path *path,
> > >  			break;
> > > 
> > >  		ret = read_block_for_search(root, path, &next, level,
> > > -					    0, &key, 0);
> > > +					    0, &key);
> > >  		if (ret == -EAGAIN)
> > >  			goto again;
> > > 
> > > --
> > > 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
> > 
> > 
> 
> 

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

* Re: [PATCH 05/29] btrfs: remove unused parameter from write_dev_supers
  2017-02-13  9:33 ` [PATCH 05/29] btrfs: remove unused parameter from write_dev_supers David Sterba
@ 2017-02-14  1:59   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-14  1:59 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:36AM +0100, David Sterba wrote:
> The barriers are handled by the caller.
>

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

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/disk-io.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 48846d215e97..43e71457c193 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3410,7 +3410,7 @@ struct buffer_head *btrfs_read_dev_super(struct block_device *bdev)
>   */
>  static int write_dev_supers(struct btrfs_device *device,
>  			    struct btrfs_super_block *sb,
> -			    int do_barriers, int wait, int max_mirrors)
> +			    int wait, int max_mirrors)
>  {
>  	struct buffer_head *bh;
>  	int i;
> @@ -3752,7 +3752,7 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
>  		flags = btrfs_super_flags(sb);
>  		btrfs_set_super_flags(sb, flags | BTRFS_HEADER_FLAG_WRITTEN);
>  
> -		ret = write_dev_supers(dev, sb, do_barriers, 0, max_mirrors);
> +		ret = write_dev_supers(dev, sb, 0, max_mirrors);
>  		if (ret)
>  			total_errors++;
>  	}
> @@ -3775,7 +3775,7 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
>  		if (!dev->in_fs_metadata || !dev->writeable)
>  			continue;
>  
> -		ret = write_dev_supers(dev, sb, do_barriers, 1, max_mirrors);
> +		ret = write_dev_supers(dev, sb, 1, max_mirrors);
>  		if (ret)
>  			total_errors++;
>  	}
> -- 
> 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

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

* Re: [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid
  2017-02-13  9:33 ` [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid David Sterba
@ 2017-02-14  2:11   ` Liu Bo
  2017-02-14 11:42     ` David Sterba
  0 siblings, 1 reply; 66+ messages in thread
From: Liu Bo @ 2017-02-14  2:11 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:55AM +0100, David Sterba wrote:
> None of the checks need to know the RO/RW status.
>

OK...there was a readonly check, which lets us skip all checks,
it was removed by the below commit, should we add the check back?

commit 1104a8855109a4051d74977f819a13b4516aa11e
Author: David Sterba <dsterba@suse.cz>
Date:   Wed Mar 6 15:57:46 2013 +0100

btrfs: enhance superblock checks

The superblock checksum is not verified upon mount. <awkward silence>

Add that check and also reorder existing checks to a more logical
order.

Current mkfs.btrfs does not calculate the correct checksum of
super_block and thus a freshly created filesytem will fail to mount when
this patch is applied.

First transaction commit calculates correct superblock checksum and
saves it to disk.

Reproducer:
$ mfks.btrfs /dev/sda
$ mount /dev/sda /mnt
$ btrfs scrub start /mnt
$ sleep 5
$ btrfs scrub status /mnt
... super:2 ...

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>

Thanks,

-liubo

> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/disk-io.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 441a62cd0351..2b06f557c176 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -64,8 +64,7 @@
>  static const struct extent_io_ops btree_extent_io_ops;
>  static void end_workqueue_fn(struct btrfs_work *work);
>  static void free_fs_root(struct btrfs_root *root);
> -static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
> -				    int read_only);
> +static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info);
>  static void btrfs_destroy_ordered_extents(struct btrfs_root *root);
>  static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
>  				      struct btrfs_fs_info *fs_info);
> @@ -2801,7 +2800,7 @@ int open_ctree(struct super_block *sb,
>  
>  	memcpy(fs_info->fsid, fs_info->super_copy->fsid, BTRFS_FSID_SIZE);
>  
> -	ret = btrfs_check_super_valid(fs_info, sb->s_flags & MS_RDONLY);
> +	ret = btrfs_check_super_valid(fs_info);
>  	if (ret) {
>  		btrfs_err(fs_info, "superblock contains fatal errors");
>  		err = -EINVAL;
> @@ -4115,8 +4114,7 @@ int btrfs_read_buffer(struct extent_buffer *buf, u64 parent_transid)
>  	return btree_read_extent_buffer_pages(fs_info, buf, parent_transid);
>  }
>  
> -static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
> -			      int read_only)
> +static int btrfs_check_super_valid(struct btrfs_fs_info *fs_info)
>  {
>  	struct btrfs_super_block *sb = fs_info->super_copy;
>  	u64 nodesize = btrfs_super_nodesize(sb);
> -- 
> 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

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

* Re: [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid
  2017-02-14  2:11   ` Liu Bo
@ 2017-02-14 11:42     ` David Sterba
  2017-02-14 18:44       ` Liu Bo
  0 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-14 11:42 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 06:11:56PM -0800, Liu Bo wrote:
> On Mon, Feb 13, 2017 at 10:33:55AM +0100, David Sterba wrote:
> > None of the checks need to know the RO/RW status.
> >
> 
> OK...there was a readonly check, which lets us skip all checks,
> it was removed by the below commit, should we add the check back?

All the current checks do not modify the superblock, so it's read-only
and we can keep it as-is. The superblock is available from inside the
function anyway so we don't need to check sb_flags externally. I'll
update the changelog.

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

* Re: [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid
  2017-02-14 11:42     ` David Sterba
@ 2017-02-14 18:44       ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-14 18:44 UTC (permalink / raw)
  To: dsterba, linux-btrfs

On Tue, Feb 14, 2017 at 12:42:07PM +0100, David Sterba wrote:
> On Mon, Feb 13, 2017 at 06:11:56PM -0800, Liu Bo wrote:
> > On Mon, Feb 13, 2017 at 10:33:55AM +0100, David Sterba wrote:
> > > None of the checks need to know the RO/RW status.
> > >
> > 
> > OK...there was a readonly check, which lets us skip all checks,
> > it was removed by the below commit, should we add the check back?
> 
> All the current checks do not modify the superblock, so it's read-only
> and we can keep it as-is. The superblock is available from inside the
> function anyway so we don't need to check sb_flags externally. I'll
> update the changelog.
Yes, this makes sense.

Thanks,

-liubo

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

* Re: [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page
  2017-02-13  9:34 ` [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page David Sterba
@ 2017-02-14 19:10   ` Liu Bo
  2017-02-15 15:17     ` David Sterba
  0 siblings, 1 reply; 66+ messages in thread
From: Liu Bo @ 2017-02-14 19:10 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

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

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

* Re: [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages
  2017-02-13  9:34 ` [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages David Sterba
@ 2017-02-14 19:35   ` Liu Bo
  2017-02-15 15:30     ` David Sterba
  0 siblings, 1 reply; 66+ messages in thread
From: Liu Bo @ 2017-02-14 19:35 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:13AM +0100, David Sterba wrote:
> The 'tree' was used to call locking hook that does not exist anymore.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/extent_io.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index f683fa5a4b91..22a2f2fa62c7 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3916,8 +3916,7 @@ int btree_write_cache_pages(struct address_space *mapping,
>   * WB_SYNC_ALL then we were called for data integrity and we must wait for
>   * existing IO to complete.
>   */
> -static int extent_write_cache_pages(struct extent_io_tree *tree,
> -			     struct address_space *mapping,
> +static int extent_write_cache_pages(struct address_space *mapping,
>  			     struct writeback_control *wbc,
>  			     writepage_t writepage, void *data,
>  			     void (*flush_fn)(void *))
> @@ -4158,8 +4157,7 @@ int extent_writepages(struct extent_io_tree *tree,
>  		.bio_flags = 0,
>  	};
>  
> -	ret = extent_write_cache_pages(tree, mapping, wbc,
> -				       __extent_writepage, &epd,
> +	ret = extent_write_cache_pages(mapping, wbc, __extent_writepage, &epd,
>  				       flush_write_bio);

Are we going to leave {btrfs,extent}_{read,write}pages untouched?

Thanks,

-liubo

>  	flush_epd_write_bio(&epd);
>  	return ret;
> -- 
> 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

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

* Re: [PATCH 21/29] btrfs: remove unused parameter from create_snapshot
  2017-02-13  9:34 ` [PATCH 21/29] btrfs: remove unused parameter from create_snapshot David Sterba
@ 2017-02-14 19:36   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-14 19:36 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:26AM +0100, David Sterba wrote:
> The name parameters have never been used, as the name is passed via the
> dentry.
>

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

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ioctl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index e8c7c313c113..91188a2ac5a1 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -656,7 +656,7 @@ static void btrfs_wait_for_no_snapshoting_writes(struct btrfs_root *root)
>  }
>  
>  static int create_snapshot(struct btrfs_root *root, struct inode *dir,
> -			   struct dentry *dentry, char *name, int namelen,
> +			   struct dentry *dentry,
>  			   u64 *async_transid, bool readonly,
>  			   struct btrfs_qgroup_inherit *inherit)
>  {
> @@ -871,7 +871,7 @@ static noinline int btrfs_mksubvol(const struct path *parent,
>  		goto out_up_read;
>  
>  	if (snap_src) {
> -		error = create_snapshot(snap_src, dir, dentry, name, namelen,
> +		error = create_snapshot(snap_src, dir, dentry,
>  					async_transid, readonly, inherit);
>  	} else {
>  		error = create_subvol(dir, dentry, name, namelen,
> -- 
> 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

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

* Re: [PATCH 24/29] btrfs: remove unused parameters from btrfs_cmp_data
  2017-02-13  9:34 ` [PATCH 24/29] btrfs: remove unused parameters from btrfs_cmp_data David Sterba
@ 2017-02-14 19:40   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-14 19:40 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:35AM +0100, David Sterba wrote:
> After the page locking has been reworked, we get all pages prepared via
> cmp_pages.
>

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

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ioctl.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 91188a2ac5a1..1f13f8416d29 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -3053,8 +3053,7 @@ static int btrfs_cmp_data_prepare(struct inode *src, u64 loff,
>  	return 0;
>  }
>  
> -static int btrfs_cmp_data(struct inode *src, u64 loff, struct inode *dst,
> -			  u64 dst_loff, u64 len, struct cmp_pages *cmp)
> +static int btrfs_cmp_data(u64 len, struct cmp_pages *cmp)
>  {
>  	int ret = 0;
>  	int i;
> @@ -3221,7 +3220,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
>  	}
>  
>  	/* pass original length for comparison so we stay within i_size */
> -	ret = btrfs_cmp_data(src, loff, dst, dst_loff, olen, &cmp);
> +	ret = btrfs_cmp_data(olen, &cmp);
>  	if (ret == 0)
>  		ret = btrfs_clone(src, dst, loff, olen, len, dst_loff, 1);
>  
> -- 
> 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

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

* Re: [PATCH 28/29] btrfs: remove unused parameters from __btrfs_write_out_cache
  2017-02-13  9:34 ` [PATCH 28/29] btrfs: remove unused parameters from __btrfs_write_out_cache David Sterba
@ 2017-02-14 20:19   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-14 20:19 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:47AM +0100, David Sterba wrote:
> Both unused after the call to update_cache_item has been moved to
> __btrfs_wait_cache_io.
> 

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

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/free-space-cache.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> index 0d02599d22bc..c169acef2a23 100644
> --- a/fs/btrfs/free-space-cache.c
> +++ b/fs/btrfs/free-space-cache.c
> @@ -1224,8 +1224,6 @@ int btrfs_wait_cache_io(struct btrfs_trans_handle *trans,
>   * @ctl - the free space cache we are going to write out
>   * @block_group - the block_group for this cache if it belongs to a block_group
>   * @trans - the trans handle
> - * @path - the path to use
> - * @offset - the offset for the key we'll insert
>   *
>   * This function writes out a free space cache struct to disk for quick recovery
>   * on mount.  This will return 0 if it was successful in writing the cache out,
> @@ -1235,8 +1233,7 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
>  				   struct btrfs_free_space_ctl *ctl,
>  				   struct btrfs_block_group_cache *block_group,
>  				   struct btrfs_io_ctl *io_ctl,
> -				   struct btrfs_trans_handle *trans,
> -				   struct btrfs_path *path, u64 offset)
> +				   struct btrfs_trans_handle *trans)
>  {
>  	struct btrfs_fs_info *fs_info = root->fs_info;
>  	struct extent_state *cached_state = NULL;
> @@ -1394,8 +1391,7 @@ int btrfs_write_out_cache(struct btrfs_fs_info *fs_info,
>  		return 0;
>  
>  	ret = __btrfs_write_out_cache(root, inode, ctl, block_group,
> -				      &block_group->io_ctl, trans,
> -				      path, block_group->key.objectid);
> +				      &block_group->io_ctl, trans);
>  	if (ret) {
>  #ifdef DEBUG
>  		btrfs_err(fs_info,
> @@ -3542,8 +3538,7 @@ int btrfs_write_out_ino_cache(struct btrfs_root *root,
>  		return 0;
>  
>  	memset(&io_ctl, 0, sizeof(io_ctl));
> -	ret = __btrfs_write_out_cache(root, inode, ctl, NULL, &io_ctl,
> -				      trans, path, 0);
> +	ret = __btrfs_write_out_cache(root, inode, ctl, NULL, &io_ctl, trans);
>  	if (!ret) {
>  		/*
>  		 * At this point writepages() didn't error out, so our metadata
> -- 
> 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

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

* Re: [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page
  2017-02-14 19:10   ` Liu Bo
@ 2017-02-15 15:17     ` David Sterba
  0 siblings, 0 replies; 66+ messages in thread
From: David Sterba @ 2017-02-15 15:17 UTC (permalink / raw)
  To: Liu Bo; +Cc: David Sterba, linux-btrfs

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;

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

* Re: [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages
  2017-02-14 19:35   ` Liu Bo
@ 2017-02-15 15:30     ` David Sterba
  2017-02-15 20:38       ` Liu Bo
  0 siblings, 1 reply; 66+ messages in thread
From: David Sterba @ 2017-02-15 15:30 UTC (permalink / raw)
  To: Liu Bo; +Cc: David Sterba, linux-btrfs

On Tue, Feb 14, 2017 at 11:35:11AM -0800, Liu Bo wrote:
> On Mon, Feb 13, 2017 at 10:34:13AM +0100, David Sterba wrote:
> > The 'tree' was used to call locking hook that does not exist anymore.
> > 
> > Signed-off-by: David Sterba <dsterba@suse.com>
> > ---
> >  fs/btrfs/extent_io.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> > index f683fa5a4b91..22a2f2fa62c7 100644
> > --- a/fs/btrfs/extent_io.c
> > +++ b/fs/btrfs/extent_io.c
> > @@ -3916,8 +3916,7 @@ int btree_write_cache_pages(struct address_space *mapping,
> >   * WB_SYNC_ALL then we were called for data integrity and we must wait for
> >   * existing IO to complete.
> >   */
> > -static int extent_write_cache_pages(struct extent_io_tree *tree,
> > -			     struct address_space *mapping,
> > +static int extent_write_cache_pages(struct address_space *mapping,
> >  			     struct writeback_control *wbc,
> >  			     writepage_t writepage, void *data,
> >  			     void (*flush_fn)(void *))
> > @@ -4158,8 +4157,7 @@ int extent_writepages(struct extent_io_tree *tree,
> >  		.bio_flags = 0,
> >  	};
> >  
> > -	ret = extent_write_cache_pages(tree, mapping, wbc,
> > -				       __extent_writepage, &epd,
> > +	ret = extent_write_cache_pages(mapping, wbc, __extent_writepage, &epd,
> >  				       flush_write_bio);
> 
> Are we going to leave {btrfs,extent}_{read,write}pages untouched?

Yes, because extent_writepages uses 'tree', it's stored in the
extent_page_data, and some if not all callbacks do utilize it.

4140 int extent_writepages(struct extent_io_tree *tree,
4141                       struct address_space *mapping,
4142                       get_extent_t *get_extent,
4143                       struct writeback_control *wbc)
4144 {
4145         int ret = 0;
4146         struct extent_page_data epd = {
4147                 .bio = NULL,
4148                 .tree = tree,
^^^^
4149                 .get_extent = get_extent,
4150                 .extent_locked = 0,
4151                 .sync_io = wbc->sync_mode == WB_SYNC_ALL,
4152                 .bio_flags = 0,
4153         };

btrfs_readpages
  extent_readpages
    __extent_readpages
      __do_contiguous_readpages
	lock_extent

and btrfs_writepages calls extent_writepages.

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

* Re: [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages
  2017-02-15 15:30     ` David Sterba
@ 2017-02-15 20:38       ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 20:38 UTC (permalink / raw)
  To: dsterba, David Sterba, linux-btrfs

On Wed, Feb 15, 2017 at 04:30:46PM +0100, David Sterba wrote:
> On Tue, Feb 14, 2017 at 11:35:11AM -0800, Liu Bo wrote:
> > On Mon, Feb 13, 2017 at 10:34:13AM +0100, David Sterba wrote:
> > > The 'tree' was used to call locking hook that does not exist anymore.
> > > 
> > > Signed-off-by: David Sterba <dsterba@suse.com>
> > > ---
> > >  fs/btrfs/extent_io.c | 6 ++----
> > >  1 file changed, 2 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> > > index f683fa5a4b91..22a2f2fa62c7 100644
> > > --- a/fs/btrfs/extent_io.c
> > > +++ b/fs/btrfs/extent_io.c
> > > @@ -3916,8 +3916,7 @@ int btree_write_cache_pages(struct address_space *mapping,
> > >   * WB_SYNC_ALL then we were called for data integrity and we must wait for
> > >   * existing IO to complete.
> > >   */
> > > -static int extent_write_cache_pages(struct extent_io_tree *tree,
> > > -			     struct address_space *mapping,
> > > +static int extent_write_cache_pages(struct address_space *mapping,
> > >  			     struct writeback_control *wbc,
> > >  			     writepage_t writepage, void *data,
> > >  			     void (*flush_fn)(void *))
> > > @@ -4158,8 +4157,7 @@ int extent_writepages(struct extent_io_tree *tree,
> > >  		.bio_flags = 0,
> > >  	};
> > >  
> > > -	ret = extent_write_cache_pages(tree, mapping, wbc,
> > > -				       __extent_writepage, &epd,
> > > +	ret = extent_write_cache_pages(mapping, wbc, __extent_writepage, &epd,
> > >  				       flush_write_bio);
> > 
> > Are we going to leave {btrfs,extent}_{read,write}pages untouched?
> 
> Yes, because extent_writepages uses 'tree', it's stored in the
> extent_page_data, and some if not all callbacks do utilize it.
> 
> 4140 int extent_writepages(struct extent_io_tree *tree,
> 4141                       struct address_space *mapping,
> 4142                       get_extent_t *get_extent,
> 4143                       struct writeback_control *wbc)
> 4144 {
> 4145         int ret = 0;
> 4146         struct extent_page_data epd = {
> 4147                 .bio = NULL,
> 4148                 .tree = tree,
> ^^^^
> 4149                 .get_extent = get_extent,
> 4150                 .extent_locked = 0,
> 4151                 .sync_io = wbc->sync_mode == WB_SYNC_ALL,
> 4152                 .bio_flags = 0,
> 4153         };
> 
> btrfs_readpages
>   extent_readpages
>     __extent_readpages
>       __do_contiguous_readpages
> 	lock_extent
> 
> and btrfs_writepages calls extent_writepages.

OK, I see.

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

Thanks,

-liubo

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

* Re: [PATCH 02/29] btrfs: remove unused parameter from check_async_write
  2017-02-13  9:33 ` [PATCH 02/29] btrfs: remove unused parameter from check_async_write David Sterba
@ 2017-02-15 20:41   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 20:41 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:27AM +0100, David Sterba wrote:
> Added but never used.
>

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

> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/disk-io.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 18004169552c..89cd597883fd 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -1005,7 +1005,7 @@ static int __btree_submit_bio_done(struct inode *inode, struct bio *bio,
>  	return ret;
>  }
>  
> -static int check_async_write(struct inode *inode, unsigned long bio_flags)
> +static int check_async_write(unsigned long bio_flags)
>  {
>  	if (bio_flags & EXTENT_BIO_TREE_LOG)
>  		return 0;
> @@ -1021,7 +1021,7 @@ static int btree_submit_bio_hook(struct inode *inode, struct bio *bio,
>  				 u64 bio_offset)
>  {
>  	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
> -	int async = check_async_write(inode, bio_flags);
> +	int async = check_async_write(bio_flags);
>  	int ret;
>  
>  	if (bio_op(bio) != REQ_OP_WRITE) {
> -- 
> 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

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

* Re: [PATCH 04/29] btrfs: remove unused parameter from split_item
  2017-02-13  9:33 ` [PATCH 04/29] btrfs: remove unused parameter from split_item David Sterba
@ 2017-02-15 20:43   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 20:43 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:33AM +0100, David Sterba wrote:
> Never used.
> 

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

> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index d509dafdb20c..4c5d7c40c8bf 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -4413,8 +4413,7 @@ static noinline int setup_leaf_for_split(struct btrfs_trans_handle *trans,
>  	return ret;
>  }
>  
> -static noinline int split_item(struct btrfs_trans_handle *trans,
> -			       struct btrfs_fs_info *fs_info,
> +static noinline int split_item(struct btrfs_fs_info *fs_info,
>  			       struct btrfs_path *path,
>  			       const struct btrfs_key *new_key,
>  			       unsigned long split_offset)
> @@ -4511,7 +4510,7 @@ int btrfs_split_item(struct btrfs_trans_handle *trans,
>  	if (ret)
>  		return ret;
>  
> -	ret = split_item(trans, root->fs_info, path, new_key, split_offset);
> +	ret = split_item(root->fs_info, path, new_key, split_offset);
>  	return ret;
>  }
>  
> -- 
> 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
Thanks,

-liubo

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

* Re: [PATCH 06/29] btrfs: merge two superblock writing helpers
  2017-02-13  9:33 ` [PATCH 06/29] btrfs: merge two superblock writing helpers David Sterba
@ 2017-02-15 21:05   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:05 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:39AM +0100, David Sterba wrote:
> write_all_supers and write_ctree_super are almost equal, the parameter
> 'trans' is unused so we can drop it and have just one helper.

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

Thanks,

-liubo
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/disk-io.c     | 8 +-------
>  fs/btrfs/disk-io.h     | 3 +--
>  fs/btrfs/transaction.c | 2 +-
>  fs/btrfs/tree-log.c    | 2 +-
>  4 files changed, 4 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 43e71457c193..441a62cd0351 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -3695,7 +3695,7 @@ int btrfs_calc_num_tolerated_disk_barrier_failures(
>  	return num_tolerated_disk_barrier_failures;
>  }
>  
> -static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
> +int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
>  {
>  	struct list_head *head;
>  	struct btrfs_device *dev;
> @@ -3789,12 +3789,6 @@ static int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
>  	return 0;
>  }
>  
> -int write_ctree_super(struct btrfs_trans_handle *trans,
> -		      struct btrfs_fs_info *fs_info, int max_mirrors)
> -{
> -	return write_all_supers(fs_info, max_mirrors);
> -}
> -
>  /* Drop a fs root from the radix tree and free it. */
>  void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
>  				  struct btrfs_root *root)
> diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
> index 1864e7ce9c70..0be2d4fe705b 100644
> --- a/fs/btrfs/disk-io.h
> +++ b/fs/btrfs/disk-io.h
> @@ -57,8 +57,7 @@ int open_ctree(struct super_block *sb,
>  	       struct btrfs_fs_devices *fs_devices,
>  	       char *options);
>  void close_ctree(struct btrfs_fs_info *fs_info);
> -int write_ctree_super(struct btrfs_trans_handle *trans,
> -		      struct btrfs_fs_info *fs_info, int max_mirrors);
> +int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors);
>  struct buffer_head *btrfs_read_dev_super(struct block_device *bdev);
>  int btrfs_read_dev_one_super(struct block_device *bdev, int copy_num,
>  			struct buffer_head **bh_ret);
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 48aabb367f73..7d1d71259cd0 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -2261,7 +2261,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
>  		goto scrub_continue;
>  	}
>  
> -	ret = write_ctree_super(trans, fs_info, 0);
> +	ret = write_all_supers(fs_info, 0);
>  	if (ret) {
>  		mutex_unlock(&fs_info->tree_log_mutex);
>  		goto scrub_continue;
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index cea93ba1f099..62dd138018b5 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -2961,7 +2961,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
>  	 * the running transaction open, so a full commit can't hop
>  	 * in and cause problems either.
>  	 */
> -	ret = write_ctree_super(trans, fs_info, 1);
> +	ret = write_all_supers(fs_info, 1);
>  	if (ret) {
>  		btrfs_set_log_full_commit(fs_info, trans);
>  		btrfs_abort_transaction(trans, ret);
> -- 
> 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

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

* Re: [PATCH 03/29] btrfs: remove unused parameter from clean_tree_block
  2017-02-13  9:33 ` [PATCH 03/29] btrfs: remove unused parameter from clean_tree_block David Sterba
@ 2017-02-15 21:12   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:12 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:30AM +0100, David Sterba wrote:
> Added but never needed.

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

Thanks,

-liubo
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.c           | 16 ++++++++--------
>  fs/btrfs/disk-io.c         |  3 +--
>  fs/btrfs/disk-io.h         |  3 +--
>  fs/btrfs/extent-tree.c     |  4 ++--
>  fs/btrfs/free-space-tree.c |  2 +-
>  fs/btrfs/qgroup.c          |  2 +-
>  fs/btrfs/tree-log.c        |  6 +++---
>  7 files changed, 17 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index 35e22349c139..d509dafdb20c 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -1074,7 +1074,7 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans,
>  			ret = btrfs_dec_ref(trans, root, buf, 1);
>  			BUG_ON(ret); /* -ENOMEM */
>  		}
> -		clean_tree_block(trans, fs_info, buf);
> +		clean_tree_block(fs_info, buf);
>  		*last_ref = 1;
>  	}
>  	return 0;
> @@ -1938,7 +1938,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
>  
>  		path->locks[level] = 0;
>  		path->nodes[level] = NULL;
> -		clean_tree_block(trans, fs_info, mid);
> +		clean_tree_block(fs_info, mid);
>  		btrfs_tree_unlock(mid);
>  		/* once for the path */
>  		free_extent_buffer(mid);
> @@ -1999,7 +1999,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
>  		if (wret < 0 && wret != -ENOSPC)
>  			ret = wret;
>  		if (btrfs_header_nritems(right) == 0) {
> -			clean_tree_block(trans, fs_info, right);
> +			clean_tree_block(fs_info, right);
>  			btrfs_tree_unlock(right);
>  			del_ptr(root, path, level + 1, pslot + 1);
>  			root_sub_used(root, right->len);
> @@ -2043,7 +2043,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
>  		BUG_ON(wret == 1);
>  	}
>  	if (btrfs_header_nritems(mid) == 0) {
> -		clean_tree_block(trans, fs_info, mid);
> +		clean_tree_block(fs_info, mid);
>  		btrfs_tree_unlock(mid);
>  		del_ptr(root, path, level + 1, pslot);
>  		root_sub_used(root, mid->len);
> @@ -3705,7 +3705,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
>  	if (left_nritems)
>  		btrfs_mark_buffer_dirty(left);
>  	else
> -		clean_tree_block(trans, fs_info, left);
> +		clean_tree_block(fs_info, left);
>  
>  	btrfs_mark_buffer_dirty(right);
>  
> @@ -3717,7 +3717,7 @@ static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
>  	if (path->slots[0] >= left_nritems) {
>  		path->slots[0] -= left_nritems;
>  		if (btrfs_header_nritems(path->nodes[0]) == 0)
> -			clean_tree_block(trans, fs_info, path->nodes[0]);
> +			clean_tree_block(fs_info, path->nodes[0]);
>  		btrfs_tree_unlock(path->nodes[0]);
>  		free_extent_buffer(path->nodes[0]);
>  		path->nodes[0] = right;
> @@ -3946,7 +3946,7 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
>  	if (right_nritems)
>  		btrfs_mark_buffer_dirty(right);
>  	else
> -		clean_tree_block(trans, fs_info, right);
> +		clean_tree_block(fs_info, right);
>  
>  	btrfs_item_key(right, &disk_key, 0);
>  	fixup_low_keys(fs_info, path, &disk_key, 1);
> @@ -5009,7 +5009,7 @@ int btrfs_del_items(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>  			btrfs_set_header_level(leaf, 0);
>  		} else {
>  			btrfs_set_path_blocking(path);
> -			clean_tree_block(trans, fs_info, leaf);
> +			clean_tree_block(fs_info, leaf);
>  			btrfs_del_leaf(trans, root, path, leaf);
>  		}
>  	} else {
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index 89cd597883fd..48846d215e97 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -1248,8 +1248,7 @@ struct extent_buffer *read_tree_block(struct btrfs_fs_info *fs_info, u64 bytenr,
>  
>  }
>  
> -void clean_tree_block(struct btrfs_trans_handle *trans,
> -		      struct btrfs_fs_info *fs_info,
> +void clean_tree_block(struct btrfs_fs_info *fs_info,
>  		      struct extent_buffer *buf)
>  {
>  	if (btrfs_header_generation(buf) ==
> diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
> index 44dcd9af6b7c..1864e7ce9c70 100644
> --- a/fs/btrfs/disk-io.h
> +++ b/fs/btrfs/disk-io.h
> @@ -52,8 +52,7 @@ int reada_tree_block_flagged(struct btrfs_fs_info *fs_info, u64 bytenr,
>  struct extent_buffer *btrfs_find_create_tree_block(
>  						struct btrfs_fs_info *fs_info,
>  						u64 bytenr);
> -void clean_tree_block(struct btrfs_trans_handle *trans,
> -		      struct btrfs_fs_info *fs_info, struct extent_buffer *buf);
> +void clean_tree_block(struct btrfs_fs_info *fs_info, struct extent_buffer *buf);
>  int open_ctree(struct super_block *sb,
>  	       struct btrfs_fs_devices *fs_devices,
>  	       char *options);
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 0992cd1393a6..9e8d6c2e7a64 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -8253,7 +8253,7 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>  	btrfs_set_header_generation(buf, trans->transid);
>  	btrfs_set_buffer_lockdep_class(root->root_key.objectid, buf, level);
>  	btrfs_tree_lock(buf);
> -	clean_tree_block(trans, fs_info, buf);
> +	clean_tree_block(fs_info, buf);
>  	clear_bit(EXTENT_BUFFER_STALE, &buf->bflags);
>  
>  	btrfs_set_lock_blocking(buf);
> @@ -8874,7 +8874,7 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
>  			btrfs_set_lock_blocking(eb);
>  			path->locks[level] = BTRFS_WRITE_LOCK_BLOCKING;
>  		}
> -		clean_tree_block(trans, fs_info, eb);
> +		clean_tree_block(fs_info, eb);
>  	}
>  
>  	if (eb == root->node) {
> diff --git a/fs/btrfs/free-space-tree.c b/fs/btrfs/free-space-tree.c
> index ff0c55337c2e..dd7fb22a955a 100644
> --- a/fs/btrfs/free-space-tree.c
> +++ b/fs/btrfs/free-space-tree.c
> @@ -1269,7 +1269,7 @@ int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info)
>  	list_del(&free_space_root->dirty_list);
>  
>  	btrfs_tree_lock(free_space_root->node);
> -	clean_tree_block(trans, fs_info, free_space_root->node);
> +	clean_tree_block(fs_info, free_space_root->node);
>  	btrfs_tree_unlock(free_space_root->node);
>  	btrfs_free_tree_block(trans, free_space_root, free_space_root->node,
>  			      0, 1);
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 8496dbf3f38b..6d106e623604 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -1019,7 +1019,7 @@ int btrfs_quota_disable(struct btrfs_trans_handle *trans,
>  	list_del(&quota_root->dirty_list);
>  
>  	btrfs_tree_lock(quota_root->node);
> -	clean_tree_block(trans, fs_info, quota_root->node);
> +	clean_tree_block(fs_info, quota_root->node);
>  	btrfs_tree_unlock(quota_root->node);
>  	btrfs_free_tree_block(trans, quota_root, quota_root->node, 0, 1);
>  
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index 010cf7685677..cea93ba1f099 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -2472,7 +2472,7 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans,
>  				if (trans) {
>  					btrfs_tree_lock(next);
>  					btrfs_set_lock_blocking(next);
> -					clean_tree_block(trans, fs_info, next);
> +					clean_tree_block(fs_info, next);
>  					btrfs_wait_tree_block_writeback(next);
>  					btrfs_tree_unlock(next);
>  				}
> @@ -2552,7 +2552,7 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans,
>  				if (trans) {
>  					btrfs_tree_lock(next);
>  					btrfs_set_lock_blocking(next);
> -					clean_tree_block(trans, fs_info, next);
> +					clean_tree_block(fs_info, next);
>  					btrfs_wait_tree_block_writeback(next);
>  					btrfs_tree_unlock(next);
>  				}
> @@ -2630,7 +2630,7 @@ static int walk_log_tree(struct btrfs_trans_handle *trans,
>  			if (trans) {
>  				btrfs_tree_lock(next);
>  				btrfs_set_lock_blocking(next);
> -				clean_tree_block(trans, fs_info, next);
> +				clean_tree_block(fs_info, next);
>  				btrfs_wait_tree_block_writeback(next);
>  				btrfs_tree_unlock(next);
>  			}
> -- 
> 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

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

* Re: [PATCH 07/29] btrfs: remove unused parameter from __push_leaf_right
  2017-02-13  9:33 ` [PATCH 07/29] btrfs: remove unused parameter from __push_leaf_right David Sterba
@ 2017-02-15 21:14   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:14 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:42AM +0100, David Sterba wrote:
> Unused since long ago.

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

Thanks,

-liubo
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index 4c5d7c40c8bf..2283f92b5484 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -3595,8 +3595,7 @@ noinline int btrfs_leaf_free_space(struct btrfs_fs_info *fs_info,
>   * min slot controls the lowest index we're willing to push to the
>   * right.  We'll push up to and including min_slot, but no lower
>   */
> -static noinline int __push_leaf_right(struct btrfs_trans_handle *trans,
> -				      struct btrfs_fs_info *fs_info,
> +static noinline int __push_leaf_right(struct btrfs_fs_info *fs_info,
>  				      struct btrfs_path *path,
>  				      int data_size, int empty,
>  				      struct extent_buffer *right,
> @@ -3810,7 +3809,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
>  		return 0;
>  	}
>  
> -	return __push_leaf_right(trans, fs_info, path, min_data_size, empty,
> +	return __push_leaf_right(fs_info, path, min_data_size, empty,
>  				right, free_space, left_nritems, min_slot);
>  out_unlock:
>  	btrfs_tree_unlock(right);
> -- 
> 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

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

* Re: [PATCH 09/29] btrfs: remove unused parameter from btrfs_subvolume_release_metadata
  2017-02-13  9:33 ` [PATCH 09/29] btrfs: remove unused parameter from btrfs_subvolume_release_metadata David Sterba
@ 2017-02-15 21:17   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:17 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:49AM +0100, David Sterba wrote:
> Unused since qgroup refactoring that split data and metadata accounting,
> the btrfs_qgroup_free helper.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.h       |  3 +--
>  fs/btrfs/extent-tree.c |  3 +--
>  fs/btrfs/ioctl.c       | 11 ++++-------
>  3 files changed, 6 insertions(+), 11 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 1692ebb05955..0f5b85772023 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -2703,8 +2703,7 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
>  				     int nitems,
>  				     u64 *qgroup_reserved, bool use_global_rsv);
>  void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info,
> -				      struct btrfs_block_rsv *rsv,
> -				      u64 qgroup_reserved);
> +				      struct btrfs_block_rsv *rsv);
>  int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes);
>  void btrfs_delalloc_release_metadata(struct inode *inode, u64 num_bytes);
>  int btrfs_delalloc_reserve_space(struct inode *inode, u64 start, u64 len);
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 9e8d6c2e7a64..b33e2c8325c8 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -5826,8 +5826,7 @@ int btrfs_subvolume_reserve_metadata(struct btrfs_root *root,
>  }
>  
>  void btrfs_subvolume_release_metadata(struct btrfs_fs_info *fs_info,
> -				      struct btrfs_block_rsv *rsv,
> -				      u64 qgroup_reserved)
> +				      struct btrfs_block_rsv *rsv)
>  {
>  	btrfs_block_rsv_release(fs_info, rsv, (u64)-1);
>  }
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 77f93a1e65c7..e8c7c313c113 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -487,8 +487,7 @@ static noinline int create_subvol(struct inode *dir,
>  	trans = btrfs_start_transaction(root, 0);
>  	if (IS_ERR(trans)) {
>  		ret = PTR_ERR(trans);
> -		btrfs_subvolume_release_metadata(fs_info, &block_rsv,
> -						 qgroup_reserved);
> +		btrfs_subvolume_release_metadata(fs_info, &block_rsv);
>  		goto fail_free;
>  	}
>  	trans->block_rsv = &block_rsv;
> @@ -613,7 +612,7 @@ static noinline int create_subvol(struct inode *dir,
>  	kfree(root_item);
>  	trans->block_rsv = NULL;
>  	trans->bytes_reserved = 0;
> -	btrfs_subvolume_release_metadata(fs_info, &block_rsv, qgroup_reserved);
> +	btrfs_subvolume_release_metadata(fs_info, &block_rsv);
>  
>  	if (async_transid) {
>  		*async_transid = trans->transid;
> @@ -753,9 +752,7 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
>  	d_instantiate(dentry, inode);
>  	ret = 0;
>  fail:
> -	btrfs_subvolume_release_metadata(fs_info,
> -					 &pending_snapshot->block_rsv,
> -					 pending_snapshot->qgroup_reserved);
> +	btrfs_subvolume_release_metadata(fs_info, &pending_snapshot->block_rsv);
>  dec_and_free:
>  	if (atomic_dec_and_test(&root->will_be_snapshoted))
>  		wake_up_atomic_t(&root->will_be_snapshoted);
> @@ -2555,7 +2552,7 @@ static noinline int btrfs_ioctl_snap_destroy(struct file *file,
>  		err = ret;
>  	inode->i_flags |= S_DEAD;
>  out_release:
> -	btrfs_subvolume_release_metadata(fs_info, &block_rsv, qgroup_reserved);
> +	btrfs_subvolume_release_metadata(fs_info, &block_rsv);
>  out_up_write:
>  	up_write(&fs_info->subvol_sem);
>  	if (err) {
> -- 
> 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

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

* Re: [PATCH 08/29] btrfs: remove unused parameter from __push_leaf_left
  2017-02-13  9:33 ` [PATCH 08/29] btrfs: remove unused parameter from __push_leaf_left David Sterba
@ 2017-02-15 21:18   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:18 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:45AM +0100, David Sterba wrote:
> Unused since long ago.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index 2283f92b5484..b98e90a3eee7 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -3825,8 +3825,7 @@ static int push_leaf_right(struct btrfs_trans_handle *trans, struct btrfs_root
>   * item at 'max_slot' won't be touched.  Use (u32)-1 to make us do all the
>   * items
>   */
> -static noinline int __push_leaf_left(struct btrfs_trans_handle *trans,
> -				     struct btrfs_fs_info *fs_info,
> +static noinline int __push_leaf_left(struct btrfs_fs_info *fs_info,
>  				     struct btrfs_path *path, int data_size,
>  				     int empty, struct extent_buffer *left,
>  				     int free_space, u32 right_nritems,
> @@ -4035,7 +4034,7 @@ static int push_leaf_left(struct btrfs_trans_handle *trans, struct btrfs_root
>  		goto out;
>  	}
>  
> -	return __push_leaf_left(trans, fs_info, path, min_data_size,
> +	return __push_leaf_left(fs_info, path, min_data_size,
>  			       empty, left, free_space, right_nritems,
>  			       max_slot);
>  out:
> -- 
> 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

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

* Re: [PATCH 10/29] btrfs: remove unused parameter from btrfs_prepare_extent_commit
  2017-02-13  9:33 ` [PATCH 10/29] btrfs: remove unused parameter from btrfs_prepare_extent_commit David Sterba
@ 2017-02-15 21:20   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:20 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:52AM +0100, David Sterba wrote:
> Added but never used.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.h       | 3 +--
>  fs/btrfs/extent-tree.c | 3 +--
>  fs/btrfs/transaction.c | 2 +-
>  3 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 0f5b85772023..e7dbda3dd3b8 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -2630,8 +2630,7 @@ int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,
>  			       u64 start, u64 len, int delalloc);
>  int btrfs_free_and_pin_reserved_extent(struct btrfs_fs_info *fs_info,
>  				       u64 start, u64 len);
> -void btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans,
> -				 struct btrfs_fs_info *fs_info);
> +void btrfs_prepare_extent_commit(struct btrfs_fs_info *fs_info);
>  int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans,
>  			       struct btrfs_fs_info *fs_info);
>  int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index b33e2c8325c8..2500e3df3250 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -6558,8 +6558,7 @@ static int btrfs_free_reserved_bytes(struct btrfs_block_group_cache *cache,
>  	spin_unlock(&space_info->lock);
>  	return ret;
>  }
> -void btrfs_prepare_extent_commit(struct btrfs_trans_handle *trans,
> -				struct btrfs_fs_info *fs_info)
> +void btrfs_prepare_extent_commit(struct btrfs_fs_info *fs_info)
>  {
>  	struct btrfs_caching_control *next;
>  	struct btrfs_caching_control *caching_ctl;
> diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
> index 7d1d71259cd0..8bfb5e2c31f9 100644
> --- a/fs/btrfs/transaction.c
> +++ b/fs/btrfs/transaction.c
> @@ -2211,7 +2211,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
>  		goto scrub_continue;
>  	}
>  
> -	btrfs_prepare_extent_commit(trans, fs_info);
> +	btrfs_prepare_extent_commit(fs_info);
>  
>  	cur_trans = fs_info->running_transaction;
>  
> -- 
> 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

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

* Re: [PATCH 12/29] btrfs: remove unused parameter from tree_move_down
  2017-02-13  9:33 ` [PATCH 12/29] btrfs: remove unused parameter from tree_move_down David Sterba
@ 2017-02-15 21:21   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:21 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:33:58AM +0100, David Sterba wrote:
> Never needed.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index b98e90a3eee7..a981c2acd6fa 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -5241,7 +5241,7 @@ int btrfs_search_forward(struct btrfs_root *root, struct btrfs_key *min_key,
>  
>  static int tree_move_down(struct btrfs_fs_info *fs_info,
>  			   struct btrfs_path *path,
> -			   int *level, int root_level)
> +			   int *level)
>  {
>  	struct extent_buffer *eb;
>  
> @@ -5299,7 +5299,7 @@ static int tree_advance(struct btrfs_fs_info *fs_info,
>  		ret = tree_move_next_or_upnext(fs_info, path, level,
>  					       root_level);
>  	} else {
> -		ret = tree_move_down(fs_info, path, level, root_level);
> +		ret = tree_move_down(fs_info, path, level);
>  	}
>  	if (ret >= 0) {
>  		if (*level == 0)
> -- 
> 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

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

* Re: [PATCH 13/29] btrfs: remove unused parameter from tree_move_next_or_upnext
  2017-02-13  9:34 ` [PATCH 13/29] btrfs: remove unused parameter from tree_move_next_or_upnext David Sterba
@ 2017-02-15 21:22   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:22 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:01AM +0100, David Sterba wrote:
> Not needed.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ctree.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
> index a981c2acd6fa..1192bc7d2ee7 100644
> --- a/fs/btrfs/ctree.c
> +++ b/fs/btrfs/ctree.c
> @@ -5256,8 +5256,7 @@ static int tree_move_down(struct btrfs_fs_info *fs_info,
>  	return 0;
>  }
>  
> -static int tree_move_next_or_upnext(struct btrfs_fs_info *fs_info,
> -				    struct btrfs_path *path,
> +static int tree_move_next_or_upnext(struct btrfs_path *path,
>  				    int *level, int root_level)
>  {
>  	int ret = 0;
> @@ -5296,8 +5295,7 @@ static int tree_advance(struct btrfs_fs_info *fs_info,
>  	int ret;
>  
>  	if (*level == 0 || !allow_down) {
> -		ret = tree_move_next_or_upnext(fs_info, path, level,
> -					       root_level);
> +		ret = tree_move_next_or_upnext(path, level, root_level);
>  	} else {
>  		ret = tree_move_down(fs_info, path, level);
>  	}
> -- 
> 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

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

* Re: [PATCH 15/29] btrfs: remove unused parameter from update_nr_written
  2017-02-13  9:34 ` [PATCH 15/29] btrfs: remove unused parameter from update_nr_written David Sterba
@ 2017-02-15 21:22   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:22 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:07AM +0100, David Sterba wrote:
> The logic has been updated in "Btrfs: make mapping->writeback_index
> point to the last written page" (a91326679f2a0a4c2) and page is not
> needed anymore.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/extent_io.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
> index 00f3be5c4f2d..f683fa5a4b91 100644
> --- a/fs/btrfs/extent_io.c
> +++ b/fs/btrfs/extent_io.c
> @@ -3203,7 +3203,7 @@ int extent_read_full_page(struct extent_io_tree *tree, struct page *page,
>  	return ret;
>  }
>  
> -static void update_nr_written(struct page *page, struct writeback_control *wbc,
> +static void update_nr_written(struct writeback_control *wbc,
>  			      unsigned long nr_written)
>  {
>  	wbc->nr_to_write -= nr_written;
> @@ -3341,7 +3341,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
>  			else
>  				redirty_page_for_writepage(wbc, page);
>  
> -			update_nr_written(page, wbc, nr_written);
> +			update_nr_written(wbc, nr_written);
>  			unlock_page(page);
>  			return 1;
>  		}
> @@ -3351,7 +3351,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode,
>  	 * we don't want to touch the inode after unlocking the page,
>  	 * so we update the mapping writeback index now
>  	 */
> -	update_nr_written(page, wbc, nr_written + 1);
> +	update_nr_written(wbc, nr_written + 1);
>  
>  	end = page_end;
>  	if (i_size <= start) {
> @@ -3764,7 +3764,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb,
>  			break;
>  		}
>  		offset += PAGE_SIZE;
> -		update_nr_written(p, wbc, 1);
> +		update_nr_written(wbc, 1);
>  		unlock_page(p);
>  	}
>  
> -- 
> 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

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

* Re: [PATCH 16/29] btrfs: remove unused parameter from add_pending_csums
  2017-02-13  9:34 ` [PATCH 16/29] btrfs: remove unused parameter from add_pending_csums David Sterba
@ 2017-02-15 21:23   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:23 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:10AM +0100, David Sterba wrote:
> Never used.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/inode.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 7ed693294498..3ac7474f921d 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -1961,8 +1961,7 @@ static int btrfs_submit_bio_hook(struct inode *inode, struct bio *bio,
>   * at IO completion time based on sums calculated at bio submission time.
>   */
>  static noinline int add_pending_csums(struct btrfs_trans_handle *trans,
> -			     struct inode *inode, u64 file_offset,
> -			     struct list_head *list)
> +			     struct inode *inode, struct list_head *list)
>  {
>  	struct btrfs_ordered_sum *sum;
>  
> @@ -2956,8 +2955,7 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent)
>  		goto out_unlock;
>  	}
>  
> -	add_pending_csums(trans, inode, ordered_extent->file_offset,
> -			  &ordered_extent->list);
> +	add_pending_csums(trans, inode, &ordered_extent->list);
>  
>  	btrfs_ordered_update_i_size(inode, 0, ordered_extent);
>  	ret = btrfs_update_inode_fallback(trans, root, inode);
> -- 
> 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

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

* Re: [PATCH 18/29] btrfs: remove unused parameter from btrfs_fill_super
  2017-02-13  9:34 ` [PATCH 18/29] btrfs: remove unused parameter from btrfs_fill_super David Sterba
@ 2017-02-15 21:27   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:27 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:16AM +0100, David Sterba wrote:
> Never used for anything meaningful since we have our own superblock
> filler.
> 
Looks good.

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

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/super.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 93ed29c2a38b..da687dc79cce 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -1114,7 +1114,7 @@ static int get_default_subvol_objectid(struct btrfs_fs_info *fs_info, u64 *objec
>  
>  static int btrfs_fill_super(struct super_block *sb,
>  			    struct btrfs_fs_devices *fs_devices,
> -			    void *data, int silent)
> +			    void *data)
>  {
>  	struct inode *inode;
>  	struct btrfs_fs_info *fs_info = btrfs_sb(sb);
> @@ -1611,8 +1611,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
>  	} else {
>  		snprintf(s->s_id, sizeof(s->s_id), "%pg", bdev);
>  		btrfs_sb(s)->bdev_holder = fs_type;
> -		error = btrfs_fill_super(s, fs_devices, data,
> -					 flags & MS_SILENT ? 1 : 0);
> +		error = btrfs_fill_super(s, fs_devices, data);
>  	}
>  	if (error) {
>  		deactivate_locked_super(s);
> -- 
> 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

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

* Re: [PATCH 19/29] btrfs: remove unused parameter from __btrfs_alloc_chunk
  2017-02-13  9:34 ` [PATCH 19/29] btrfs: remove unused parameter from __btrfs_alloc_chunk David Sterba
@ 2017-02-15 21:28   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:28 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:19AM +0100, David Sterba wrote:
> We grab fs_info from other parameters.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/volumes.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 3c3c69c0eee4..d234625e4e02 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -4584,8 +4584,7 @@ static void check_raid56_incompat_flag(struct btrfs_fs_info *info, u64 type)
>  				/ sizeof(struct btrfs_stripe) + 1)
>  
>  static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
> -			       struct btrfs_fs_info *fs_info, u64 start,
> -			       u64 type)
> +			       u64 start, u64 type)
>  {
>  	struct btrfs_fs_info *info = trans->fs_info;
>  	struct btrfs_fs_devices *fs_devices = info->fs_devices;
> @@ -5009,7 +5008,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
>  
>  	ASSERT(mutex_is_locked(&fs_info->chunk_mutex));
>  	chunk_offset = find_next_chunk(fs_info);
> -	return __btrfs_alloc_chunk(trans, fs_info, chunk_offset, type);
> +	return __btrfs_alloc_chunk(trans, chunk_offset, type);
>  }
>  
>  static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
> @@ -5024,14 +5023,13 @@ static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
>  
>  	chunk_offset = find_next_chunk(fs_info);
>  	alloc_profile = btrfs_get_alloc_profile(extent_root, 0);
> -	ret = __btrfs_alloc_chunk(trans, fs_info, chunk_offset, alloc_profile);
> +	ret = __btrfs_alloc_chunk(trans, chunk_offset, alloc_profile);
>  	if (ret)
>  		return ret;
>  
>  	sys_chunk_offset = find_next_chunk(fs_info);
>  	alloc_profile = btrfs_get_alloc_profile(fs_info->chunk_root, 0);
> -	ret = __btrfs_alloc_chunk(trans, fs_info, sys_chunk_offset,
> -				  alloc_profile);
> +	ret = __btrfs_alloc_chunk(trans, sys_chunk_offset, alloc_profile);
>  	return ret;
>  }
>  
> -- 
> 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

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

* Re: [PATCH 22/29] btrfs: remove unused parameters from scrub_setup_wr_ctx
  2017-02-13  9:34 ` [PATCH 22/29] btrfs: remove unused parameters from scrub_setup_wr_ctx David Sterba
@ 2017-02-15 21:29   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:29 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:29AM +0100, David Sterba wrote:
> Never used.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/scrub.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index 9a94670536a6..f7dffacf61fa 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -282,9 +282,7 @@ static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
>  			       u64 *extent_physical,
>  			       struct btrfs_device **extent_dev,
>  			       int *extent_mirror_num);
> -static int scrub_setup_wr_ctx(struct scrub_ctx *sctx,
> -			      struct scrub_wr_ctx *wr_ctx,
> -			      struct btrfs_fs_info *fs_info,
> +static int scrub_setup_wr_ctx(struct scrub_wr_ctx *wr_ctx,
>  			      struct btrfs_device *dev,
>  			      int is_dev_replace);
>  static void scrub_free_wr_ctx(struct scrub_wr_ctx *wr_ctx);
> @@ -501,7 +499,7 @@ struct scrub_ctx *scrub_setup_ctx(struct btrfs_device *dev, int is_dev_replace)
>  	spin_lock_init(&sctx->stat_lock);
>  	init_waitqueue_head(&sctx->list_wait);
>  
> -	ret = scrub_setup_wr_ctx(sctx, &sctx->wr_ctx, fs_info,
> +	ret = scrub_setup_wr_ctx(&sctx->wr_ctx,
>  				 fs_info->dev_replace.tgtdev, is_dev_replace);
>  	if (ret) {
>  		scrub_free_ctx(sctx);
> @@ -4084,9 +4082,7 @@ static void scrub_remap_extent(struct btrfs_fs_info *fs_info,
>  	btrfs_put_bbio(bbio);
>  }
>  
> -static int scrub_setup_wr_ctx(struct scrub_ctx *sctx,
> -			      struct scrub_wr_ctx *wr_ctx,
> -			      struct btrfs_fs_info *fs_info,
> +static int scrub_setup_wr_ctx(struct scrub_wr_ctx *wr_ctx,
>  			      struct btrfs_device *dev,
>  			      int is_dev_replace)
>  {
> -- 
> 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

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

* Re: [PATCH 20/29] btrfs: remove unused parameter from init_first_rw_device
  2017-02-13  9:34 ` [PATCH 20/29] btrfs: remove unused parameter from init_first_rw_device David Sterba
@ 2017-02-15 21:30   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:30 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:22AM +0100, David Sterba wrote:
> The 'device' used to be added in that function, but now it's done by the
> caller.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/volumes.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index d234625e4e02..1fac98728814 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -134,8 +134,7 @@ const int btrfs_raid_mindev_error[BTRFS_NR_RAID_TYPES] = {
>  };
>  
>  static int init_first_rw_device(struct btrfs_trans_handle *trans,
> -				struct btrfs_fs_info *fs_info,
> -				struct btrfs_device *device);
> +				struct btrfs_fs_info *fs_info);
>  static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info);
>  static void __btrfs_reset_dev_stats(struct btrfs_device *dev);
>  static void btrfs_dev_stat_print_on_error(struct btrfs_device *dev);
> @@ -2440,7 +2439,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, char *device_path)
>  
>  	if (seeding_dev) {
>  		mutex_lock(&fs_info->chunk_mutex);
> -		ret = init_first_rw_device(trans, fs_info, device);
> +		ret = init_first_rw_device(trans, fs_info);
>  		mutex_unlock(&fs_info->chunk_mutex);
>  		if (ret) {
>  			btrfs_abort_transaction(trans, ret);
> @@ -5012,8 +5011,7 @@ int btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
>  }
>  
>  static noinline int init_first_rw_device(struct btrfs_trans_handle *trans,
> -					 struct btrfs_fs_info *fs_info,
> -					 struct btrfs_device *device)
> +					 struct btrfs_fs_info *fs_info)
>  {
>  	struct btrfs_root *extent_root = fs_info->extent_root;
>  	u64 chunk_offset;
> -- 
> 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

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

* Re: [PATCH 23/29] btrfs: remove unused parameter from __add_inline_refs
  2017-02-13  9:34 ` [PATCH 23/29] btrfs: remove unused parameter from __add_inline_refs David Sterba
@ 2017-02-15 21:32   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:32 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:31AM +0100, David Sterba wrote:
> Never used.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/backref.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
> index db706595e631..7699e16784d3 100644
> --- a/fs/btrfs/backref.c
> +++ b/fs/btrfs/backref.c
> @@ -956,8 +956,7 @@ static int __add_delayed_refs(struct btrfs_delayed_ref_head *head, u64 seq,
>  /*
>   * add all inline backrefs for bytenr to the list
>   */
> -static int __add_inline_refs(struct btrfs_fs_info *fs_info,
> -			     struct btrfs_path *path, u64 bytenr,
> +static int __add_inline_refs(struct btrfs_path *path, u64 bytenr,
>  			     int *info_level, struct list_head *prefs,
>  			     struct ref_root *ref_tree,
>  			     u64 *total_refs, u64 inum)
> @@ -1354,7 +1353,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
>  		if (key.objectid == bytenr &&
>  		    (key.type == BTRFS_EXTENT_ITEM_KEY ||
>  		     key.type == BTRFS_METADATA_ITEM_KEY)) {
> -			ret = __add_inline_refs(fs_info, path, bytenr,
> +			ret = __add_inline_refs(path, bytenr,
>  						&info_level, &prefs,
>  						ref_tree, &total_refs,
>  						inum);
> -- 
> 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

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

* Re: [PATCH 27/29] btrfs: remove unused parameter from cleanup_write_cache_enospc
  2017-02-13  9:34 ` [PATCH 27/29] btrfs: remove unused parameter from cleanup_write_cache_enospc David Sterba
@ 2017-02-15 21:33   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-15 21:33 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:44AM +0100, David Sterba wrote:
> bitmap_list is unused since the io_ctl framework.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/free-space-cache.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
> index 437580e84d9d..0d02599d22bc 100644
> --- a/fs/btrfs/free-space-cache.c
> +++ b/fs/btrfs/free-space-cache.c
> @@ -1128,8 +1128,7 @@ cleanup_bitmap_list(struct list_head *bitmap_list)
>  static void noinline_for_stack
>  cleanup_write_cache_enospc(struct inode *inode,
>  			   struct btrfs_io_ctl *io_ctl,
> -			   struct extent_state **cached_state,
> -			   struct list_head *bitmap_list)
> +			   struct extent_state **cached_state)
>  {
>  	io_ctl_drop_pages(io_ctl);
>  	unlock_extent_cached(&BTRFS_I(inode)->io_tree, 0,
> @@ -1365,7 +1364,7 @@ static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
>  	mutex_unlock(&ctl->cache_writeout_mutex);
>  
>  out_nospc:
> -	cleanup_write_cache_enospc(inode, io_ctl, &cached_state, &bitmap_list);
> +	cleanup_write_cache_enospc(inode, io_ctl, &cached_state);
>  
>  	if (block_group && (block_group->flags & BTRFS_BLOCK_GROUP_DATA))
>  		up_write(&block_group->data_rwsem);
> -- 
> 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

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

* Re: [PATCH 26/29] btrfs: remove unused parameter from __add_inode_ref
  2017-02-13  9:34 ` [PATCH 26/29] btrfs: remove unused parameter from __add_inode_ref David Sterba
@ 2017-02-16  0:08   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-16  0:08 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:41AM +0100, David Sterba wrote:
> Unused since the helper has been split, eb used in the caller.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/tree-log.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index 62dd138018b5..3806853cde08 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -994,7 +994,6 @@ static inline int __add_inode_ref(struct btrfs_trans_handle *trans,
>  				  struct btrfs_root *log_root,
>  				  struct btrfs_inode *dir,
>  				  struct btrfs_inode *inode,
> -				  struct extent_buffer *eb,
>  				  u64 inode_objectid, u64 parent_objectid,
>  				  u64 ref_index, char *name, int namelen,
>  				  int *search_done)
> @@ -1310,7 +1309,7 @@ static noinline int add_inode_ref(struct btrfs_trans_handle *trans,
>  			if (!search_done) {
>  				ret = __add_inode_ref(trans, root, path, log,
>  						      BTRFS_I(dir),
> -						      BTRFS_I(inode), eb,
> +						      BTRFS_I(inode),
>  						      inode_objectid,
>  						      parent_objectid,
>  						      ref_index, name, namelen,
> -- 
> 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

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

* Re: [PATCH 25/29] btrfs: remove unused parameter from clone_copy_inline_extent
  2017-02-13  9:34 ` [PATCH 25/29] btrfs: remove unused parameter from clone_copy_inline_extent David Sterba
@ 2017-02-16  0:10   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-16  0:10 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:38AM +0100, David Sterba wrote:
> Never used.
> 
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ioctl.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 1f13f8416d29..b9e6f8a4f760 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -3383,8 +3383,7 @@ static void clone_update_extent_map(struct inode *inode,
>   * data into the destination inode's inline extent if the later is greater then
>   * the former.
>   */
> -static int clone_copy_inline_extent(struct inode *src,
> -				    struct inode *dst,
> +static int clone_copy_inline_extent(struct inode *dst,
>  				    struct btrfs_trans_handle *trans,
>  				    struct btrfs_path *path,
>  				    struct btrfs_key *new_key,
> @@ -3763,7 +3762,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
>  				size -= skip + trim;
>  				datal -= skip + trim;
>  
> -				ret = clone_copy_inline_extent(src, inode,
> +				ret = clone_copy_inline_extent(inode,
>  							       trans, path,
>  							       &new_key,
>  							       drop_start,
> -- 
> 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

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

* Re: [PATCH 29/29] btrfs: remove unused parameter from adjust_slots_upwards
  2017-02-13  9:34 ` [PATCH 29/29] btrfs: remove unused parameter from adjust_slots_upwards David Sterba
@ 2017-02-16  0:12   ` Liu Bo
  0 siblings, 0 replies; 66+ messages in thread
From: Liu Bo @ 2017-02-16  0:12 UTC (permalink / raw)
  To: David Sterba; +Cc: linux-btrfs

On Mon, Feb 13, 2017 at 10:34:50AM +0100, David Sterba wrote:
> Never used.
> 
Looks good.

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

Thanks,

-liubo
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/qgroup.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
> index 6d106e623604..4ef513a392a7 100644
> --- a/fs/btrfs/qgroup.c
> +++ b/fs/btrfs/qgroup.c
> @@ -1589,8 +1589,7 @@ int btrfs_qgroup_trace_leaf_items(struct btrfs_trans_handle *trans,
>   * If we increment the root nodes slot counter past the number of
>   * elements, 1 is returned to signal completion of the search.
>   */
> -static int adjust_slots_upwards(struct btrfs_root *root,
> -				struct btrfs_path *path, int root_level)
> +static int adjust_slots_upwards(struct btrfs_path *path, int root_level)
>  {
>  	int level = 0;
>  	int nr, slot;
> @@ -1731,7 +1730,7 @@ int btrfs_qgroup_trace_subtree(struct btrfs_trans_handle *trans,
>  				goto out;
>  
>  			/* Nonzero return here means we completed our search */
> -			ret = adjust_slots_upwards(root, path, root_level);
> +			ret = adjust_slots_upwards(path, root_level);
>  			if (ret)
>  				break;
>  
> -- 
> 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

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

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

Thread overview: 66+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13  9:33 [PATCH 00/29] Cleanup of unused parameters David Sterba
2017-02-13  9:33 ` [PATCH 01/29] btrfs: remove unused parameter from read_block_for_search David Sterba
2017-02-14  0:59   ` Liu Bo
2017-02-14  1:03     ` Qu Wenruo
2017-02-14  1:09       ` Liu Bo
2017-02-13  9:33 ` [PATCH 02/29] btrfs: remove unused parameter from check_async_write David Sterba
2017-02-15 20:41   ` Liu Bo
2017-02-13  9:33 ` [PATCH 03/29] btrfs: remove unused parameter from clean_tree_block David Sterba
2017-02-15 21:12   ` Liu Bo
2017-02-13  9:33 ` [PATCH 04/29] btrfs: remove unused parameter from split_item David Sterba
2017-02-15 20:43   ` Liu Bo
2017-02-13  9:33 ` [PATCH 05/29] btrfs: remove unused parameter from write_dev_supers David Sterba
2017-02-14  1:59   ` Liu Bo
2017-02-13  9:33 ` [PATCH 06/29] btrfs: merge two superblock writing helpers David Sterba
2017-02-15 21:05   ` Liu Bo
2017-02-13  9:33 ` [PATCH 07/29] btrfs: remove unused parameter from __push_leaf_right David Sterba
2017-02-15 21:14   ` Liu Bo
2017-02-13  9:33 ` [PATCH 08/29] btrfs: remove unused parameter from __push_leaf_left David Sterba
2017-02-15 21:18   ` Liu Bo
2017-02-13  9:33 ` [PATCH 09/29] btrfs: remove unused parameter from btrfs_subvolume_release_metadata David Sterba
2017-02-15 21:17   ` Liu Bo
2017-02-13  9:33 ` [PATCH 10/29] btrfs: remove unused parameter from btrfs_prepare_extent_commit David Sterba
2017-02-15 21:20   ` Liu Bo
2017-02-13  9:33 ` [PATCH 11/29] btrfs: remove unused parameter from btrfs_check_super_valid David Sterba
2017-02-14  2:11   ` Liu Bo
2017-02-14 11:42     ` David Sterba
2017-02-14 18:44       ` Liu Bo
2017-02-13  9:33 ` [PATCH 12/29] btrfs: remove unused parameter from tree_move_down David Sterba
2017-02-15 21:21   ` Liu Bo
2017-02-13  9:34 ` [PATCH 13/29] btrfs: remove unused parameter from tree_move_next_or_upnext David Sterba
2017-02-15 21:22   ` Liu Bo
2017-02-13  9:34 ` [PATCH 14/29] btrfs: remove unused parameter from submit_extent_page David Sterba
2017-02-14 19:10   ` Liu Bo
2017-02-15 15:17     ` David Sterba
2017-02-13  9:34 ` [PATCH 15/29] btrfs: remove unused parameter from update_nr_written David Sterba
2017-02-15 21:22   ` Liu Bo
2017-02-13  9:34 ` [PATCH 16/29] btrfs: remove unused parameter from add_pending_csums David Sterba
2017-02-15 21:23   ` Liu Bo
2017-02-13  9:34 ` [PATCH 17/29] btrfs: remove unused parameter from extent_write_cache_pages David Sterba
2017-02-14 19:35   ` Liu Bo
2017-02-15 15:30     ` David Sterba
2017-02-15 20:38       ` Liu Bo
2017-02-13  9:34 ` [PATCH 18/29] btrfs: remove unused parameter from btrfs_fill_super David Sterba
2017-02-15 21:27   ` Liu Bo
2017-02-13  9:34 ` [PATCH 19/29] btrfs: remove unused parameter from __btrfs_alloc_chunk David Sterba
2017-02-15 21:28   ` Liu Bo
2017-02-13  9:34 ` [PATCH 20/29] btrfs: remove unused parameter from init_first_rw_device David Sterba
2017-02-15 21:30   ` Liu Bo
2017-02-13  9:34 ` [PATCH 21/29] btrfs: remove unused parameter from create_snapshot David Sterba
2017-02-14 19:36   ` Liu Bo
2017-02-13  9:34 ` [PATCH 22/29] btrfs: remove unused parameters from scrub_setup_wr_ctx David Sterba
2017-02-15 21:29   ` Liu Bo
2017-02-13  9:34 ` [PATCH 23/29] btrfs: remove unused parameter from __add_inline_refs David Sterba
2017-02-15 21:32   ` Liu Bo
2017-02-13  9:34 ` [PATCH 24/29] btrfs: remove unused parameters from btrfs_cmp_data David Sterba
2017-02-14 19:40   ` Liu Bo
2017-02-13  9:34 ` [PATCH 25/29] btrfs: remove unused parameter from clone_copy_inline_extent David Sterba
2017-02-16  0:10   ` Liu Bo
2017-02-13  9:34 ` [PATCH 26/29] btrfs: remove unused parameter from __add_inode_ref David Sterba
2017-02-16  0:08   ` Liu Bo
2017-02-13  9:34 ` [PATCH 27/29] btrfs: remove unused parameter from cleanup_write_cache_enospc David Sterba
2017-02-15 21:33   ` Liu Bo
2017-02-13  9:34 ` [PATCH 28/29] btrfs: remove unused parameters from __btrfs_write_out_cache David Sterba
2017-02-14 20:19   ` Liu Bo
2017-02-13  9:34 ` [PATCH 29/29] btrfs: remove unused parameter from adjust_slots_upwards David Sterba
2017-02-16  0:12   ` Liu Bo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.