#include "bcachefs.h"
#include "disk_groups.h"
#include "sb-members.h"
#include "super-io.h"
#include <linux/sort.h>
static int group_cmp(const void *_l, const void *_r)
{ … }
static int bch2_sb_disk_groups_validate(struct bch_sb *sb, struct bch_sb_field *f,
enum bch_validate_flags flags, struct printbuf *err)
{ … }
void bch2_disk_groups_to_text(struct printbuf *out, struct bch_fs *c)
{ … }
static void bch2_sb_disk_groups_to_text(struct printbuf *out,
struct bch_sb *sb,
struct bch_sb_field *f)
{ … }
const struct bch_sb_field_ops bch_sb_field_ops_disk_groups = …;
int bch2_sb_disk_groups_to_cpu(struct bch_fs *c)
{ … }
const struct bch_devs_mask *bch2_target_to_mask(struct bch_fs *c, unsigned target)
{ … }
bool bch2_dev_in_target(struct bch_fs *c, unsigned dev, unsigned target)
{ … }
static int __bch2_disk_group_find(struct bch_sb_field_disk_groups *groups,
unsigned parent,
const char *name, unsigned namelen)
{ … }
static int __bch2_disk_group_add(struct bch_sb_handle *sb, unsigned parent,
const char *name, unsigned namelen)
{ … }
int bch2_disk_path_find(struct bch_sb_handle *sb, const char *name)
{ … }
int bch2_disk_path_find_or_create(struct bch_sb_handle *sb, const char *name)
{ … }
void bch2_disk_path_to_text(struct printbuf *out, struct bch_fs *c, unsigned v)
{ … }
void bch2_disk_path_to_text_sb(struct printbuf *out, struct bch_sb *sb, unsigned v)
{ … }
int __bch2_dev_group_set(struct bch_fs *c, struct bch_dev *ca, const char *name)
{ … }
int bch2_dev_group_set(struct bch_fs *c, struct bch_dev *ca, const char *name)
{ … }
int bch2_opt_target_parse(struct bch_fs *c, const char *val, u64 *res,
struct printbuf *err)
{ … }
void bch2_target_to_text(struct printbuf *out, struct bch_fs *c, unsigned v)
{ … }
static void bch2_target_to_text_sb(struct printbuf *out, struct bch_sb *sb, unsigned v)
{ … }
void bch2_opt_target_to_text(struct printbuf *out,
struct bch_fs *c,
struct bch_sb *sb,
u64 v)
{ … }