diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-09 16:28:12 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:01 -0400 |
commit | cea9e4452ebaf18dd0951e90dc84d82a5dee40b2 (patch) | |
tree | 94f6a3c4fa25ebdff1f46d8b41ab58ee92723609 /fs/btrfs/volumes.h | |
parent | d18a2c447524751137a12cc8ccaf9d1e0b7fa1b3 (diff) |
Change btrfs_map_block to return a structure with mappings for all stripes
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, 22 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 35dec3efd78c..10ca0104750c 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -19,6 +19,8 @@ | |||
19 | #ifndef __BTRFS_VOLUMES_ | 19 | #ifndef __BTRFS_VOLUMES_ |
20 | #define __BTRFS_VOLUMES_ | 20 | #define __BTRFS_VOLUMES_ |
21 | 21 | ||
22 | #include <linux/bio.h> | ||
23 | |||
22 | struct btrfs_device { | 24 | struct btrfs_device { |
23 | struct list_head dev_list; | 25 | struct list_head dev_list; |
24 | struct btrfs_root *dev_root; | 26 | struct btrfs_root *dev_root; |
@@ -69,12 +71,29 @@ struct btrfs_fs_devices { | |||
69 | struct list_head list; | 71 | struct list_head list; |
70 | }; | 72 | }; |
71 | 73 | ||
74 | struct btrfs_bio_stripe { | ||
75 | struct btrfs_device *dev; | ||
76 | u64 physical; | ||
77 | }; | ||
78 | |||
79 | struct btrfs_multi_bio { | ||
80 | atomic_t stripes_pending; | ||
81 | bio_end_io_t *end_io; | ||
82 | void *private; | ||
83 | int error; | ||
84 | int num_stripes; | ||
85 | struct btrfs_bio_stripe stripes[]; | ||
86 | }; | ||
87 | |||
88 | #define btrfs_multi_bio_size(n) (sizeof(struct btrfs_multi_bio) + \ | ||
89 | (sizeof(struct btrfs_bio_stripe) * (n))) | ||
90 | |||
72 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | 91 | int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, |
73 | struct btrfs_device *device, | 92 | struct btrfs_device *device, |
74 | u64 owner, u64 num_bytes, u64 *start); | 93 | u64 owner, u64 num_bytes, u64 *start); |
75 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, int stripe_nr, | 94 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, |
76 | u64 logical, u64 *phys, u64 *length, | 95 | u64 logical, u64 *length, |
77 | struct btrfs_device **dev, int *total_stripes); | 96 | struct btrfs_multi_bio **multi_ret); |
78 | int btrfs_read_sys_array(struct btrfs_root *root); | 97 | int btrfs_read_sys_array(struct btrfs_root *root); |
79 | int btrfs_read_chunk_tree(struct btrfs_root *root); | 98 | int btrfs_read_chunk_tree(struct btrfs_root *root); |
80 | int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, | 99 | int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, |