summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-04-30 21:30:35 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-08 23:29:22 +0200
commit23f308ae19d345c8fc022edc5aae9a0af172ad73 (patch)
tree4f2c3e66e5c51896a707fed16ead89403119122a /fs
parentbcachefs: Debug asserts for ca->ref (diff)
downloadlinux-23f308ae19d345c8fc022edc5aae9a0af172ad73.tar.xz
linux-23f308ae19d345c8fc022edc5aae9a0af172ad73.zip
bcachefs: bch2_dev_safe() -> bch2_dev_rcu()
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs')
-rw-r--r--fs/bcachefs/extents.c2
-rw-r--r--fs/bcachefs/sb-members.c1
-rw-r--r--fs/bcachefs/sb-members.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 0d1473ba584a..6376440f6f30 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -983,7 +983,7 @@ void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *c, const struc
{
out->atomic++;
rcu_read_lock();
- struct bch_dev *ca = bch2_dev_safe(c, ptr->dev);
+ struct bch_dev *ca = bch2_dev_rcu(c, ptr->dev);
if (!ca) {
prt_printf(out, "ptr: %u:%llu gen %u%s", ptr->dev,
(u64) ptr->offset, ptr->gen,
diff --git a/fs/bcachefs/sb-members.c b/fs/bcachefs/sb-members.c
index 52054f26982f..96a49ad0525c 100644
--- a/fs/bcachefs/sb-members.c
+++ b/fs/bcachefs/sb-members.c
@@ -3,6 +3,7 @@
#include "bcachefs.h"
#include "btree_cache.h"
#include "disk_groups.h"
+#include "error.h"
#include "opts.h"
#include "replicas.h"
#include "sb-members.h"
diff --git a/fs/bcachefs/sb-members.h b/fs/bcachefs/sb-members.h
index ecb8284af0de..bea4c2efbb6e 100644
--- a/fs/bcachefs/sb-members.h
+++ b/fs/bcachefs/sb-members.h
@@ -210,7 +210,7 @@ static inline struct bch_dev *bch2_dev_locked(struct bch_fs *c, unsigned dev)
lockdep_is_held(&c->state_lock));
}
-static inline struct bch_dev *bch2_dev_safe(struct bch_fs *c, unsigned dev)
+static inline struct bch_dev *bch2_dev_rcu(struct bch_fs *c, unsigned dev)
{
return c && dev < c->sb.nr_devices
? rcu_dereference(c->devs[dev])