diff options
author | David Sterba <dsterba@suse.com> | 2016-11-30 14:02:20 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-11-30 14:02:20 +0100 |
commit | 515bdc479097ec9d5f389202842345af3162f71c (patch) | |
tree | 46b5ed6bfe2a969c3725a3917426730a3b59715b /fs/btrfs/volumes.h | |
parent | e5517c2a5a49ed5e99047008629f1cd60246ea0e (diff) | |
parent | 1d57ee941692d0cc928526e21a1557b2ae3e11db (diff) | |
download | lwn-515bdc479097ec9d5f389202842345af3162f71c.tar.gz lwn-515bdc479097ec9d5f389202842345af3162f71c.zip |
Merge branch 'misc-4.10' into for-chris-4.10-20161130
Diffstat (limited to 'fs/btrfs/volumes.h')
-rw-r--r-- | fs/btrfs/volumes.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 09ed29c67848..9029a3134922 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -371,14 +371,35 @@ struct btrfs_balance_control { struct btrfs_balance_progress stat; }; +enum btrfs_map_op { + BTRFS_MAP_READ, + BTRFS_MAP_WRITE, + BTRFS_MAP_DISCARD, + BTRFS_MAP_GET_READ_MIRRORS, +}; + +static inline enum btrfs_map_op btrfs_op(struct bio *bio) +{ + switch (bio_op(bio)) { + case REQ_OP_DISCARD: + return BTRFS_MAP_DISCARD; + case REQ_OP_WRITE: + return BTRFS_MAP_WRITE; + default: + WARN_ON_ONCE(1); + case REQ_OP_READ: + return BTRFS_MAP_READ; + } +} + int btrfs_account_dev_extents_size(struct btrfs_device *device, u64 start, u64 end, u64 *length); void btrfs_get_bbio(struct btrfs_bio *bbio); void btrfs_put_bbio(struct btrfs_bio *bbio); -int btrfs_map_block(struct btrfs_fs_info *fs_info, int op, +int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op, u64 logical, u64 *length, struct btrfs_bio **bbio_ret, int mirror_num); -int btrfs_map_sblock(struct btrfs_fs_info *fs_info, int op, +int btrfs_map_sblock(struct btrfs_fs_info *fs_info, enum btrfs_map_op op, u64 logical, u64 *length, struct btrfs_bio **bbio_ret, int mirror_num, int need_raid_map); |