bcachefs: bch2_dev_safe() -> bch2_dev_rcu()
authorKent Overstreet <kent.overstreet@linux.dev>
Tue, 30 Apr 2024 19:30:35 +0000 (15:30 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Wed, 8 May 2024 21:29:22 +0000 (17:29 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/extents.c
fs/bcachefs/sb-members.c
fs/bcachefs/sb-members.h

index 0d1473ba584a4360f30e0a969cd70dc55580994f..6376440f6f30f5d71a79bc4b097526ad8ba348f4 100644 (file)
@@ -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,
index 52054f26982f66cfcc6a49ebfdaaf37d2b9b8421..96a49ad0525cc0bcfc87918cbf8276f03be73348 100644 (file)
@@ -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"
index ecb8284af0dedf8a1f507523076d1b6499cb7425..bea4c2efbb6e82bdc680713973d4dd67fc90f11f 100644 (file)
@@ -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])