summaryrefslogtreecommitdiff
path: root/fs/btrfs/rcu-string.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2025-06-25 15:37:26 +0200
committerDavid Sterba <dsterba@suse.com>2025-07-22 00:09:21 +0200
commitc76841362f66915a878c3a13ed74675e0e4af43e (patch)
treee2c49c985af56f4c98a7d18f65831627f1ec52ea /fs/btrfs/rcu-string.h
parente8d58aef119aeb8f45898adbf6ce0385b8a056c2 (diff)
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 <neelx@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/rcu-string.h')
-rw-r--r--fs/btrfs/rcu-string.h40
1 files changed, 0 insertions, 40 deletions
diff --git a/fs/btrfs/rcu-string.h b/fs/btrfs/rcu-string.h
deleted file mode 100644
index 70b1e19b50e6..000000000000
--- 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 <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