aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r--fs/btrfs/volumes.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 20259128152e..12f297eb0559 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -24,6 +24,8 @@ struct btrfs_device {
24 24
25 struct block_device *bdev; 25 struct block_device *bdev;
26 26
27 char *name;
28
27 /* the internal btrfs device id */ 29 /* the internal btrfs device id */
28 u64 devid; 30 u64 devid;
29 31
@@ -49,6 +51,20 @@ struct btrfs_device {
49 u8 uuid[BTRFS_DEV_UUID_SIZE]; 51 u8 uuid[BTRFS_DEV_UUID_SIZE];
50}; 52};
51 53
54struct btrfs_fs_devices {
55 u8 fsid[BTRFS_FSID_SIZE]; /* FS specific uuid */
56
57 /* the device with this id has the most recent coyp of the super */
58 u64 latest_devid;
59 u64 latest_trans;
60 u64 lowest_devid;
61 u64 num_devices;
62 struct block_device *latest_bdev;
63 struct block_device *lowest_bdev;
64 struct list_head devices;
65 struct list_head list;
66};
67
52int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, 68int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans,
53 struct btrfs_device *device, 69 struct btrfs_device *device,
54 u64 owner, u64 num_bytes, u64 *start); 70 u64 owner, u64 num_bytes, u64 *start);
@@ -67,4 +83,13 @@ int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf);
67int btrfs_map_block(struct btrfs_mapping_tree *map_tree, 83int btrfs_map_block(struct btrfs_mapping_tree *map_tree,
68 u64 logical, u64 *phys, u64 *length, 84 u64 logical, u64 *phys, u64 *length,
69 struct btrfs_device **dev); 85 struct btrfs_device **dev);
86int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
87 int flags, void *holder);
88int btrfs_scan_one_device(const char *path, int flags, void *holder,
89 struct btrfs_fs_devices **fs_devices_ret);
90int btrfs_close_devices(struct btrfs_fs_devices *fs_devices);
91int btrfs_add_device(struct btrfs_trans_handle *trans,
92 struct btrfs_root *root,
93 struct btrfs_device *device);
94int btrfs_cleanup_fs_uuids(void);
70#endif 95#endif