return DIV_ROUND_UP(bytes, sizeof(u64));
}
-int bch2_alloc_v1_invalid(const struct bch_fs *c, struct bkey_s_c k, struct printbuf *err)
+int bch2_alloc_v1_invalid(const struct bch_fs *c, struct bkey_s_c k,
+ int rw, struct printbuf *err)
{
struct bkey_s_c_alloc a = bkey_s_c_to_alloc(k);
return 0;
}
-int bch2_alloc_v2_invalid(const struct bch_fs *c, struct bkey_s_c k, struct printbuf *err)
+int bch2_alloc_v2_invalid(const struct bch_fs *c, struct bkey_s_c k,
+ int rw, struct printbuf *err)
{
struct bkey_alloc_unpacked u;
return 0;
}
-int bch2_alloc_v3_invalid(const struct bch_fs *c, struct bkey_s_c k, struct printbuf *err)
+int bch2_alloc_v3_invalid(const struct bch_fs *c, struct bkey_s_c k,
+ int rw, struct printbuf *err)
{
struct bkey_alloc_unpacked u;
return 0;
}
-int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k, struct printbuf *err)
+int bch2_alloc_v4_invalid(const struct bch_fs *c, struct bkey_s_c k,
+ int rw, struct printbuf *err)
{
if (bkey_val_bytes(k.k) != sizeof(struct bch_alloc_v4)) {
pr_buf(err, "bad val size (%zu != %zu)",
#define ALLOC_SCAN_BATCH(ca) max_t(size_t, 1, (ca)->mi.nbuckets >> 9)
-int bch2_alloc_v1_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
-int bch2_alloc_v2_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
-int bch2_alloc_v3_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
-int bch2_alloc_v4_invalid(const struct bch_fs *, struct bkey_s_c k, struct printbuf *);
+int bch2_alloc_v1_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
+int bch2_alloc_v2_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
+int bch2_alloc_v3_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
+int bch2_alloc_v4_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_alloc_v4_swab(struct bkey_s);
void bch2_alloc_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
};
static int deleted_key_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
return 0;
}
}
static int empty_val_key_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (bkey_val_bytes(k.k)) {
pr_buf(err, "incorrect value size (%zu != 0)",
}
static int key_type_cookie_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (bkey_val_bytes(k.k) != sizeof(struct bch_cookie)) {
pr_buf(err, "incorrect value size (%zu != %zu)",
}
static int key_type_inline_data_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
return 0;
}
}
static int key_type_set_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (bkey_val_bytes(k.k)) {
pr_buf(err, "incorrect value size (%zu != %zu)",
#undef x
};
-int bch2_bkey_val_invalid(struct bch_fs *c, struct bkey_s_c k, struct printbuf *err)
+int bch2_bkey_val_invalid(struct bch_fs *c, struct bkey_s_c k,
+ int rw, struct printbuf *err)
{
if (k.k->type >= KEY_TYPE_MAX) {
pr_buf(err, "invalid type (%u >= %u)", k.k->type, KEY_TYPE_MAX);
return -EINVAL;
}
- return bch2_bkey_ops[k.k->type].key_invalid(c, k, err);
+ return bch2_bkey_ops[k.k->type].key_invalid(c, k, rw, err);
}
static unsigned bch2_key_types_allowed[] = {
int __bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k,
enum btree_node_type type,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (k.k->u64s < BKEY_U64s) {
pr_buf(err, "u64s too small (%u < %zu)", k.k->u64s, BKEY_U64s);
int bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k,
enum btree_node_type type,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
- return __bch2_bkey_invalid(c, k, type, err) ?:
- bch2_bkey_val_invalid(c, k, err);
+ return __bch2_bkey_invalid(c, k, type, rw, err) ?:
+ bch2_bkey_val_invalid(c, k, rw, err);
}
int bch2_bkey_in_btree_node(struct btree *b, struct bkey_s_c k,
extern const char * const bch2_bkey_types[];
+/*
+ * key_invalid: checks validity of @k, returns 0 if good or -EINVAL if bad. If
+ * invalid, entire key will be deleted.
+ *
+ * When invalid, error string is returned via @err. @rw indicates whether key is
+ * being read or written; more aggressive checks can be enabled when rw == WRITE.
+*/
struct bkey_ops {
- /* Returns reason for being invalid if invalid, else NULL: */
- int (*key_invalid)(const struct bch_fs *, struct bkey_s_c,
- struct printbuf *);
+ int (*key_invalid)(const struct bch_fs *c, struct bkey_s_c k,
+ int rw, struct printbuf *err);
void (*val_to_text)(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
void (*swab)(struct bkey_s);
extern const struct bkey_ops bch2_bkey_ops[];
-int bch2_bkey_val_invalid(struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_bkey_val_invalid(struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
int __bch2_bkey_invalid(struct bch_fs *, struct bkey_s_c,
- enum btree_node_type, struct printbuf *);
+ enum btree_node_type, int, struct printbuf *);
int bch2_bkey_invalid(struct bch_fs *, struct bkey_s_c,
- enum btree_node_type, struct printbuf *);
+ enum btree_node_type, int, struct printbuf *);
int bch2_bkey_in_btree_node(struct btree *, struct bkey_s_c, struct printbuf *);
void bch2_bpos_to_text(struct printbuf *, struct bpos);
static int bset_key_invalid(struct bch_fs *c, struct btree *b,
struct bkey_s_c k,
- bool updated_range, int write,
+ bool updated_range, int rw,
struct printbuf *err)
{
- return __bch2_bkey_invalid(c, k, btree_node_type(b), err) ?:
+ return __bch2_bkey_invalid(c, k, btree_node_type(b), rw, err) ?:
(!updated_range ? bch2_bkey_in_btree_node(b, k, err) : 0) ?:
- (write ? bch2_bkey_val_invalid(c, k, err) : 0);
+ (rw == WRITE ? bch2_bkey_val_invalid(c, k, rw, err) : 0);
}
static int validate_bset_keys(struct bch_fs *c, struct btree *b,
printbuf_reset(&buf);
- if (bch2_bkey_val_invalid(c, u.s_c, &buf) ||
+ if (bch2_bkey_val_invalid(c, u.s_c, READ, &buf) ||
(bch2_inject_invalid_keys &&
!bversion_cmp(u.k->version, MAX_VERSION))) {
printbuf_reset(&buf);
pr_buf(&buf, "invalid bkey\n ");
bch2_bkey_val_to_text(&buf, c, u.s_c);
pr_buf(&buf, "\n ");
- bch2_bkey_val_invalid(c, u.s_c, &buf);
+ bch2_bkey_val_invalid(c, u.s_c, READ, &buf);
btree_err(BTREE_ERR_FIXABLE, c, NULL, b, i, "%s", buf.buf);
struct printbuf buf = PRINTBUF;
int ret;
- ret = bch2_bkey_invalid(c, bkey_i_to_s_c(&b->key), BKEY_TYPE_btree, &buf);
+ ret = bch2_bkey_invalid(c, bkey_i_to_s_c(&b->key),
+ BKEY_TYPE_btree, WRITE, &buf);
if (ret)
bch2_fs_inconsistent(c, "invalid btree node key before write: %s", buf.buf);
if (unlikely(!test_bit(JOURNAL_REPLAY_DONE, &c->journal.flags)))
bch2_journal_key_overwritten(c, b->c.btree_id, b->c.level, insert->k.p);
- if (bch2_bkey_invalid(c, bkey_i_to_s_c(insert), btree_node_type(b), &buf) ?:
+ if (bch2_bkey_invalid(c, bkey_i_to_s_c(insert),
+ btree_node_type(b), WRITE, &buf) ?:
bch2_bkey_in_btree_node(b, bkey_i_to_s_c(insert), &buf)) {
printbuf_reset(&buf);
pr_buf(&buf, "inserting invalid bkey\n ");
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(insert));
pr_buf(&buf, "\n ");
- bch2_bkey_invalid(c, bkey_i_to_s_c(insert), btree_node_type(b), &buf);
+ bch2_bkey_invalid(c, bkey_i_to_s_c(insert),
+ btree_node_type(b), WRITE, &buf);
bch2_bkey_in_btree_node(b, bkey_i_to_s_c(insert), &buf);
bch2_fs_inconsistent(c, "%s", buf.buf);
int ret, u64s_delta = 0;
trans_for_each_update(trans, i) {
- if (bch2_bkey_invalid(c, bkey_i_to_s_c(i->k), i->bkey_type, &buf)) {
+ if (bch2_bkey_invalid(c, bkey_i_to_s_c(i->k),
+ i->bkey_type, WRITE, &buf)) {
printbuf_reset(&buf);
pr_buf(&buf, "invalid bkey on insert from %s -> %ps",
trans->fn, (void *) i->ip_allocated);
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(i->k));
pr_newline(&buf);
- bch2_bkey_invalid(c, bkey_i_to_s_c(i->k), i->bkey_type, &buf);
+ bch2_bkey_invalid(c, bkey_i_to_s_c(i->k),
+ i->bkey_type, WRITE, &buf);
bch2_fs_fatal_error(c, "%s", buf.buf);
printbuf_exit(&buf);
};
int bch2_dirent_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_dirent d = bkey_s_c_to_dirent(k);
unsigned len;
extern const struct bch_hash_desc bch2_dirent_hash_desc;
-int bch2_dirent_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_dirent_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_dirent_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
#define bch2_bkey_ops_dirent (struct bkey_ops) { \
/* Stripes btree keys: */
int bch2_stripe_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
const struct bch_stripe *s = bkey_s_c_to_stripe(k).v;
return -EINVAL;
}
- return bch2_bkey_ptrs_invalid(c, k, err);
+ return bch2_bkey_ptrs_invalid(c, k, rw, err);
}
void bch2_stripe_to_text(struct printbuf *out, struct bch_fs *c,
#include "keylist_types.h"
int bch2_stripe_invalid(const struct bch_fs *, struct bkey_s_c,
- struct printbuf *);
+ int rw, struct printbuf *);
void bch2_stripe_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
/* KEY_TYPE_btree_ptr: */
int bch2_btree_ptr_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (bkey_val_u64s(k.k) > BCH_REPLICAS_MAX) {
pr_buf(err, "value too big (%zu > %u)",
return -EINVAL;
}
- return bch2_bkey_ptrs_invalid(c, k, err);
+ return bch2_bkey_ptrs_invalid(c, k, rw, err);
}
void bch2_btree_ptr_to_text(struct printbuf *out, struct bch_fs *c,
}
int bch2_btree_ptr_v2_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_btree_ptr_v2 bp = bkey_s_c_to_btree_ptr_v2(k);
return -EINVAL;
}
- return bch2_bkey_ptrs_invalid(c, k, err);
+ return bch2_bkey_ptrs_invalid(c, k, rw, err);
}
void bch2_btree_ptr_v2_to_text(struct printbuf *out, struct bch_fs *c,
- struct bkey_s_c k)
+ struct bkey_s_c k)
{
struct bkey_s_c_btree_ptr_v2 bp = bkey_s_c_to_btree_ptr_v2(k);
/* KEY_TYPE_reservation: */
int bch2_reservation_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_reservation r = bkey_s_c_to_reservation(k);
}
int bch2_bkey_ptrs_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(k);
const union bch_extent_entry *entry;
/* KEY_TYPE_btree_ptr: */
-int bch2_btree_ptr_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_btree_ptr_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_btree_ptr_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
-int bch2_btree_ptr_v2_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_btree_ptr_v2_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_btree_ptr_v2_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
void bch2_btree_ptr_v2_compat(enum btree_id, unsigned, unsigned,
int, struct bkey_s);
/* KEY_TYPE_reservation: */
-int bch2_reservation_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_reservation_invalid(const struct bch_fs *, struct bkey_s_c,
+ int, struct printbuf *);
void bch2_reservation_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
bool bch2_reservation_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
bool bch2_extent_normalize(struct bch_fs *, struct bkey_s);
void bch2_bkey_ptrs_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
-int bch2_bkey_ptrs_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_bkey_ptrs_invalid(const struct bch_fs *, struct bkey_s_c,
+ int, struct printbuf *);
void bch2_ptr_swab(struct bkey_s);
}
int bch2_inode_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_inode inode = bkey_s_c_to_inode(k);
}
int bch2_inode_v2_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_inode_v2 inode = bkey_s_c_to_inode_v2(k);
}
int bch2_inode_generation_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (k.k->p.inode) {
pr_buf(err, "nonzero k.p.inode");
extern const char * const bch2_inode_opts[];
-int bch2_inode_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
-int bch2_inode_v2_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_inode_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
+int bch2_inode_v2_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_inode_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
#define bch2_bkey_ops_inode (struct bkey_ops) { \
k->type == KEY_TYPE_inode_v2;
}
-int bch2_inode_generation_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_inode_generation_invalid(const struct bch_fs *, struct bkey_s_c,
+ int, struct printbuf *);
void bch2_inode_generation_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
#define bch2_bkey_ops_inode_generation (struct bkey_ops) { \
write, NULL, bkey_to_packed(k));
if (bch2_bkey_invalid(c, bkey_i_to_s_c(k),
- __btree_node_type(level, btree_id), &buf)) {
+ __btree_node_type(level, btree_id), write, &buf)) {
printbuf_reset(&buf);
pr_buf(&buf, "invalid %s in %s entry offset %zi/%u:",
type, where,
bch2_bkey_val_to_text(&buf, c, bkey_i_to_s_c(k));
pr_newline(&buf);
bch2_bkey_invalid(c, bkey_i_to_s_c(k),
- __btree_node_type(level, btree_id), &buf);
+ __btree_node_type(level, btree_id), write, &buf);
mustfix_fsck_err(c, "%s", buf.buf);
#include "recovery.h"
int bch2_lru_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
const struct bch_lru *lru = bkey_s_c_to_lru(k).v;
#ifndef _BCACHEFS_LRU_H
#define _BCACHEFS_LRU_H
-int bch2_lru_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_lru_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_lru_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
#define bch2_bkey_ops_lru (struct bkey_ops) { \
};
int bch2_quota_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (k.k->p.inode >= QTYP_NR) {
pr_buf(err, "invalid quota type (%llu >= %u)",
extern const struct bch_sb_field_ops bch_sb_field_ops_quota;
-int bch2_quota_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_quota_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_quota_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
#define bch2_bkey_ops_quota (struct bkey_ops) { \
/* reflink pointers */
int bch2_reflink_p_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_reflink_p p = bkey_s_c_to_reflink_p(k);
/* indirect extents */
int bch2_reflink_v_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_reflink_v r = bkey_s_c_to_reflink_v(k);
return -EINVAL;
}
- return bch2_bkey_ptrs_invalid(c, k, err);
+ return bch2_bkey_ptrs_invalid(c, k, rw, err);
}
void bch2_reflink_v_to_text(struct printbuf *out, struct bch_fs *c,
/* indirect inline data */
int bch2_indirect_inline_data_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (bkey_val_bytes(k.k) < sizeof(struct bch_indirect_inline_data)) {
pr_buf(err, "incorrect value size (%zu < %zu)",
#ifndef _BCACHEFS_REFLINK_H
#define _BCACHEFS_REFLINK_H
-int bch2_reflink_p_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_reflink_p_invalid(const struct bch_fs *, struct bkey_s_c,
+ int, struct printbuf *);
void bch2_reflink_p_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
bool bch2_reflink_p_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
.atomic_trigger = bch2_mark_reflink_p, \
}
-int bch2_reflink_v_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_reflink_v_invalid(const struct bch_fs *, struct bkey_s_c,
+ int, struct printbuf *);
void bch2_reflink_v_to_text(struct printbuf *, struct bch_fs *,
struct bkey_s_c);
int bch2_trans_mark_reflink_v(struct btree_trans *, struct bkey_s_c,
}
int bch2_indirect_inline_data_invalid(const struct bch_fs *, struct bkey_s_c,
- struct printbuf *);
+ int, struct printbuf *);
void bch2_indirect_inline_data_to_text(struct printbuf *,
struct bch_fs *, struct bkey_s_c);
int bch2_trans_mark_indirect_inline_data(struct btree_trans *,
}
int bch2_snapshot_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
struct bkey_s_c_snapshot s;
u32 i, id;
/* Subvolumes: */
int bch2_subvolume_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
if (bkey_cmp(k.k->p, SUBVOL_POS_MIN) < 0 ||
bkey_cmp(k.k->p, SUBVOL_POS_MAX) > 0) {
#include "subvolume_types.h"
void bch2_snapshot_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
-int bch2_snapshot_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_snapshot_invalid(const struct bch_fs *, struct bkey_s_c,
+ int rw, struct printbuf *);
#define bch2_bkey_ops_snapshot (struct bkey_ops) { \
.key_invalid = bch2_snapshot_invalid, \
void bch2_fs_snapshots_exit(struct bch_fs *);
int bch2_fs_snapshots_start(struct bch_fs *);
-int bch2_subvolume_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_subvolume_invalid(const struct bch_fs *, struct bkey_s_c,
+ int rw, struct printbuf *);
void bch2_subvolume_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
#define bch2_bkey_ops_subvolume (struct bkey_ops) { \
};
int bch2_xattr_invalid(const struct bch_fs *c, struct bkey_s_c k,
- struct printbuf *err)
+ int rw, struct printbuf *err)
{
const struct xattr_handler *handler;
struct bkey_s_c_xattr xattr = bkey_s_c_to_xattr(k);
extern const struct bch_hash_desc bch2_xattr_hash_desc;
-int bch2_xattr_invalid(const struct bch_fs *, struct bkey_s_c, struct printbuf *);
+int bch2_xattr_invalid(const struct bch_fs *, struct bkey_s_c, int, struct printbuf *);
void bch2_xattr_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
#define bch2_bkey_ops_xattr (struct bkey_ops) { \