summaryrefslogtreecommitdiff
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2020-03-03 08:24:06 +0300
committerDavid Sterba <dsterba@suse.com>2020-05-25 12:25:20 +0300
commitf39911e5527e8be7ab56cadde306237092bcc78f (patch)
treeb2a2dbe670cd5ea673d58feb070395e099dbaae0 /fs/btrfs/relocation.c
parent47254d07f37590fddc1516006e3e79453e755424 (diff)
downloadlinux-f39911e5527e8be7ab56cadde306237092bcc78f.tar.xz
btrfs: backref: rename and move link_backref_edge()
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.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 8b22b5966039..fd6a6e0b8849 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -218,21 +218,6 @@ static void free_backref_node(struct btrfs_backref_cache *cache,
}
}
-#define LINK_LOWER (1 << 0)
-#define LINK_UPPER (1 << 1)
-static void link_backref_edge(struct btrfs_backref_edge *edge,
- struct btrfs_backref_node *lower,
- struct btrfs_backref_node *upper,
- int link_which)
-{
- ASSERT(upper && lower && upper->level == lower->level + 1);
- edge->node[LOWER] = lower;
- edge->node[UPPER] = upper;
- if (link_which & LINK_LOWER)
- list_add_tail(&edge->list[LOWER], &lower->upper);
- if (link_which & LINK_UPPER)
- list_add_tail(&edge->list[UPPER], &upper->lower);
-}
static void free_backref_edge(struct btrfs_backref_cache *cache,
struct btrfs_backref_edge *edge)
@@ -595,7 +580,7 @@ static int handle_direct_tree_backref(struct btrfs_backref_cache *cache,
ASSERT(upper->checked);
INIT_LIST_HEAD(&edge->list[UPPER]);
}
- link_backref_edge(edge, cur, upper, LINK_LOWER);
+ btrfs_backref_link_edge(edge, cur, upper, LINK_LOWER);
return 0;
}
@@ -740,7 +725,7 @@ static int handle_indirect_tree_backref(struct btrfs_backref_cache *cache,
if (!upper->owner)
upper->owner = btrfs_header_owner(eb);
}
- link_backref_edge(edge, lower, upper, LINK_LOWER);
+ btrfs_backref_link_edge(edge, lower, upper, LINK_LOWER);
if (rb_node) {
btrfs_put_root(root);
@@ -1256,8 +1241,8 @@ static int clone_backref_node(struct btrfs_trans_handle *trans,
if (!new_edge)
goto fail;
- link_backref_edge(new_edge, edge->node[LOWER], new_node,
- LINK_UPPER);
+ btrfs_backref_link_edge(new_edge, edge->node[LOWER],
+ new_node, LINK_UPPER);
}
} else {
list_add_tail(&new_node->lower, &cache->leaves);