btrfs: switch RCU helper versions to btrfs_warn()
authorDavid Sterba <dsterba@suse.com>
Mon, 9 Jun 2025 17:09:26 +0000 (19:09 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:56:38 +0000 (23:56 +0200)
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>
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/messages.h
fs/btrfs/scrub.c
fs/btrfs/volumes.c
fs/btrfs/zoned.c

index 0e9acedd7bb4673f9a7512b806d37eb6f460bb48..f7f024a956cdda8bf6f4dfae00bb14e1340d57dc 100644 (file)
@@ -600,7 +600,7 @@ static int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info,
                return PTR_ERR(src_device);
 
        if (btrfs_pinned_by_swapfile(fs_info, src_device)) {
-               btrfs_warn_in_rcu(fs_info,
+               btrfs_warn(fs_info,
          "cannot replace device %s (devid %llu) due to active swapfile",
                        btrfs_dev_name(src_device), src_device->devid);
                return -ETXTBSY;
index 4cfcd879dc5eb72a534d5c36028263d3fb00b2df..ee3cdd7035cc237f2ff832c7329e16f5c7e38519 100644 (file)
@@ -3695,7 +3695,7 @@ static void btrfs_end_super_write(struct bio *bio)
 
        bio_for_each_folio_all(fi, bio) {
                if (bio->bi_status) {
-                       btrfs_warn_rl_in_rcu(device->fs_info,
+                       btrfs_warn_rl(device->fs_info,
                                "lost super block write due to IO error on %s (%d)",
                                btrfs_dev_name(device),
                                blk_status_to_errno(bio->bi_status));
index f1ac6a8dd9f455a2e87dfe4b0d74df3afc75edb1..b227c4690e5d630b6d62a749fe8b7f278281ac56 100644 (file)
@@ -6449,7 +6449,7 @@ static int btrfs_trim_free_extents(struct btrfs_device *device, u64 *trimmed)
                /* Check if there are any CHUNK_* bits left */
                if (start > device->total_bytes) {
                        DEBUG_WARN();
-                       btrfs_warn_in_rcu(fs_info,
+                       btrfs_warn(fs_info,
 "ignoring attempt to trim beyond device size: offset %llu length %llu device %s device size %llu",
                                          start, end - start + 1,
                                          btrfs_dev_name(device),
index f9f68a2a7697920c3644cededa8e624720a72d18..0520081a66f0f6f638fe75ff15c7bbe467b01e7a 100644 (file)
@@ -54,8 +54,6 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
  */
 #define btrfs_crit_in_rcu(fs_info, fmt, args...) \
        btrfs_printk_in_rcu(fs_info, KERN_CRIT fmt, ##args)
-#define btrfs_warn_in_rcu(fs_info, fmt, args...) \
-       btrfs_printk_in_rcu(fs_info, KERN_WARNING fmt, ##args)
 #define btrfs_info_in_rcu(fs_info, fmt, args...) \
        btrfs_printk_in_rcu(fs_info, KERN_INFO fmt, ##args)
 
@@ -64,8 +62,6 @@ void _btrfs_printk(const struct btrfs_fs_info *fs_info, const char *fmt, ...);
  */
 #define btrfs_crit_rl_in_rcu(fs_info, fmt, args...) \
        btrfs_printk_rl_in_rcu(fs_info, KERN_CRIT fmt, ##args)
-#define btrfs_warn_rl_in_rcu(fs_info, fmt, args...) \
-       btrfs_printk_rl_in_rcu(fs_info, KERN_WARNING fmt, ##args)
 #define btrfs_info_rl_in_rcu(fs_info, fmt, args...) \
        btrfs_printk_rl_in_rcu(fs_info, KERN_INFO fmt, ##args)
 
index 04c43f05afc9faad13e1b9e711765feb86ef701e..6776e6ab8d108055b0961a5996e5ea9f889c5845 100644 (file)
@@ -556,7 +556,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 num_bytes,
         * hold all of the paths here
         */
        for (i = 0; i < ipath->fspath->elem_cnt; ++i)
-               btrfs_warn_in_rcu(fs_info,
+               btrfs_warn(fs_info,
 "scrub: %s at logical %llu on dev %s, physical %llu root %llu inode %llu offset %llu length %u links %u (path: %s)",
                                  swarn->errstr, swarn->logical,
                                  btrfs_dev_name(swarn->dev),
@@ -570,7 +570,7 @@ static int scrub_print_warning_inode(u64 inum, u64 offset, u64 num_bytes,
        return 0;
 
 err:
-       btrfs_warn_in_rcu(fs_info,
+       btrfs_warn(fs_info,
                          "scrub: %s at logical %llu on dev %s, physical %llu root %llu inode %llu offset %llu: path resolving failed with ret=%d",
                          swarn->errstr, swarn->logical,
                          btrfs_dev_name(swarn->dev),
@@ -596,7 +596,7 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device *
 
        /* Super block error, no need to search extent tree. */
        if (is_super) {
-               btrfs_warn_in_rcu(fs_info, "scrub: %s on device %s, physical %llu",
+               btrfs_warn(fs_info, "scrub: %s on device %s, physical %llu",
                                  errstr, btrfs_dev_name(dev), physical);
                return;
        }
@@ -637,7 +637,7 @@ static void scrub_print_common_warning(const char *errstr, struct btrfs_device *
                        }
                        if (ret > 0)
                                break;
-                       btrfs_warn_in_rcu(fs_info,
+                       btrfs_warn(fs_info,
 "scrub: %s at logical %llu on dev %s, physical %llu: metadata %s (level %d) in tree %llu",
                                errstr, swarn.logical, btrfs_dev_name(dev),
                                swarn.physical, (ref_level ? "node" : "leaf"),
index a0aec28f869a0991838a88b6632b3df2fb672fb4..202c3e044460c13adb32a2df1fc166adea9110dc 100644 (file)
@@ -944,7 +944,7 @@ static noinline struct btrfs_device *device_list_add(const char *path,
                if (device->bdev) {
                        if (device->devt != path_devt) {
                                mutex_unlock(&fs_devices->device_list_mutex);
-                               btrfs_warn_in_rcu(NULL,
+                               btrfs_warn(NULL,
        "duplicate device %s devid %llu generation %llu scanned by %s (%d)",
                                                  path, devid, found_transid,
                                                  current->comm,
@@ -2205,7 +2205,7 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info,
        }
 
        if (btrfs_pinned_by_swapfile(fs_info, device)) {
-               btrfs_warn_in_rcu(fs_info,
+               btrfs_warn(fs_info,
                  "cannot remove device %s (devid %llu) due to active swapfile",
                                  btrfs_dev_name(device), device->devid);
                return -ETXTBSY;
@@ -7707,7 +7707,7 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
                return -ENOMEM;
        ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1);
        if (ret < 0) {
-               btrfs_warn_in_rcu(fs_info,
+               btrfs_warn(fs_info,
                        "error %d while searching for dev_stats item for device %s",
                                  ret, btrfs_dev_name(device));
                goto out;
@@ -7718,7 +7718,7 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
                /* need to delete old one and insert a new one */
                ret = btrfs_del_item(trans, dev_root, path);
                if (ret != 0) {
-                       btrfs_warn_in_rcu(fs_info,
+                       btrfs_warn(fs_info,
                                "delete too small dev_stats item for device %s failed %d",
                                          btrfs_dev_name(device), ret);
                        goto out;
@@ -7732,7 +7732,7 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
                ret = btrfs_insert_empty_item(trans, dev_root, path,
                                              &key, sizeof(*ptr));
                if (ret < 0) {
-                       btrfs_warn_in_rcu(fs_info,
+                       btrfs_warn(fs_info,
                                "insert dev_stats item for device %s failed %d",
                                btrfs_dev_name(device), ret);
                        goto out;
index 157ee6828f35f3ae507ffe828c55e5dad9b2fad6..da1cf75c5ecf27efc84df04db86a09edfa16a1d8 100644 (file)
@@ -1183,7 +1183,7 @@ int btrfs_ensure_empty_zones(struct btrfs_device *device, u64 start, u64 size)
                        continue;
 
                /* Free regions should be empty */
-               btrfs_warn_in_rcu(
+               btrfs_warn(
                        device->fs_info,
                "zoned: resetting device %s (devid %llu) zone %llu for allocation",
                        rcu_str_deref(device->name), device->devid, pos >> shift);