summaryrefslogtreecommitdiff
path: root/libbcachefs/super-io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-12-21 18:00:30 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2017-12-21 18:06:45 -0500
commit1cf4d51dc4661f336f5318c176a3561ddf5bf04f (patch)
tree8b390ccd48361ba1408be6799d46e62c6382cc39 /libbcachefs/super-io.h
parent8acc54456e11ee0ec80ed0c6abb6d68abae60592 (diff)
Update bcachefs sources to 14ce2a2031 bcachefs: fixes for building in userspace
Diffstat (limited to 'libbcachefs/super-io.h')
-rw-r--r--libbcachefs/super-io.h28
1 files changed, 15 insertions, 13 deletions
diff --git a/libbcachefs/super-io.h b/libbcachefs/super-io.h
index 8cafb301..4096efb2 100644
--- a/libbcachefs/super-io.h
+++ b/libbcachefs/super-io.h
@@ -125,23 +125,12 @@ void bch2_write_super(struct bch_fs *);
/* replicas: */
-/* iterate over bch_sb_field_replicas: */
-
-static inline struct bch_replicas_entry *
-replicas_entry_next(struct bch_replicas_entry *i)
-{
- return (void *) i + offsetof(struct bch_replicas_entry, devs) + i->nr;
-}
-
-#define for_each_replicas_entry(_r, _i) \
- for (_i = (_r)->entries; \
- (void *) (_i) < vstruct_end(&(_r)->field) && (_i)->data_type;\
- (_i) = replicas_entry_next(_i))
-
bool bch2_sb_has_replicas(struct bch_fs *, struct bkey_s_c_extent,
enum bch_data_type);
int bch2_check_mark_super(struct bch_fs *, struct bkey_s_c_extent,
enum bch_data_type);
+int bch2_check_mark_super_devlist(struct bch_fs *, struct bch_devs_list *,
+ enum bch_data_type);
struct replicas_status {
struct {
@@ -161,4 +150,17 @@ unsigned bch2_dev_has_data(struct bch_fs *, struct bch_dev *);
int bch2_replicas_gc_end(struct bch_fs *, int);
int bch2_replicas_gc_start(struct bch_fs *, unsigned);
+/* iterate over superblock replicas - used by userspace tools: */
+
+static inline struct bch_replicas_entry *
+replicas_entry_next(struct bch_replicas_entry *i)
+{
+ return (void *) i + offsetof(struct bch_replicas_entry, devs) + i->nr;
+}
+
+#define for_each_replicas_entry(_r, _i) \
+ for (_i = (_r)->entries; \
+ (void *) (_i) < vstruct_end(&(_r)->field) && (_i)->data_type;\
+ (_i) = replicas_entry_next(_i))
+
#endif /* _BCACHEFS_SUPER_IO_H */