bcachefs: Add .val_to_text() for KEY_TYPE_cookie

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2024-01-15 14:15:03 -05:00
parent 0124f42da7
commit 741c1d3ec1
1 changed files with 9 additions and 0 deletions

View File

@ -63,8 +63,17 @@ static int key_type_cookie_invalid(struct bch_fs *c, struct bkey_s_c k,
return 0;
}
static void key_type_cookie_to_text(struct printbuf *out, struct bch_fs *c,
struct bkey_s_c k)
{
struct bkey_s_c_cookie ck = bkey_s_c_to_cookie(k);
prt_printf(out, "%llu", le64_to_cpu(ck.v->cookie));
}
#define bch2_bkey_ops_cookie ((struct bkey_ops) { \
.key_invalid = key_type_cookie_invalid, \
.val_to_text = key_type_cookie_to_text, \
.min_val_size = 8, \
})