projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0124f42
)
bcachefs: Add .val_to_text() for KEY_TYPE_cookie
author
Kent Overstreet
<kent.overstreet@linux.dev>
Mon, 15 Jan 2024 19:15:03 +0000
(14:15 -0500)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 21 Jan 2024 18:27:09 +0000
(13:27 -0500)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/bkey_methods.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/bkey_methods.c
b/fs/bcachefs/bkey_methods.c
index 761f5e33b1e69e94ca0aaaa41a9825e496b5840f..5e52684764eb14de4d8433abd5954a829648440b 100644
(file)
--- 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, \
})