summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorRoxana Nicolescu <nicolescu.roxana@protonmail.com>2025-03-27 14:50:09 +0000
committerKent Overstreet <kent.overstreet@linux.dev>2025-05-21 20:13:25 -0400
commitcaa6baa45f809bd932362030b16a8bb3e1dae083 (patch)
tree34ef0ebf244c5df3a9f01a474c48bea6fa45e78a /tools/perf/scripts/python
parent4e2caf82ce958d1fae96a6d6ba23ea9e80c597b4 (diff)
downloadlinux-caa6baa45f809bd932362030b16a8bb3e1dae083.tar.gz
linux-caa6baa45f809bd932362030b16a8bb3e1dae083.zip
bcachefs: replace memcpy with memcpy_and_pad for jset_entry_log->d buff
This was achieved before by zero-ing out the source buffer and then copying the bytes into the destination buffer. This can also be done with memcpy_and_pad which will zero out only the destination buffer if its size is bigger than the size of the source buffer. This is already used in the same way in journal_transaction_name(). Moreover, zero-ing the source buffer was done twice, first in __bch2_fs_log_msg() and then in bch2_trans_log_msg(). And this method may also require allocating some extra memory for the source buffer. In conclusion, using memcpy_and_pad is better even tough the result is the same because it brings uniformity with what's already used in journal_transaction_name, it avoids code duplication and reallocating extra memory. Signed-off-by: Roxana Nicolescu <nicolescu.roxana@protonmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions