Skip to content

Commit e37abe9

Browse files
committed
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>
1 parent 7fb2ece commit e37abe9

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

‎fs/btrfs/dev-replace.h‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,4 @@ void btrfs_dev_replace_write_lock(struct btrfs_dev_replace *dev_replace);
2929
void btrfs_dev_replace_write_unlock(struct btrfs_dev_replace *dev_replace);
3030
void btrfs_dev_replace_set_lock_blocking(struct btrfs_dev_replace *dev_replace);
3131

32-
static inline void btrfs_dev_replace_stats_inc(atomic64_t *stat_value)
33-
{
34-
atomic64_inc(stat_value);
35-
}
36-
3732
#endif

‎fs/btrfs/scrub.c‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ static int scrub_handle_errored_block(struct scrub_block *sblock_to_check)
11241124

11251125
if (scrub_write_page_to_dev_replace(sblock_other,
11261126
page_num) != 0) {
1127-
btrfs_dev_replace_stats_inc(
1127+
atomic64_inc(
11281128
&fs_info->dev_replace.num_write_errors);
11291129
success = 0;
11301130
}
@@ -1564,8 +1564,7 @@ static int scrub_repair_page_from_good_copy(struct scrub_block *sblock_bad,
15641564
if (btrfsic_submit_bio_wait(bio)) {
15651565
btrfs_dev_stat_inc_and_print(page_bad->dev,
15661566
BTRFS_DEV_STAT_WRITE_ERRS);
1567-
btrfs_dev_replace_stats_inc(
1568-
&fs_info->dev_replace.num_write_errors);
1567+
atomic64_inc(&fs_info->dev_replace.num_write_errors);
15691568
bio_put(bio);
15701569
return -EIO;
15711570
}
@@ -1592,8 +1591,7 @@ static void scrub_write_block_to_dev_replace(struct scrub_block *sblock)
15921591

15931592
ret = scrub_write_page_to_dev_replace(sblock, page_num);
15941593
if (ret)
1595-
btrfs_dev_replace_stats_inc(
1596-
&fs_info->dev_replace.num_write_errors);
1594+
atomic64_inc(&fs_info->dev_replace.num_write_errors);
15971595
}
15981596
}
15991597

@@ -1726,8 +1724,7 @@ static void scrub_wr_bio_end_io_worker(struct btrfs_work *work)
17261724
struct scrub_page *spage = sbio->pagev[i];
17271725

17281726
spage->io_error = 1;
1729-
btrfs_dev_replace_stats_inc(&dev_replace->
1730-
num_write_errors);
1727+
atomic64_inc(&dev_replace->num_write_errors);
17311728
}
17321729
}
17331730

0 commit comments

Comments
 (0)