#ifndef _BCACHEFS_SB_MEMBERS_H
#define _BCACHEFS_SB_MEMBERS_H
#include "darray.h"
#include "bkey_types.h"
extern char * const bch2_member_error_strs[];
static inline struct bch_member *
__bch2_members_v2_get_mut(struct bch_sb_field_members_v2 *mi, unsigned i)
{ … }
int bch2_sb_members_v2_init(struct bch_fs *c);
int bch2_sb_members_cpy_v2_v1(struct bch_sb_handle *disk_sb);
struct bch_member *bch2_members_v2_get_mut(struct bch_sb *sb, int i);
struct bch_member bch2_sb_member_get(struct bch_sb *sb, int i);
static inline bool bch2_dev_is_online(struct bch_dev *ca)
{ … }
static inline bool bch2_dev_is_readable(struct bch_dev *ca)
{ … }
static inline unsigned dev_mask_nr(const struct bch_devs_mask *devs)
{ … }
static inline bool bch2_dev_list_has_dev(struct bch_devs_list devs,
unsigned dev)
{ … }
static inline void bch2_dev_list_drop_dev(struct bch_devs_list *devs,
unsigned dev)
{ … }
static inline void bch2_dev_list_add_dev(struct bch_devs_list *devs,
unsigned dev)
{ … }
static inline struct bch_devs_list bch2_dev_list_single(unsigned dev)
{ … }
static inline struct bch_dev *__bch2_next_dev_idx(struct bch_fs *c, unsigned idx,
const struct bch_devs_mask *mask)
{ … }
static inline struct bch_dev *__bch2_next_dev(struct bch_fs *c, struct bch_dev *ca,
const struct bch_devs_mask *mask)
{ … }
#define for_each_member_device_rcu(_c, _ca, _mask) …
static inline void bch2_dev_get(struct bch_dev *ca)
{ … }
static inline void __bch2_dev_put(struct bch_dev *ca)
{ … }
static inline void bch2_dev_put(struct bch_dev *ca)
{ … }
static inline struct bch_dev *bch2_get_next_dev(struct bch_fs *c, struct bch_dev *ca)
{ … }
#define __for_each_member_device(_c, _ca) …
#define for_each_member_device(_c, _ca) …
static inline struct bch_dev *bch2_get_next_online_dev(struct bch_fs *c,
struct bch_dev *ca,
unsigned state_mask)
{ … }
#define __for_each_online_member(_c, _ca, state_mask) …
#define for_each_online_member(c, ca) …
#define for_each_rw_member(c, ca) …
#define for_each_readable_member(c, ca) …
static inline bool bch2_dev_exists(const struct bch_fs *c, unsigned dev)
{ … }
static inline bool bucket_valid(const struct bch_dev *ca, u64 b)
{ … }
static inline struct bch_dev *bch2_dev_have_ref(const struct bch_fs *c, unsigned dev)
{ … }
static inline struct bch_dev *bch2_dev_locked(struct bch_fs *c, unsigned dev)
{ … }
static inline struct bch_dev *bch2_dev_rcu(struct bch_fs *c, unsigned dev)
{ … }
static inline struct bch_dev *bch2_dev_tryget_noerror(struct bch_fs *c, unsigned dev)
{ … }
void bch2_dev_missing(struct bch_fs *, unsigned);
static inline struct bch_dev *bch2_dev_tryget(struct bch_fs *c, unsigned dev)
{ … }
static inline struct bch_dev *bch2_dev_bucket_tryget_noerror(struct bch_fs *c, struct bpos bucket)
{ … }
void bch2_dev_bucket_missing(struct bch_fs *, struct bpos);
static inline struct bch_dev *bch2_dev_bucket_tryget(struct bch_fs *c, struct bpos bucket)
{ … }
static inline struct bch_dev *bch2_dev_iterate_noerror(struct bch_fs *c, struct bch_dev *ca, unsigned dev_idx)
{ … }
static inline struct bch_dev *bch2_dev_iterate(struct bch_fs *c, struct bch_dev *ca, unsigned dev_idx)
{ … }
static inline struct bch_dev *bch2_dev_get_ioref(struct bch_fs *c, unsigned dev, int rw)
{ … }
static inline struct bch_devs_mask bch2_online_devs(struct bch_fs *c)
{ … }
extern const struct bch_sb_field_ops bch_sb_field_ops_members_v1;
extern const struct bch_sb_field_ops bch_sb_field_ops_members_v2;
static inline bool bch2_member_alive(struct bch_member *m)
{ … }
static inline bool bch2_member_exists(struct bch_sb *sb, unsigned dev)
{ … }
static inline struct bch_member_cpu bch2_mi_to_cpu(struct bch_member *mi)
{ … }
void bch2_sb_members_from_cpu(struct bch_fs *);
void bch2_dev_io_errors_to_text(struct printbuf *, struct bch_dev *);
void bch2_dev_errors_reset(struct bch_dev *);
static inline bool bch2_dev_btree_bitmap_marked_sectors(struct bch_dev *ca, u64 start, unsigned sectors)
{ … }
bool bch2_dev_btree_bitmap_marked(struct bch_fs *, struct bkey_s_c);
void bch2_dev_btree_bitmap_mark(struct bch_fs *, struct bkey_s_c);
#endif