summaryrefslogtreecommitdiff
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2020-03-03 09:26:02 +0300
committerDavid Sterba <dsterba@suse.com>2020-05-25 12:25:21 +0300
commit55465730bcea75606c2c281ca55701c7fc20a000 (patch)
treea70387b4d09a749ef7e6960c1f53fdd2ac6ed31e /fs/btrfs/relocation.c
parent982c92cbd51cf6ab1319e1e94dfd4902d3678d9a (diff)
downloadlinux-55465730bcea75606c2c281ca55701c7fc20a000.tar.xz
btrfs: backref: rename and move should_ignore_root()
This function is mostly single purpose to relocation backref cache, but since we're moving the main part of backref cache to backref.c, we need to export such function. And to avoid confusion, rename the function to btrfs_should_ignore_reloc_root() make the name a little more clear. Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 6f712b22c66f..2a0a734a5d88 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -305,7 +305,8 @@ static bool reloc_root_is_dead(struct btrfs_root *root)
*
* Reloc tree after swap is considered dead, thus not considered as valid.
* This is enough for most callers, as they don't distinguish dead reloc root
- * from no reloc root. But should_ignore_root() below is a special case.
+ * from no reloc root. But btrfs_should_ignore_reloc_root() below is a
+ * special case.
*/
static bool have_reloc_root(struct btrfs_root *root)
{
@@ -316,7 +317,7 @@ static bool have_reloc_root(struct btrfs_root *root)
return true;
}
-static int should_ignore_root(struct btrfs_root *root)
+int btrfs_should_ignore_reloc_root(struct btrfs_root *root)
{
struct btrfs_root *reloc_root;
@@ -342,6 +343,7 @@ static int should_ignore_root(struct btrfs_root *root)
*/
return 1;
}
+
/*
* find reloc tree by address of tree root
*/
@@ -485,7 +487,7 @@ static int handle_indirect_tree_backref(struct btrfs_backref_cache *cache,
if (btrfs_root_level(&root->root_item) == cur->level) {
/* Tree root */
ASSERT(btrfs_root_bytenr(&root->root_item) == cur->bytenr);
- if (should_ignore_root(root)) {
+ if (btrfs_should_ignore_reloc_root(root)) {
btrfs_put_root(root);
list_add(&cur->list, &cache->useless_node);
} else {
@@ -526,7 +528,7 @@ static int handle_indirect_tree_backref(struct btrfs_backref_cache *cache,
if (!path->nodes[level]) {
ASSERT(btrfs_root_bytenr(&root->root_item) ==
lower->bytenr);
- if (should_ignore_root(root)) {
+ if (btrfs_should_ignore_reloc_root(root)) {
btrfs_put_root(root);
list_add(&lower->list, &cache->useless_node);
} else {