summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-03-24 15:02:07 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:01 -0400
commit8a4b83cc8bd75fca29ac68615896d9e92820e7c2 (patch)
treeb7f99cf53c322665b78cca10742cc734ad070729 /fs/btrfs/volumes.h
parent239b14b32dc39232ebf9cce29ff77c4c564355fd (diff)
downloadop-kernel-dev-8a4b83cc8bd75fca29ac68615896d9e92820e7c2.zip
op-kernel-dev-8a4b83cc8bd75fca29ac68615896d9e92820e7c2.tar.gz
Btrfs: Add support for device scanning and detection ioctls
Signed-off-by: Chris Mason <chris.mason@oracle.com>
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 2025912..12f297e 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -24,6 +24,8 @@ struct btrfs_device {
struct block_device *bdev;
+ char *name;
+
/* the internal btrfs device id */
u64 devid;
@@ -49,6 +51,20 @@ 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;
+ u64 num_devices;
+ struct block_device *latest_bdev;
+ struct block_device *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);
@@ -67,4 +83,13 @@ int btrfs_read_super_device(struct btrfs_root *root, struct extent_buffer *buf);
int btrfs_map_block(struct btrfs_mapping_tree *map_tree,
u64 logical, u64 *phys, u64 *length,
struct btrfs_device **dev);
+int btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
+ int flags, void *holder);
+int btrfs_scan_one_device(const char *path, int flags, void *holder,
+ struct btrfs_fs_devices **fs_devices_ret);
+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_cleanup_fs_uuids(void);
#endif
OpenPOWER on IntegriCloud