diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-02-20 10:52:44 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:24 +0200 |
commit | d4b691522c4b60220087a01c276f3fa9781405b0 (patch) | |
tree | 9d0f71f559183ce1f2f3c025d365152020b5856d /fs/bcachefs/dirent.c | |
parent | bcachefs: Don't issue discards when in nochanges mode (diff) | |
download | linux-d4b691522c4b60220087a01c276f3fa9781405b0.tar.xz linux-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/dirent.c')
-rw-r--r-- | fs/bcachefs/dirent.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/dirent.c b/fs/bcachefs/dirent.c index 6f699b736b34..a43a24409d37 100644 --- a/fs/bcachefs/dirent.c +++ b/fs/bcachefs/dirent.c @@ -122,9 +122,9 @@ void bch2_dirent_to_text(struct printbuf *out, struct bch_fs *c, { struct bkey_s_c_dirent d = bkey_s_c_to_dirent(k); - bch_scnmemcpy(out, d.v->d_name, - bch2_dirent_name_bytes(d)); - pr_buf(out, " -> %llu type %s", + pr_buf(out, "%.*s -> %llu type %s", + bch2_dirent_name_bytes(d), + d.v->d_name, d.v->d_type != DT_SUBVOL ? le64_to_cpu(d.v->d_inum) : le32_to_cpu(d.v->d_child_subvol), |