diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-04-09 16:28:12 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2008-04-09 16:28:12 -0400 |
commit | 1b74adf90b95af77a2826dc82cf5c5f38af90e52 (patch) | |
tree | a88eeab8d60b4d284654d8b46fefec67b1d6f2ed /volumes.h | |
parent | 97864fa126c1e7675595882943d0397c45ef4b67 (diff) | |
download | btrfs-progs-1b74adf90b95af77a2826dc82cf5c5f38af90e52.tar.gz |
Change btrfs_map_block to return a structure with mappings for all stripes
Diffstat (limited to 'volumes.h')
-rw-r--r-- | volumes.h | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -66,12 +66,26 @@ struct btrfs_fs_devices { struct list_head list; }; +struct btrfs_bio_stripe { + struct btrfs_device *dev; + u64 physical; +}; + +struct btrfs_multi_bio { + int error; + int num_stripes; + struct btrfs_bio_stripe stripes[]; +}; + +#define btrfs_multi_bio_size(n) (sizeof(struct btrfs_multi_bio) + \ + (sizeof(struct btrfs_bio_stripe) * (n))) + int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, struct btrfs_device *device, u64 owner, u64 num_bytes, u64 *start); -int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, int stripe_nr, - u64 logical, u64 *phys, u64 *length, - struct btrfs_device **dev, int *total_stripes); +int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, + u64 logical, u64 *length, + struct btrfs_multi_bio **multi_ret); int btrfs_read_sys_array(struct btrfs_root *root); int btrfs_read_chunk_tree(struct btrfs_root *root); int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, |