]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove struct rcu_string
authorDavid Sterba <dsterba@suse.com>
Wed, 25 Jun 2025 13:37:26 +0000 (15:37 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 22:09:21 +0000 (00:09 +0200)
The only use for device name has been removed so we can kill the RCU
string API.

Reviewed-by: Daniel Vacek <neelx@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/rcu-string.h [deleted file]
fs/btrfs/volumes.c
fs/btrfs/volumes.h
fs/btrfs/zoned.c

diff --git a/fs/btrfs/rcu-string.h b/fs/btrfs/rcu-string.h
deleted file mode 100644 (file)
index 70b1e19..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (C) 2012 Red Hat.  All rights reserved.
- */
-
-#ifndef BTRFS_RCU_STRING_H
-#define BTRFS_RCU_STRING_H
-
-#include <linux/types.h>
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/rcupdate.h>
-#include <linux/printk.h>
-
-struct rcu_string {
-       struct rcu_head rcu;
-       char str[];
-};
-
-static inline struct rcu_string *rcu_string_strdup(const char *src, gfp_t mask)
-{
-       size_t len = strlen(src) + 1;
-       struct rcu_string *ret = kzalloc(sizeof(struct rcu_string) +
-                                        (len * sizeof(char)), mask);
-       if (!ret)
-               return ret;
-       /* Warn if the source got unexpectedly truncated. */
-       if (WARN_ON(strscpy(ret->str, src, len) < 0)) {
-               kfree(ret);
-               return NULL;
-       }
-       return ret;
-}
-
-#define rcu_str_deref(rcu_str) ({                              \
-       struct rcu_string *__str = rcu_dereference(rcu_str);    \
-       __str->str;                                             \
-})
-
-#endif
index c026bb8b51feb9de4acd4c4e6c7d19b5b6696039..31aecd291d6cc6f905b1d2baecffca75d71b184d 100644 (file)
@@ -18,7 +18,6 @@
 #include "transaction.h"
 #include "volumes.h"
 #include "raid56.h"
-#include "rcu-string.h"
 #include "dev-replace.h"
 #include "sysfs.h"
 #include "tree-checker.h"
index 860d1823c6e0ffd30a2c33be24ef5977d4afcacb..c2c28c71b0da093d213d0e0c317c5d6ee9f91548 100644 (file)
@@ -21,7 +21,6 @@
 #include <uapi/linux/btrfs.h>
 #include <uapi/linux/btrfs_tree.h>
 #include "messages.h"
-#include "rcu-string.h"
 #include "extent-io-tree.h"
 
 struct block_device;
index 27264db4b7cac82e14bb1294aa729ddd9e53c7e2..245e813ecd785a337dbfa5384634e3f4cb864ad2 100644 (file)
@@ -9,7 +9,6 @@
 #include "ctree.h"
 #include "volumes.h"
 #include "zoned.h"
-#include "rcu-string.h"
 #include "disk-io.h"
 #include "block-group.h"
 #include "dev-replace.h"