summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.h
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2020-03-03 13:26:12 +0800
committerDavid Sterba <dsterba@suse.com>2020-05-25 11:25:20 +0200
commit741188d3a549af328cc7946ce9650dd33a25087b (patch)
treea2995d59c5163bcb97223216b5127c84c73f231f /fs/btrfs/backref.h
parentf39911e5527e8be7ab56cadde306237092bcc78f (diff)
downloadlinux-741188d3a549af328cc7946ce9650dd33a25087b.tar.gz
linux-741188d3a549af328cc7946ce9650dd33a25087b.tar.bz2
linux-741188d3a549af328cc7946ce9650dd33a25087b.zip
btrfs: backref: rename and move free_backref_(node|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/backref.h')
-rw-r--r--fs/btrfs/backref.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h
index 01c559543133..0a1f296b1f26 100644
--- a/fs/btrfs/backref.h
+++ b/fs/btrfs/backref.h
@@ -8,6 +8,7 @@
#include <linux/btrfs.h>
#include "ulist.h"
+#include "disk-io.h"
#include "extent_io.h"
struct inode_fs_paths {
@@ -291,4 +292,23 @@ static inline void btrfs_backref_link_edge(struct btrfs_backref_edge *edge,
list_add_tail(&edge->list[UPPER], &upper->lower);
}
+static inline void btrfs_backref_free_node(struct btrfs_backref_cache *cache,
+ struct btrfs_backref_node *node)
+{
+ if (node) {
+ cache->nr_nodes--;
+ btrfs_put_root(node->root);
+ kfree(node);
+ }
+}
+
+static inline void btrfs_backref_free_edge(struct btrfs_backref_cache *cache,
+ struct btrfs_backref_edge *edge)
+{
+ if (edge) {
+ cache->nr_edges--;
+ kfree(edge);
+ }
+}
+
#endif