summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2026-09-30 12:09:43 +0100
committerDavid Sterba <dsterba@suse.com>2026-10-12 19:16:23 +0200
commit22bdddf40e046e1c9a9c690a2bc3b4790578ad24 (patch)
treec679472b648046adbc80419d3bfba50c05f6370b /tools/perf/scripts/python
parent719aee83960b3e20099247c2d0bb47b969487b4c (diff)
downloadlinux-22bdddf40e046e1c9a9c690a2bc3b4790578ad24.tar.gz
linux-22bdddf40e046e1c9a9c690a2bc3b4790578ad24.zip
btrfs: avoid overhead when logging messages if fs state is clean
If the fs state does not have any errors and is not in some special state (like emergency shutdown or mounted with rescue options), then in btrfs_state_to_string() we end up doing a memcpy() into the buffer and then later just undo that work by setting the buffer's first element to the NUL terminator, since fs_info->fs_error is 0 and there is no bit set in fs_info->fs_state. Improve on this by returning early if there's no error in the fs and the fs state is clean, which is the expected scenario for a healthy fs that is not mounted with special options like the rescue options. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions