diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-12-15 05:18:09 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2016-01-19 21:43:45 -0500 |
commit | ad1ba2a0c453db255f04b17101db6d05c44d8467 (patch) | |
tree | 76b4b001d9c01a6bd8376fd851266bad6256f250 /fs | |
parent | 94a97dfeb61e32a213ca5519b063076c5201c5b2 (diff) |
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')
-rw-r--r-- | fs/btrfs/volumes.c | 3 |
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, | |||
6068 | bbio->fs_info = root->fs_info; | 6068 | bbio->fs_info = root->fs_info; |
6069 | atomic_set(&bbio->stripes_pending, bbio->num_stripes); | 6069 | atomic_set(&bbio->stripes_pending, bbio->num_stripes); |
6070 | 6070 | ||
6071 | if (bbio->raid_map) { | 6071 | if ((bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK) && |
6072 | ((rw & WRITE) || (mirror_num > 1))) { | ||
6072 | /* In this case, map_length has been set to the length of | 6073 | /* In this case, map_length has been set to the length of |
6073 | a single stripe; not the whole write */ | 6074 | a single stripe; not the whole write */ |
6074 | if (rw & WRITE) { | 6075 | if (rw & WRITE) { |