diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-03-24 15:02:07 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | 8a4b83cc8bd75fca29ac68615896d9e92820e7c2 (patch) | |
tree | b7f99cf53c322665b78cca10742cc734ad070729 /fs/btrfs/volumes.h | |
parent | 239b14b32dc39232ebf9cce29ff77c4c564355fd (diff) |
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.h | 25 |
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 | ||
54 | struct 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 | |||
52 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | 68 | int 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); | |||
67 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, | 83 | int 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); |
86 | int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, | ||
87 | int flags, void *holder); | ||
88 | int btrfs_scan_one_device(const char *path, int flags, void *holder, | ||
89 | struct btrfs_fs_devices **fs_devices_ret); | ||
90 | int btrfs_close_devices(struct btrfs_fs_devices *fs_devices); | ||
91 | int btrfs_add_device(struct btrfs_trans_handle *trans, | ||
92 | struct btrfs_root *root, | ||
93 | struct btrfs_device *device); | ||
94 | int btrfs_cleanup_fs_uuids(void); | ||
70 | #endif | 95 | #endif |