diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-20 04:52:44 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:24 -0400 |
commit | d4b691522c4b60220087a01c276f3fa9781405b0 (patch) | |
tree | 9d0f71f559183ce1f2f3c025d365152020b5856d /fs/bcachefs/journal_io.c | |
parent | 3117db99f30b26ebf09ecc323cbefcd51d83467b (diff) | |
download | lwn-d4b691522c4b60220087a01c276f3fa9781405b0.tar.gz lwn-d4b691522c4b60220087a01c276f3fa9781405b0.zip |
bcachefs: Kill bch_scnmemcpy()
bch_scnmemcpy was for printing length-limited strings that might not
have a terminating null - turns out sprintf & pr_buf can do this with
%.*s.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/journal_io.c')
-rw-r--r-- | fs/bcachefs/journal_io.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/bcachefs/journal_io.c b/fs/bcachefs/journal_io.c index 56ba82156c70..4f0904a515a7 100644 --- a/fs/bcachefs/journal_io.c +++ b/fs/bcachefs/journal_io.c @@ -595,7 +595,7 @@ static void journal_entry_log_to_text(struct printbuf *out, struct bch_fs *c, struct jset_entry_log *l = container_of(entry, struct jset_entry_log, entry); unsigned bytes = vstruct_bytes(entry) - offsetof(struct jset_entry_log, d); - bch_scnmemcpy(out, l->d, strnlen(l->d, bytes)); + pr_buf(out, "%.*s", bytes, l->d); } struct jset_entry_ops { |