From 6d26357f8e7d73d802e8025407fe17542a18164b Mon Sep 17 00:00:00 2001 From: Stefan Behrens Date: Tue, 23 Apr 2013 12:18:55 +0200 Subject: Btrfs-progs: add function to map subvol ID to path Several tools like btrfs-send and btrfs-receive need to map a subvolume ID to a filesystem path. The so far existing methods in btrfs-list.c cause a horrible effort when performing this operation (and the effort is dependent on the number of existing subvolumes with quadratic effort). This commit adds a function that is able to map a subvolume ID to a filesystem path with an effort that is independent of the number of existing subvolumes. In addition to this function, a command line frontend is added as well: btrfs inspect-internal subvolid-resolve Signed-off-by: Stefan Behrens --- send-utils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'send-utils.h') diff --git a/send-utils.h b/send-utils.h index 78abf944..06af75f3 100644 --- a/send-utils.h +++ b/send-utils.h @@ -70,7 +70,7 @@ struct subvol_info *subvol_uuid_search(struct subvol_uuid_search *s, void subvol_uuid_search_add(struct subvol_uuid_search *s, struct subvol_info *si); - +int btrfs_subvolid_resolve(int fd, char *path, size_t path_len, u64 subvol_id); char *path_cat(const char *p1, const char *p2); char *path_cat3(const char *p1, const char *p2, const char *p3); -- cgit v1.2.3