From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH v2 2/6] btrfs-progs: Replace root parameter using fs_info for reada_for_search()
Date: Fri, 28 Sep 2018 10:04:42 +0800 [thread overview]
Message-ID: <20180928020446.21467-3-wqu@suse.com> (raw)
In-Reply-To: <20180928020446.21467-1-wqu@suse.com>
As the @root parameter is only used to get @fs_info, use fs_info
directly instead.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
cmds-restore.c | 4 ++--
ctree.c | 11 +++++------
ctree.h | 4 ++--
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/cmds-restore.c b/cmds-restore.c
index d12c1a924059..30ea8a7e93d1 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -259,7 +259,7 @@ again:
}
if (path->reada)
- reada_for_search(root, path, level, slot, 0);
+ reada_for_search(fs_info, path, level, slot, 0);
next = read_node_slot(fs_info, c, slot);
if (extent_buffer_uptodate(next))
@@ -276,7 +276,7 @@ again:
if (!level)
break;
if (path->reada)
- reada_for_search(root, path, level, 0, 0);
+ reada_for_search(fs_info, path, level, 0, 0);
next = read_node_slot(fs_info, next, 0);
if (!extent_buffer_uptodate(next))
goto again;
diff --git a/ctree.c b/ctree.c
index d8a6883aa85f..042fae19344d 100644
--- a/ctree.c
+++ b/ctree.c
@@ -1000,10 +1000,9 @@ static int noinline push_nodes_for_insert(struct btrfs_trans_handle *trans,
/*
* readahead one full node of leaves
*/
-void reada_for_search(struct btrfs_root *root, struct btrfs_path *path,
- int level, int slot, u64 objectid)
+void reada_for_search(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
+ int level, int slot, u64 objectid)
{
- struct btrfs_fs_info *fs_info = root->fs_info;
struct extent_buffer *node;
struct btrfs_disk_key disk_key;
u32 nritems;
@@ -1203,7 +1202,7 @@ again:
break;
if (should_reada)
- reada_for_search(root, p, level, slot,
+ reada_for_search(fs_info, p, level, slot,
key->objectid);
b = read_node_slot(fs_info, b, slot);
@@ -2902,7 +2901,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
}
if (path->reada)
- reada_for_search(root, path, level, slot, 0);
+ reada_for_search(fs_info, path, level, slot, 0);
next = read_node_slot(fs_info, c, slot);
if (!extent_buffer_uptodate(next))
@@ -2919,7 +2918,7 @@ int btrfs_next_leaf(struct btrfs_root *root, struct btrfs_path *path)
if (!level)
break;
if (path->reada)
- reada_for_search(root, path, level, 0, 0);
+ reada_for_search(fs_info, path, level, 0, 0);
next = read_node_slot(fs_info, next, 0);
if (!extent_buffer_uptodate(next))
return -EIO;
diff --git a/ctree.h b/ctree.h
index 4719962df67d..6df6075865c2 100644
--- a/ctree.h
+++ b/ctree.h
@@ -2562,8 +2562,8 @@ btrfs_check_node(struct btrfs_root *root, struct btrfs_disk_key *parent_key,
enum btrfs_tree_block_status
btrfs_check_leaf(struct btrfs_root *root, struct btrfs_disk_key *parent_key,
struct extent_buffer *buf);
-void reada_for_search(struct btrfs_root *root, struct btrfs_path *path,
- int level, int slot, u64 objectid);
+void reada_for_search(struct btrfs_fs_info *fs_info, struct btrfs_path *path,
+ int level, int slot, u64 objectid);
struct extent_buffer *read_node_slot(struct btrfs_fs_info *fs_info,
struct extent_buffer *parent, int slot);
int btrfs_previous_item(struct btrfs_root *root,
--
2.19.0
next prev parent reply other threads:[~2018-09-28 2:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-28 2:04 [PATCH v2 0/6] btrfs-progs: print-tree: Minor enhancement along with --bfs/--dfs options Qu Wenruo
2018-09-28 2:04 ` [PATCH v2 1/6] btrfs-progs: print-tree: Skip deprecated blockptr / nodesize output Qu Wenruo
2018-09-28 2:04 ` Qu Wenruo [this message]
2018-09-28 2:04 ` [PATCH v2 3/6] btrfs-progs: Introduce function to find next sibling tree block Qu Wenruo
2018-09-28 2:04 ` [PATCH v2 4/6] btrfs-progs: print-tree: Introduce breadth-first search Qu Wenruo
2018-09-28 2:04 ` [PATCH v2 5/6] btrfs-progs: print-tree: Introduce --bfs and --dfs options Qu Wenruo
2018-09-28 2:04 ` [PATCH v2 6/6] btrfs-progs: print-tree: Use bool for @follow Qu Wenruo
2018-10-25 16:03 ` [PATCH v2 0/6] btrfs-progs: print-tree: Minor enhancement along with --bfs/--dfs options David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180928020446.21467-3-wqu@suse.com \
--to=wqu@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).