From: David Sterba Date: Wed, 25 Jun 2025 13:37:26 +0000 (+0200) Subject: btrfs: remove struct rcu_string X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c76841362f66915a878c3a13ed74675e0e4af43e;p=thirdparty%2Flinux.git btrfs: remove struct rcu_string The only use for device name has been removed so we can kill the RCU string API. Reviewed-by: Daniel Vacek Signed-off-by: David Sterba --- diff --git a/fs/btrfs/rcu-string.h b/fs/btrfs/rcu-string.h deleted file mode 100644 index 70b1e19b50e66..0000000000000 --- a/fs/btrfs/rcu-string.h +++ /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 -#include -#include -#include -#include - -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 diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c026bb8b51feb..31aecd291d6cc 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -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" diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 860d1823c6e0f..c2c28c71b0da0 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h @@ -21,7 +21,6 @@ #include #include #include "messages.h" -#include "rcu-string.h" #include "extent-io-tree.h" struct block_device; diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index 27264db4b7cac..245e813ecd785 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -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"