diff options
author | Zhao Lei <zhaolei@cn.fujitsu.com> | 2015-01-20 02:11:36 -0500 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-01-21 21:06:48 -0500 |
commit | 114ab50d823c2cc7cf60658fdbdaaba413009921 (patch) | |
tree | bb82e810c5874874bf5266e41078aac665d48064 /fs | |
parent | b25c94c580c27bb6cff1e2f478746e77119215ad (diff) |
Btrfs: Remove noneed force_write in scrub_write_block_to_dev_replace
It is always 1 in this place, because !1 case was already jumped
out in previous code.
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/scrub.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 016512c590ea..f9e108bdfc45 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -250,8 +250,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, | |||
250 | const u8 *csum, u64 generation, | 250 | const u8 *csum, u64 generation, |
251 | u16 csum_size); | 251 | u16 csum_size); |
252 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, | 252 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, |
253 | struct scrub_block *sblock_good, | 253 | struct scrub_block *sblock_good); |
254 | int force_write); | ||
255 | static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, | 254 | static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, |
256 | struct scrub_block *sblock_good, | 255 | struct scrub_block *sblock_good, |
257 | int page_num, int force_write); | 256 | int page_num, int force_write); |
@@ -1098,15 +1097,13 @@ nodatasum_case: | |||
1098 | sblock_other->no_io_error_seen) { | 1097 | sblock_other->no_io_error_seen) { |
1099 | if (sctx->is_dev_replace) { | 1098 | if (sctx->is_dev_replace) { |
1100 | scrub_write_block_to_dev_replace(sblock_other); | 1099 | scrub_write_block_to_dev_replace(sblock_other); |
1100 | goto corrected_error; | ||
1101 | } else { | 1101 | } else { |
1102 | int force_write = is_metadata || have_csum; | ||
1103 | |||
1104 | ret = scrub_repair_block_from_good_copy( | 1102 | ret = scrub_repair_block_from_good_copy( |
1105 | sblock_bad, sblock_other, | 1103 | sblock_bad, sblock_other); |
1106 | force_write); | 1104 | if (!ret) |
1105 | goto corrected_error; | ||
1107 | } | 1106 | } |
1108 | if (0 == ret) | ||
1109 | goto corrected_error; | ||
1110 | } | 1107 | } |
1111 | } | 1108 | } |
1112 | 1109 | ||
@@ -1619,8 +1616,7 @@ static void scrub_recheck_block_checksum(struct btrfs_fs_info *fs_info, | |||
1619 | } | 1616 | } |
1620 | 1617 | ||
1621 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, | 1618 | static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, |
1622 | struct scrub_block *sblock_good, | 1619 | struct scrub_block *sblock_good) |
1623 | int force_write) | ||
1624 | { | 1620 | { |
1625 | int page_num; | 1621 | int page_num; |
1626 | int ret = 0; | 1622 | int ret = 0; |
@@ -1630,8 +1626,7 @@ static int scrub_repair_block_from_good_copy(struct scrub_block *sblock_bad, | |||
1630 | 1626 | ||
1631 | ret_sub = scrub_repair_page_from_good_copy(sblock_bad, | 1627 | ret_sub = scrub_repair_page_from_good_copy(sblock_bad, |
1632 | sblock_good, | 1628 | sblock_good, |
1633 | page_num, | 1629 | page_num, 1); |
1634 | force_write); | ||
1635 | if (ret_sub) | 1630 | if (ret_sub) |
1636 | ret = ret_sub; | 1631 | ret = ret_sub; |
1637 | } | 1632 | } |