diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2017-10-05 14:41:44 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2017-10-08 10:25:33 -0800 |
commit | 85ee972555948337bb1a58f0702a4da95db6758f (patch) | |
tree | 34f13bce6d9ad221593a45d3ee3b489b777cba04 /libbcachefs/super-io.h | |
parent | e7c2bb91bce30a987c8c4e2875f2c63e887d3aa5 (diff) |
Update bcachefs sources to e82e656279 bcachefs: Cleanups for building in userspace
Diffstat (limited to 'libbcachefs/super-io.h')
-rw-r--r-- | libbcachefs/super-io.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/libbcachefs/super-io.h b/libbcachefs/super-io.h index e5e865a9..ed27dd0f 100644 --- a/libbcachefs/super-io.h +++ b/libbcachefs/super-io.h @@ -1,5 +1,5 @@ -#ifndef _BCACHE_SUPER_IO_H -#define _BCACHE_SUPER_IO_H +#ifndef _BCACHEFS_SUPER_IO_H +#define _BCACHEFS_SUPER_IO_H #include "extents.h" #include "eytzinger.h" @@ -104,6 +104,7 @@ static inline struct bch_member_cpu bch2_mi_to_cpu(struct bch_member *mi) .tier = BCH_MEMBER_TIER(mi), .replacement = BCH_MEMBER_REPLACEMENT(mi), .discard = BCH_MEMBER_DISCARD(mi), + .data_allowed = BCH_MEMBER_DATA_ALLOWED(mi), .valid = !bch2_is_zero(mi->uuid.b, sizeof(uuid_le)), }; } @@ -122,10 +123,25 @@ const char *bch2_read_super(struct bcache_superblock *, struct bch_opts, const char *); 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_types); + enum bch_data_type); int bch2_check_mark_super(struct bch_fs *, struct bkey_s_c_extent, - enum bch_data_types); + enum bch_data_type); struct replicas_status { struct { @@ -145,4 +161,4 @@ 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); -#endif /* _BCACHE_SUPER_IO_H */ +#endif /* _BCACHEFS_SUPER_IO_H */ |