diff options
author | David Sterba <dsterba@suse.com> | 2018-04-04 11:20:52 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-10-15 11:23:37 -0400 |
commit | e37abe9725bf45b292d5653cc02bbd791773c205 (patch) | |
tree | 280290e199d4d1395993fc807d9f4c4ac7ccfa06 | |
parent | 7fb2eced105f67676eb86473d5b1ce6a96f6eab4 (diff) |
btrfs: open code btrfs_dev_replace_stats_inc
The wrapper is too trivial, open coding does not make it less readable.
Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/dev-replace.h | 5 | ||||
-rw-r--r-- | fs/btrfs/scrub.c | 11 |
2 files changed, 4 insertions, 12 deletions
diff --git a/fs/btrfs/dev-replace.h b/fs/btrfs/dev-replace.h index 39f022c457ff..1c91bf9ef39a 100644 --- a/fs/btrfs/dev-replace.h +++ b/fs/btrfs/dev-replace.h | |||
@@ -29,9 +29,4 @@ void btrfs_dev_replace_write_lock(struct btrfs_dev_replace *dev_replace); | |||
29 | void btrfs_dev_replace_write_unlock(struct btrfs_dev_replace *dev_replace); | 29 | void btrfs_dev_replace_write_unlock(struct btrfs_dev_replace *dev_replace); |
30 | void btrfs_dev_replace_set_lock_blocking(struct btrfs_dev_replace *dev_replace); | 30 | void btrfs_dev_replace_set_lock_blocking(struct btrfs_dev_replace *dev_replace); |
31 | 31 | ||
32 | static inline void btrfs_dev_replace_stats_inc(atomic64_t *stat_value) | ||
33 | { | ||
34 | atomic64_inc(stat_value); | ||
35 | } | ||
36 | |||
37 | #endif | 32 | #endif |
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index 4bcc275f7612..902819d3cf41 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c | |||
@@ -1124,7 +1124,7 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check) | |||
1124 | 1124 | ||
1125 | if (scrub_write_page_to_dev_replace(sblock_other, | 1125 | if (scrub_write_page_to_dev_replace(sblock_other, |
1126 | page_num) != 0) { | 1126 | page_num) != 0) { |
1127 | btrfs_dev_replace_stats_inc( | 1127 | atomic64_inc( |
1128 | &fs_info->dev_replace.num_write_errors); | 1128 | &fs_info->dev_replace.num_write_errors); |
1129 | success = 0; | 1129 | success = 0; |
1130 | } | 1130 | } |
@@ -1564,8 +1564,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad, | |||
1564 | if (btrfsic_submit_bio_wait(bio)) { | 1564 | if (btrfsic_submit_bio_wait(bio)) { |
1565 | btrfs_dev_stat_inc_and_print(page_bad->dev, | 1565 | btrfs_dev_stat_inc_and_print(page_bad->dev, |
1566 | BTRFS_DEV_STAT_WRITE_ERRS); | 1566 | BTRFS_DEV_STAT_WRITE_ERRS); |
1567 | btrfs_dev_replace_stats_inc( | 1567 | atomic64_inc(&fs_info->dev_replace.num_write_errors); |
1568 | &fs_info->dev_replace.num_write_errors); | ||
1569 | bio_put(bio); | 1568 | bio_put(bio); |
1570 | return -EIO; | 1569 | return -EIO; |
1571 | } | 1570 | } |
@@ -1592,8 +1591,7 @@ static void scrub_write_block_to_dev_replace(struct scrub_block *sblock) | |||
1592 | 1591 | ||
1593 | ret = scrub_write_page_to_dev_replace(sblock, page_num); | 1592 | ret = scrub_write_page_to_dev_replace(sblock, page_num); |
1594 | if (ret) | 1593 | if (ret) |
1595 | btrfs_dev_replace_stats_inc( | 1594 | atomic64_inc(&fs_info->dev_replace.num_write_errors); |
1596 | &fs_info->dev_replace.num_write_errors); | ||
1597 | } | 1595 | } |
1598 | } | 1596 | } |
1599 | 1597 | ||
@@ -1726,8 +1724,7 @@ static void scrub_wr_bio_end_io_worker(struct btrfs_work *work) | |||
1726 | struct scrub_page *spage = sbio->pagev[i]; | 1724 | struct scrub_page *spage = sbio->pagev[i]; |
1727 | 1725 | ||
1728 | spage->io_error = 1; | 1726 | spage->io_error = 1; |
1729 | btrfs_dev_replace_stats_inc(&dev_replace-> | 1727 | atomic64_inc(&dev_replace->num_write_errors); |
1730 | num_write_errors); | ||
1731 | } | 1728 | } |
1732 | } | 1729 | } |
1733 | 1730 | ||