diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-15 14:15:03 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-21 13:27:09 -0500 |
commit | 741c1d3ec1a4a91d0bf18f200e2f0f8bed1ee7e9 (patch) | |
tree | 343aedb06c8b8e3188e045c2f24584ca0d86e9b0 /fs/bcachefs/bkey_methods.c | |
parent | 0124f42da70c513dc371b73688663c54e5a9666f (diff) | |
download | linux-741c1d3ec1a4a91d0bf18f200e2f0f8bed1ee7e9.tar.gz linux-741c1d3ec1a4a91d0bf18f200e2f0f8bed1ee7e9.tar.bz2 linux-741c1d3ec1a4a91d0bf18f200e2f0f8bed1ee7e9.zip |
bcachefs: Add .val_to_text() for KEY_TYPE_cookie
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey_methods.c')
-rw-r--r-- | fs/bcachefs/bkey_methods.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/bkey_methods.c b/fs/bcachefs/bkey_methods.c index 761f5e33b1e6..5e52684764eb 100644 --- a/fs/bcachefs/bkey_methods.c +++ b/fs/bcachefs/bkey_methods.c @@ -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, \ }) |