Commit 741c1d3e authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Add .val_to_text() for KEY_TYPE_cookie

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 0124f42d
...@@ -63,8 +63,17 @@ static int key_type_cookie_invalid(struct bch_fs *c, struct bkey_s_c k, ...@@ -63,8 +63,17 @@ static int key_type_cookie_invalid(struct bch_fs *c, struct bkey_s_c k,
return 0; 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) { \ #define bch2_bkey_ops_cookie ((struct bkey_ops) { \
.key_invalid = key_type_cookie_invalid, \ .key_invalid = key_type_cookie_invalid, \
.val_to_text = key_type_cookie_to_text, \
.min_val_size = 8, \ .min_val_size = 8, \
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment