summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
authorZhao Lei2015-12-15 11:18:09 +0100
committerChris Mason2016-01-20 03:43:45 +0100
commitad1ba2a0c453db255f04b17101db6d05c44d8467 (patch)
tree76b4b001d9c01a6bd8376fd851266bad6256f250 /fs/btrfs/volumes.c
parentbtrfs: Small cleanup for get index_srcdev loop (diff)
downloadkernel-qcow2-linux-ad1ba2a0c453db255f04b17101db6d05c44d8467.tar.gz
kernel-qcow2-linux-ad1ba2a0c453db255f04b17101db6d05c44d8467.tar.xz
kernel-qcow2-linux-ad1ba2a0c453db255f04b17101db6d05c44d8467.zip
btrfs: Use direct way to determine raid56 write/recover mode
Old code used bbio->raid_map to determine whether in raid56 write/recover operation, because we didn't't have bbio->map_type. Now we have direct way for this condition, rid of using the function-relative data, and make the code more readable. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 7a769ca04f3f..366b335946fa 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6068,7 +6068,8 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
bbio->fs_info = root->fs_info;
atomic_set(&bbio->stripes_pending, bbio->num_stripes);
- if (bbio->raid_map) {
+ if ((bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) &&
+ ((rw & WRITE) || (mirror_num > 1))) {
/* In this case, map_length has been set to the length of
a single stripe; not the whole write */
if (rw & WRITE) {