@@ -87,7 +87,7 @@ static struct btrfs_fs_devices *find_fsid(u8 *fsid)
return NULL;
}
-static int device_list_add(const char *path,
+int device_list_add(const char *path,
struct btrfs_super_block *disk_super,
u64 devid, struct btrfs_fs_devices **fs_devices_ret)
{
@@ -154,6 +154,24 @@ static int device_list_add(const char *path,
return 0;
}
+void device_list_fini(u8 *fsid)
+{
+ struct list_head *fsids;
+ struct list_head *cur_fsid;
+ struct btrfs_fs_devices *fs_devices;
+
+ fsids = btrfs_scanned_uuids();
+ list_for_each(cur_fsid, fsids) {
+ fs_devices = list_entry(cur_fsid, struct btrfs_fs_devices,
+ list);
+ if (!memcmp(fs_devices->fsid, fsid, BTRFS_FSID_SIZE)) {
+ list_del(&fs_devices->devices);
+ list_del(&fs_devices->list);
+ break;
+ }
+ }
+}
+
int btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
{
struct btrfs_fs_devices *seed_devices;
@@ -190,4 +190,7 @@ int btrfs_add_system_chunk(struct btrfs_trans_handle *trans,
int btrfs_chunk_readonly(struct btrfs_root *root, u64 chunk_offset);
struct btrfs_device *btrfs_find_device_by_devid(struct btrfs_root *root,
u64 devid, int instance);
+int device_list_add(const char *path, struct btrfs_super_block *disk_super,
+ u64 devid, struct btrfs_fs_devices **fs_devices_ret);
+void device_list_fini(u8 *fsid);
#endif
this is preparatory so that fsid found in the kernel can be added Signed-off-by: Anand Jain <anand.jain@oracle.com> --- volumes.c | 20 +++++++++++++++++++- volumes.h | 3 +++ 2 files changed, 22 insertions(+), 1 deletion(-)