diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-11-12 19:20:40 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-11-12 19:22:36 -0500 |
commit | cc6479303f0672d5e07899009c64eb32821e170b (patch) | |
tree | 2aacceb0e1d623226c03703837386612ed8f76e1 /libbcachefs/replicas.h | |
parent | bdba182d105b1eaa9776c78a094b0b0192046651 (diff) |
Update bcachefs sources to a9f14c773f bcachefs: More btree gc refactorings
Diffstat (limited to 'libbcachefs/replicas.h')
-rw-r--r-- | libbcachefs/replicas.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libbcachefs/replicas.h b/libbcachefs/replicas.h index 7deca37c..7fee927c 100644 --- a/libbcachefs/replicas.h +++ b/libbcachefs/replicas.h @@ -4,9 +4,9 @@ #include "replicas_types.h" bool bch2_replicas_marked(struct bch_fs *, enum bch_data_type, - struct bch_devs_list); + struct bch_devs_list, bool); bool bch2_bkey_replicas_marked(struct bch_fs *, enum bkey_type, - struct bkey_s_c); + struct bkey_s_c, bool); int bch2_mark_replicas(struct bch_fs *, enum bch_data_type, struct bch_devs_list); int bch2_mark_bkey_replicas(struct bch_fs *, enum bkey_type, @@ -16,7 +16,7 @@ void bch2_cpu_replicas_to_text(struct printbuf *, struct bch_replicas_cpu *); struct replicas_status { struct { - unsigned nr_online; + int redundancy; unsigned nr_offline; } replicas[BCH_DATA_NR]; }; @@ -26,7 +26,7 @@ struct replicas_status __bch2_replicas_status(struct bch_fs *, struct replicas_status bch2_replicas_status(struct bch_fs *); bool bch2_have_enough_devs(struct replicas_status, unsigned); -unsigned bch2_replicas_online(struct bch_fs *, bool); +int bch2_replicas_online(struct bch_fs *, bool); unsigned bch2_dev_has_data(struct bch_fs *, struct bch_dev *); int bch2_replicas_gc_end(struct bch_fs *, int); @@ -45,8 +45,14 @@ int bch2_replicas_gc_start(struct bch_fs *, unsigned); (void *) (_i) < vstruct_end(&(_r)->field) && (_i)->data_type;\ (_i) = replicas_entry_next(_i)) +#define for_each_replicas_entry_v0(_r, _i) \ + for (_i = (_r)->entries; \ + (void *) (_i) < vstruct_end(&(_r)->field) && (_i)->data_type;\ + (_i) = replicas_entry_next(_i)) + int bch2_sb_replicas_to_cpu_replicas(struct bch_fs *); extern const struct bch_sb_field_ops bch_sb_field_ops_replicas; +extern const struct bch_sb_field_ops bch_sb_field_ops_replicas_v0; #endif /* _BCACHEFS_REPLICAS_H */ |