Add readable names for d_type, and use it in dirent_to_text().
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
bch_scnmemcpy(out, d.v->d_name,
bch2_dirent_name_bytes(d));
- pr_buf(out, " -> %llu type %u", d.v->d_inum, d.v->d_type);
+ pr_buf(out, " -> %llu type %s", d.v->d_inum, bch2_d_types[d.v->d_type]);
}
static struct bkey_i_dirent *dirent_create_key(struct btree_trans *trans,
#undef x
+const char * const bch2_d_types[] = {
+ [DT_UNKNOWN] = "unknown",
+ [DT_FIFO] = "fifo",
+ [DT_CHR] = "chr",
+ [DT_DIR] = "dir",
+ [DT_BLK] = "blk",
+ [DT_REG] = "reg",
+ [DT_LNK] = "lnk",
+ [DT_SOCK] = "sock",
+ [DT_WHT] = "whiteout",
+};
+
void bch2_opts_apply(struct bch_opts *dst, struct bch_opts src)
{
#define x(_name, ...) \
extern const char * const bch2_data_types[];
extern const char * const bch2_cache_replacement_policies[];
extern const char * const bch2_member_states[];
+extern const char * const bch2_d_types[];
/*
* Mount options; we also store defaults in the superblock.