Skip to content

Commit 741c1d3

Browse files
author
Kent Overstreet
committed
bcachefs: Add .val_to_text() for KEY_TYPE_cookie
Signed-off-by: Kent Overstreet <[email protected]>
1 parent 0124f42 commit 741c1d3

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/bcachefs/bkey_methods.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,17 @@ static int key_type_cookie_invalid(struct bch_fs *c, struct bkey_s_c k,
6363
return 0;
6464
}
6565

66+
static void key_type_cookie_to_text(struct printbuf *out, struct bch_fs *c,
67+
struct bkey_s_c k)
68+
{
69+
struct bkey_s_c_cookie ck = bkey_s_c_to_cookie(k);
70+
71+
prt_printf(out, "%llu", le64_to_cpu(ck.v->cookie));
72+
}
73+
6674
#define bch2_bkey_ops_cookie ((struct bkey_ops) { \
6775
.key_invalid = key_type_cookie_invalid, \
76+
.val_to_text = key_type_cookie_to_text, \
6877
.min_val_size = 8, \
6978
})
7079

0 commit comments

Comments
 (0)