[PATCH 09/19] btrfs: Move link_backref_edge() to backref.c

Qu Wenruo
2020-03-03T07:15:26Z

fs/btrfs/backref.h | 16 ++++++++++++++++
fs/btrfs/relocation.c | 16 ----------------
2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h
index 04efc9d44bb8..431c8a15c5f9 100644
--- a/fs/btrfs/backref.h
+++ b/fs/btrfs/backref.h
@@ -295,4 +295,20 @@ void backref_cache_init(struct btrfs_fs_info *fs_info,
struct backref_node *alloc_backref_node(struct backref_cache *cache,
u64 bytenr, int level);
struct backref_edge *alloc_backref_edge(struct backref_cache *cache);
+
+#define LINK_LOWER (1 << 0)
+#define LINK_UPPER (1 << 1)
+static inline void link_backref_edge(struct backref_edge *edge,
+ struct backref_node *lower,
+ struct 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);
+}
#endif
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 1f4fccd973d1..dfcedd7824bc 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -225,22 +225,6 @@ static void free_backref_node(struct backref_cache *cache,
}
}

-#define LINK_LOWER (1 << 0)
-#define LINK_UPPER (1 << 1)
-static inline void link_backref_edge(struct backref_edge *edge,
- struct backref_node *lower,
- struct 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 backref_cache *cache,
struct backref_edge *edge)
{
--
2.25.1