Skip to content

Commit 82ba66d

Browse files
committed
btrfs: switch RCU helper versions to btrfs_warn()
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 66812ba commit 82ba66d

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

fs/btrfs/dev-replace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ static int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
600600
return PTR_ERR(src_device);
601601

602602
if (btrfs_pinned_by_swapfile(fs_info, src_device)) {
603-
btrfs_warn_in_rcu(fs_info,
603+
btrfs_warn(fs_info,
604604
"cannot replace device %s (devid %llu) due to active swapfile",
605605
btrfs_dev_name(src_device), src_device->devid);
606606
return -ETXTBSY;

fs/btrfs/disk-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3695,7 +3695,7 @@ static void btrfs_end_super_write(struct bio *bio)
36953695

36963696
bio_for_each_folio_all(fi, bio) {
36973697
if (bio->bi_status) {
3698-
btrfs_warn_rl_in_rcu(device->fs_info,
3698+
btrfs_warn_rl(device->fs_info,
36993699
"lost super block write due to IO error on %s (%d)",
37003700
btrfs_dev_name(device),
37013701
blk_status_to_errno(bio->bi_status));

fs/btrfs/extent-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6449,7 +6449,7 @@ static int btrfs_trim_free_extents(struct btrfs_device *device, u64 *trimmed)
64496449
/* Check if there are any CHUNK_* bits left */
64506450
if (start > device->total_bytes) {
64516451
DEBUG_WARN();
6452-
btrfs_warn_in_rcu(fs_info,
6452+
btrfs_warn(fs_info,
64536453
"ignoring attempt to trim beyond device size: offset %llu length %llu device %s device size %llu",
64546454
start, end - start + 1,
64556455
btrfs_dev_name(device),

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_warn_in_rcu(fs_info, fmt, args...) \
58-
btrfs_printk_in_rcu(fs_info, KERN_WARNING fmt, ##args)
5957
#define btrfs_info_in_rcu(fs_info, fmt, args...) \
6058
btrfs_printk_in_rcu(fs_info, KERN_INFO fmt, ##args)
6159

@@ -64,8 +62,6 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
6462
*/
6563
#define btrfs_crit_rl_in_rcu(fs_info, fmt, args...) \
6664
btrfs_printk_rl_in_rcu(fs_info, KERN_CRIT fmt, ##args)
67-
#define btrfs_warn_rl_in_rcu(fs_info, fmt, args...) \
68-
btrfs_printk_rl_in_rcu(fs_info, KERN_WARNING fmt, ##args)
6965
#define btrfs_info_rl_in_rcu(fs_info, fmt, args...) \
7066
btrfs_printk_rl_in_rcu(fs_info, KERN_INFO fmt, ##args)
7167

fs/btrfs/scrub.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 num_bytes,
556556
* hold all of the paths here
557557
*/
558558
for (i = 0; i < ipath->fspath->elem_cnt; ++i)
559-
btrfs_warn_in_rcu(fs_info,
559+
btrfs_warn(fs_info,
560560
"scrub: %s at logical %llu on dev %s, physical %llu root %llu inode %llu offset %llu length %u links %u (path: %s)",
561561
swarn->errstr, swarn->logical,
562562
btrfs_dev_name(swarn->dev),
@@ -570,7 +570,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 num_bytes,
570570
return 0;
571571

572572
err:
573-
btrfs_warn_in_rcu(fs_info,
573+
btrfs_warn(fs_info,
574574
"scrub: %s at logical %llu on dev %s, physical %llu root %llu inode %llu offset %llu: path resolving failed with ret=%d",
575575
swarn->errstr, swarn->logical,
576576
btrfs_dev_name(swarn->dev),
@@ -596,7 +596,7 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device *
596596

597597
/* Super block error, no need to search extent tree. */
598598
if (is_super) {
599-
btrfs_warn_in_rcu(fs_info, "scrub: %s on device %s, physical %llu",
599+
btrfs_warn(fs_info, "scrub: %s on device %s, physical %llu",
600600
errstr, btrfs_dev_name(dev), physical);
601601
return;
602602
}
@@ -637,7 +637,7 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device *
637637
}
638638
if (ret > 0)
639639
break;
640-
btrfs_warn_in_rcu(fs_info,
640+
btrfs_warn(fs_info,
641641
"scrub: %s at logical %llu on dev %s, physical %llu: metadata %s (level %d) in tree %llu",
642642
errstr, swarn.logical, btrfs_dev_name(dev),
643643
swarn.physical, (ref_level ? "node" : "leaf"),

fs/btrfs/volumes.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ static noinline struct btrfs_device *device_list_add(const char *path,
944944
if (device->bdev) {
945945
if (device->devt != path_devt) {
946946
mutex_unlock(&fs_devices->device_list_mutex);
947-
btrfs_warn_in_rcu(NULL,
947+
btrfs_warn(NULL,
948948
"duplicate device %s devid %llu generation %llu scanned by %s (%d)",
949949
path, devid, found_transid,
950950
current->comm,
@@ -2205,7 +2205,7 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info,
22052205
}
22062206

22072207
if (btrfs_pinned_by_swapfile(fs_info, device)) {
2208-
btrfs_warn_in_rcu(fs_info,
2208+
btrfs_warn(fs_info,
22092209
"cannot remove device %s (devid %llu) due to active swapfile",
22102210
btrfs_dev_name(device), device->devid);
22112211
return -ETXTBSY;
@@ -7707,7 +7707,7 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
77077707
return -ENOMEM;
77087708
ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1);
77097709
if (ret < 0) {
7710-
btrfs_warn_in_rcu(fs_info,
7710+
btrfs_warn(fs_info,
77117711
"error %d while searching for dev_stats item for device %s",
77127712
ret, btrfs_dev_name(device));
77137713
goto out;
@@ -7718,7 +7718,7 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
77187718
/* need to delete old one and insert a new one */
77197719
ret = btrfs_del_item(trans, dev_root, path);
77207720
if (ret != 0) {
7721-
btrfs_warn_in_rcu(fs_info,
7721+
btrfs_warn(fs_info,
77227722
"delete too small dev_stats item for device %s failed %d",
77237723
btrfs_dev_name(device), ret);
77247724
goto out;
@@ -7732,7 +7732,7 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
77327732
ret = btrfs_insert_empty_item(trans, dev_root, path,
77337733
&key, sizeof(*ptr));
77347734
if (ret < 0) {
7735-
btrfs_warn_in_rcu(fs_info,
7735+
btrfs_warn(fs_info,
77367736
"insert dev_stats item for device %s failed %d",
77377737
btrfs_dev_name(device), ret);
77387738
goto out;

fs/btrfs/zoned.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ int btrfs_ensure_empty_zones(struct btrfs_device *device, u64 start, u64 size)
11831183
continue;
11841184

11851185
/* Free regions should be empty */
1186-
btrfs_warn_in_rcu(
1186+
btrfs_warn(
11871187
device->fs_info,
11881188
"zoned: resetting device %s (devid %llu) zone %llu for allocation",
11891189
rcu_str_deref(device->name), device->devid, pos >> shift);

0 commit comments

Comments
 (0)