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.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index d6fe73c0f4a2..83069dec6898 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -295,8 +295,10 @@ typedef void (btrfs_bio_end_io_t) (struct btrfs_bio *bio, int err);
295#define BTRFS_BIO_ORIG_BIO_SUBMITTED (1 << 0) 295#define BTRFS_BIO_ORIG_BIO_SUBMITTED (1 << 0)
296 296
297struct btrfs_bio { 297struct btrfs_bio {
298 atomic_t refs;
298 atomic_t stripes_pending; 299 atomic_t stripes_pending;
299 struct btrfs_fs_info *fs_info; 300 struct btrfs_fs_info *fs_info;
301 u64 map_type; /* get from map_lookup->type */
300 bio_end_io_t *end_io; 302 bio_end_io_t *end_io;
301 struct bio *orig_bio; 303 struct bio *orig_bio;
302 unsigned long flags; 304 unsigned long flags;
@@ -307,6 +309,12 @@ struct btrfs_bio {
307 int mirror_num; 309 int mirror_num;
308 int num_tgtdevs; 310 int num_tgtdevs;
309 int *tgtdev_map; 311 int *tgtdev_map;
312 /*
313 * logical block numbers for the start of each stripe
314 * The last one or two are p/q. These are sorted,
315 * so raid_map[0] is the start of our full stripe
316 */
317 u64 *raid_map;
310 struct btrfs_bio_stripe stripes[]; 318 struct btrfs_bio_stripe stripes[];
311}; 319};
312 320
@@ -388,19 +396,15 @@ struct btrfs_balance_control {
388 396
389int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, 397int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start,
390 u64 end, u64 *length); 398 u64 end, u64 *length);
391 399void btrfs_get_bbio(struct btrfs_bio *bbio);
392#define btrfs_bio_size(total_stripes, real_stripes) \ 400void btrfs_put_bbio(struct btrfs_bio *bbio);
393 (sizeof(struct btrfs_bio) + \
394 (sizeof(struct btrfs_bio_stripe) * (total_stripes)) + \
395 (sizeof(int) * (real_stripes)))
396
397int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, 401int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw,
398 u64 logical, u64 *length, 402 u64 logical, u64 *length,
399 struct btrfs_bio **bbio_ret, int mirror_num); 403 struct btrfs_bio **bbio_ret, int mirror_num);
400int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int rw, 404int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int rw,
401 u64 logical, u64 *length, 405 u64 logical, u64 *length,
402 struct btrfs_bio **bbio_ret, int mirror_num, 406 struct btrfs_bio **bbio_ret, int mirror_num,
403 u64 **raid_map_ret); 407 int need_raid_map);
404int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree, 408int btrfs_rmap_block(struct btrfs_mapping_tree *map_tree,
405 u64 chunk_start, u64 physical, u64 devid, 409 u64 chunk_start, u64 physical, u64 devid,
406 u64 **logical, int *naddrs, int *stripe_len); 410 u64 **logical, int *naddrs, int *stripe_len);