Skip to content

Commit 66812ba

Browse files
committed
btrfs: switch RCU helper versions to btrfs_err()
The RCU protection is now done in the plain helpers, we can remove the "_in_rcu" and "_rl_in_rcu". Reviewed-by: Daniel Vacek <neelx@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 446233f commit 66812ba

File tree

5 files changed

+18
-22
lines changed

5 files changed

+18
-22
lines changed

fs/btrfs/dev-replace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ static int btrfs_dev_replace_finishing(struct btrfs_fs_info *fs_info,
943943
tgt_device);
944944
} else {
945945
if (scrub_ret != -ECANCELED)
946-
btrfs_err_in_rcu(fs_info,
946+
btrfs_err(fs_info,
947947
"btrfs_scrub_dev(%s, %llu, %s) failed %d",
948948
btrfs_dev_name(src_device),
949949
src_device->devid,

fs/btrfs/messages.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
5454
*/
5555
#define btrfs_crit_in_rcu(fs_info, fmt, args...) \
5656
btrfs_printk_in_rcu(fs_info, KERN_CRIT fmt, ##args)
57-
#define btrfs_err_in_rcu(fs_info, fmt, args...) \
58-
btrfs_printk_in_rcu(fs_info, KERN_ERR fmt, ##args)
5957
#define btrfs_warn_in_rcu(fs_info, fmt, args...) \
6058
btrfs_printk_in_rcu(fs_info, KERN_WARNING fmt, ##args)
6159
#define btrfs_info_in_rcu(fs_info, fmt, args...) \
@@ -66,8 +64,6 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
6664
*/
6765
#define btrfs_crit_rl_in_rcu(fs_info, fmt, args...) \
6866
btrfs_printk_rl_in_rcu(fs_info, KERN_CRIT fmt, ##args)
69-
#define btrfs_err_rl_in_rcu(fs_info, fmt, args...) \
70-
btrfs_printk_rl_in_rcu(fs_info, KERN_ERR fmt, ##args)
7167
#define btrfs_warn_rl_in_rcu(fs_info, fmt, args...) \
7268
btrfs_printk_rl_in_rcu(fs_info, KERN_WARNING fmt, ##args)
7369
#define btrfs_info_rl_in_rcu(fs_info, fmt, args...) \

fs/btrfs/scrub.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,12 +1045,12 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx,
10451045
*/
10461046
if (repaired) {
10471047
if (dev) {
1048-
btrfs_err_rl_in_rcu(fs_info,
1048+
btrfs_err_rl(fs_info,
10491049
"scrub: fixed up error at logical %llu on dev %s physical %llu",
10501050
stripe->logical, btrfs_dev_name(dev),
10511051
physical);
10521052
} else {
1053-
btrfs_err_rl_in_rcu(fs_info,
1053+
btrfs_err_rl(fs_info,
10541054
"scrub: fixed up error at logical %llu on mirror %u",
10551055
stripe->logical, stripe->mirror_num);
10561056
}
@@ -1059,12 +1059,12 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx,
10591059

10601060
/* The remaining are all for unrepaired. */
10611061
if (dev) {
1062-
btrfs_err_rl_in_rcu(fs_info,
1062+
btrfs_err_rl(fs_info,
10631063
"scrub: unable to fixup (regular) error at logical %llu on dev %s physical %llu",
10641064
stripe->logical, btrfs_dev_name(dev),
10651065
physical);
10661066
} else {
1067-
btrfs_err_rl_in_rcu(fs_info,
1067+
btrfs_err_rl(fs_info,
10681068
"scrub: unable to fixup (regular) error at logical %llu on mirror %u",
10691069
stripe->logical, stripe->mirror_num);
10701070
}
@@ -3057,7 +3057,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
30573057
if (!is_dev_replace && !readonly &&
30583058
!test_bit(BTRFS_DEV_STATE_WRITEABLE, &dev->dev_state)) {
30593059
mutex_unlock(&fs_info->fs_devices->device_list_mutex);
3060-
btrfs_err_in_rcu(fs_info,
3060+
btrfs_err(fs_info,
30613061
"scrub: devid %llu: filesystem on %s is not writable",
30623062
devid, btrfs_dev_name(dev));
30633063
ret = -EROFS;

fs/btrfs/volumes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7795,7 +7795,7 @@ void btrfs_dev_stat_inc_and_print(struct btrfs_device *dev, int index)
77957795

77967796
if (!dev->dev_stats_valid)
77977797
return;
7798-
btrfs_err_rl_in_rcu(dev->fs_info,
7798+
btrfs_err_rl(dev->fs_info,
77997799
"bdev %s errs: wr %u, rd %u, flush %u, corrupt %u, gen %u",
78007800
btrfs_dev_name(dev),
78017801
btrfs_dev_stat_read(dev, BTRFS_DEV_STAT_WRITE_ERRS),

fs/btrfs/zoned.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static int btrfs_get_dev_zones(struct btrfs_device *device, u64 pos,
264264
ret = blkdev_report_zones(device->bdev, pos >> SECTOR_SHIFT, *nr_zones,
265265
copy_zone_info_cb, zones);
266266
if (ret < 0) {
267-
btrfs_err_in_rcu(device->fs_info,
267+
btrfs_err(device->fs_info,
268268
"zoned: failed to read zone %llu on %s (devid %llu)",
269269
pos, rcu_str_deref(device->name),
270270
device->devid);
@@ -396,14 +396,14 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
396396

397397
/* We reject devices with a zone size larger than 8GB */
398398
if (zone_info->zone_size > BTRFS_MAX_ZONE_SIZE) {
399-
btrfs_err_in_rcu(fs_info,
399+
btrfs_err(fs_info,
400400
"zoned: %s: zone size %llu larger than supported maximum %llu",
401401
rcu_str_deref(device->name),
402402
zone_info->zone_size, BTRFS_MAX_ZONE_SIZE);
403403
ret = -EINVAL;
404404
goto out;
405405
} else if (zone_info->zone_size < BTRFS_MIN_ZONE_SIZE) {
406-
btrfs_err_in_rcu(fs_info,
406+
btrfs_err(fs_info,
407407
"zoned: %s: zone size %llu smaller than supported minimum %u",
408408
rcu_str_deref(device->name),
409409
zone_info->zone_size, BTRFS_MIN_ZONE_SIZE);
@@ -419,7 +419,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
419419

420420
max_active_zones = bdev_max_active_zones(bdev);
421421
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
422-
btrfs_err_in_rcu(fs_info,
422+
btrfs_err(fs_info,
423423
"zoned: %s: max active zones %u is too small, need at least %u active zones",
424424
rcu_str_deref(device->name), max_active_zones,
425425
BTRFS_MIN_ACTIVE_ZONES);
@@ -461,7 +461,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
461461
zone_info->zone_cache = vcalloc(zone_info->nr_zones,
462462
sizeof(struct blk_zone));
463463
if (!zone_info->zone_cache) {
464-
btrfs_err_in_rcu(device->fs_info,
464+
btrfs_err(device->fs_info,
465465
"zoned: failed to allocate zone cache for %s",
466466
rcu_str_deref(device->name));
467467
ret = -ENOMEM;
@@ -498,7 +498,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
498498
}
499499

500500
if (nreported != zone_info->nr_zones) {
501-
btrfs_err_in_rcu(device->fs_info,
501+
btrfs_err(device->fs_info,
502502
"inconsistent number of zones on %s (%u/%u)",
503503
rcu_str_deref(device->name), nreported,
504504
zone_info->nr_zones);
@@ -508,7 +508,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
508508

509509
if (max_active_zones) {
510510
if (nactive > max_active_zones) {
511-
btrfs_err_in_rcu(device->fs_info,
511+
btrfs_err(device->fs_info,
512512
"zoned: %u active zones on %s exceeds max_active_zones %u",
513513
nactive, rcu_str_deref(device->name),
514514
max_active_zones);
@@ -539,7 +539,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
539539
goto out;
540540

541541
if (nr_zones != BTRFS_NR_SB_LOG_ZONES) {
542-
btrfs_err_in_rcu(device->fs_info,
542+
btrfs_err(device->fs_info,
543543
"zoned: failed to read super block log zone info at devid %llu zone %u",
544544
device->devid, sb_zone);
545545
ret = -EUCLEAN;
@@ -557,7 +557,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
557557
ret = sb_write_pointer(device->bdev,
558558
&zone_info->sb_zones[sb_pos], &sb_wp);
559559
if (ret != -ENOENT && ret) {
560-
btrfs_err_in_rcu(device->fs_info,
560+
btrfs_err(device->fs_info,
561561
"zoned: super block log zone corrupted devid %llu zone %u",
562562
device->devid, sb_zone);
563563
ret = -EUCLEAN;
@@ -1346,7 +1346,7 @@ static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx,
13461346
}
13471347

13481348
if (zone.type == BLK_ZONE_TYPE_CONVENTIONAL) {
1349-
btrfs_err_in_rcu(fs_info,
1349+
btrfs_err(fs_info,
13501350
"zoned: unexpected conventional zone %llu on device %s (devid %llu)",
13511351
zone.start << SECTOR_SHIFT, rcu_str_deref(device->name),
13521352
device->devid);
@@ -1359,7 +1359,7 @@ static int btrfs_load_zone_info(struct btrfs_fs_info *fs_info, int zone_idx,
13591359
switch (zone.cond) {
13601360
case BLK_ZONE_COND_OFFLINE:
13611361
case BLK_ZONE_COND_READONLY:
1362-
btrfs_err_in_rcu(fs_info,
1362+
btrfs_err(fs_info,
13631363
"zoned: offline/readonly zone %llu on device %s (devid %llu)",
13641364
(info->physical >> device->zone_info->zone_size_shift),
13651365
rcu_str_deref(device->name), device->devid);

0 commit comments

Comments
 (0)