summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/sb-members.c
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
commitb07eb8252fb1455cc54bb306e253e193a7a39228 (patch)
tree65e2777820f463c20a743eeabaffba921f0f7e56 /fs/bcachefs/sb-members.c
parentbcachefs: bch2_have_enough_devs() checks for nonexistent device (diff)
downloadlinux-b07eb8252fb1455cc54bb306e253e193a7a39228.tar.xz
linux-b07eb8252fb1455cc54bb306e253e193a7a39228.zip
bcachefs: bch2_dev_tryget()
Most uses of bch2_dev_bkey_exists() are going away, where we assume that because a key references a device the device most exist - instead, we'll be explicitly checking if the device exists and getting a reference to it. This adds the new helpers. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/sb-members.c')
-rw-r--r--fs/bcachefs/sb-members.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/sb-members.c b/fs/bcachefs/sb-members.c
index e4a9c858ca8e..2ca557bffc0e 100644
--- a/fs/bcachefs/sb-members.c
+++ b/fs/bcachefs/sb-members.c
@@ -9,6 +9,11 @@
#include "sb-members.h"
#include "super-io.h"
+void bch2_dev_missing(struct bch_fs *c, unsigned dev)
+{
+ bch2_fs_inconsistent(c, "pointer to nonexistent device %u", dev);
+}
+
#define x(t, n, ...) [n] = #t,
static const char * const bch2_iops_measurements[] = {
BCH_IOPS_MEASUREMENTS()