summaryrefslogtreecommitdiff
path: root/btrfs-list.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2016-10-31 12:27:08 +0100
committerDavid Sterba <dsterba@suse.com>2016-11-09 13:47:29 +0100
commite573142d3744c07a052fe03c44de613db879996d (patch)
treee78f78c58db87332322414450b7dbb91e5375fb8 /btrfs-list.c
parent1aeb6baee382afe4c68cbeb3adbc5a82d1c8266e (diff)
btrfs-progs: subvol list: add simplified helper for adding root backrefs
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'btrfs-list.c')
-rw-r--r--btrfs-list.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/btrfs-list.c b/btrfs-list.c
index 82001fbd..b93a5be2 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -519,6 +519,18 @@ static int add_root(struct root_lookup *root_lookup,
return 0;
}
+/*
+ * Simplified add_root for back references, omits the uuid and original info
+ * parameters, root offset and flags.
+ */
+static int add_root_backref(struct root_lookup *root_lookup, u64 root_id,
+ u64 ref_tree, u64 dir_id, char *name, int name_len)
+{
+ return add_root(root_lookup, root_id, ref_tree, 0, 0, dir_id, name,
+ name_len, 0, 0, 0, NULL, NULL, NULL);
+}
+
+
static void free_root_info(struct rb_node *node)
{
struct root_info *ri;
@@ -1009,9 +1021,9 @@ static int list_subvol_search(int fd, struct root_lookup *root_lookup)
name = (char *)(ref + 1);
dir_id = btrfs_stack_root_ref_dirid(ref);
- add_root(root_lookup, sh.objectid, sh.offset,
- 0, 0, dir_id, name, name_len, 0, 0, 0,
- NULL, NULL, NULL);
+ add_root_backref(root_lookup, sh.objectid,
+ sh.offset, dir_id, name,
+ name_len);
} else if (sh.type == BTRFS_ROOT_ITEM_KEY) {
time_t otime;