From 0dcfa3b8270f38edacee1c62f308129c36073d0c Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Mon, 24 Mar 2008 15:05:44 -0400 Subject: Walk all block devices looking for btrfs --- volumes.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'volumes.h') 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 -- cgit v1.2.3