summaryrefslogtreecommitdiff
path: root/fs/bcachefs/checksum.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-03 21:01:40 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:33 -0400
commit401ec4db630802729f10d53ad995083ced98caca (patch)
tree245f07e5928f1414b6da71f14c417829e763fdde /fs/bcachefs/checksum.c
parent652018d66190412669a898c2dc3e75073eac8679 (diff)
bcachefs: Printbuf rework
This converts bcachefs to the modern printbuf interface/implementation, synced with the version to be submitted upstream. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/checksum.c')
-rw-r--r--fs/bcachefs/checksum.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c
index e9a444f75b93..e23b221cd377 100644
--- a/fs/bcachefs/checksum.c
+++ b/fs/bcachefs/checksum.c
@@ -493,13 +493,15 @@ static int __bch2_request_key(char *key_description, struct bch_key *key)
int bch2_request_key(struct bch_sb *sb, struct bch_key *key)
{
- char key_description[60];
- char uuid[40];
+ struct printbuf key_description = PRINTBUF;
+ int ret;
- uuid_unparse_lower(sb->user_uuid.b, uuid);
- sprintf(key_description, "bcachefs:%s", uuid);
+ prt_printf(&key_description, "bcachefs:");
+ pr_uuid(&key_description, sb->user_uuid.b);
- return __bch2_request_key(key_description, key);
+ ret = __bch2_request_key(key_description.buf, key);
+ printbuf_exit(&key_description);
+ return ret;
}
int bch2_decrypt_sb_key(struct bch_fs *c,