summaryrefslogtreecommitdiff
path: root/volumes.h
diff options
context:
space:
mode:
Diffstat (limited to 'volumes.h')
-rw-r--r--volumes.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/volumes.h b/volumes.h
index c585b15d..ae9e7bb7 100644
--- a/volumes.h
+++ b/volumes.h
@@ -24,6 +24,8 @@ struct btrfs_device {
int fd;
+ char *name;
+
/* the internal btrfs device id */
u64 devid;
@@ -49,6 +51,19 @@ struct btrfs_device {
u8 uuid[BTRFS_DEV_UUID_SIZE];
};
+struct btrfs_fs_devices {
+ u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
+
+ /* the device with this id has the most recent coyp of the super */
+ u64 latest_devid;
+ u64 latest_trans;
+ u64 lowest_devid;
+ int latest_bdev;
+ int lowest_bdev;
+ struct list_head devices;
+ struct list_head list;
+};
+
int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
struct btrfs_device *device,
u64 owner, u64 num_bytes, u64 *start);
@@ -64,4 +79,13 @@ int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf);
int btrfs_add_device(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct btrfs_device *device);
+int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
+ int flags);
+int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
+int btrfs_add_device(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root,
+ struct btrfs_device *device);
+int btrfs_scan_one_device(int fd, const char *path,
+ struct btrfs_fs_devices **fs_devices_ret,
+ u64 *total_devs, u64 super_offset);
#endif