summaryrefslogtreecommitdiff
path: root/fs/bcachefs/super-io.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/bcachefs/super-io.h')
-rw-r--r--fs/bcachefs/super-io.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/bcachefs/super-io.h b/fs/bcachefs/super-io.h
index d51c0a19586f..817c3d790acd 100644
--- a/fs/bcachefs/super-io.h
+++ b/fs/bcachefs/super-io.h
@@ -6,6 +6,7 @@
#include "eytzinger.h"
#include "super_types.h"
#include "super.h"
+#include "sb-members.h"
#include <asm/byteorder.h>
@@ -97,11 +98,13 @@ static inline bool bch2_member_exists(struct bch_member *m)
}
static inline bool bch2_dev_exists(struct bch_sb *sb,
- struct bch_sb_field_members *mi,
unsigned dev)
{
- return dev < sb->nr_devices &&
- bch2_member_exists(&mi->members[dev]);
+ if (dev < sb->nr_devices) {
+ struct bch_member m = bch2_sb_member_get(sb, dev);
+ return bch2_member_exists(&m);
+ }
+ return false;
}
static inline struct bch_member_cpu bch2_mi_to_cpu(struct bch_member *mi)