diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2025-06-27 11:51:17 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-07-21 23:58:05 +0200 |
commit | 2fb5e56f524f7c0ca3ebda0069f8dd83b90876e5 (patch) | |
tree | d7f5ae17f49a54e4a7464092dfea181f25452cc1 /fs/btrfs/compression.c | |
parent | 6633a416ed64aeb5c0a971d091d598b144739886 (diff) |
btrfs: send: avoid extra calls to strlen() in gen_unique_name()
Since 'snprintf()' returns the number of characters which would
be emitted and output truncation is handled by 'ASSERT()', it
should be safe to use that return value instead of the subsequent
calls to 'strlen()' in 'gen_unique_name()'.
This also reduces the module's text size.
Before:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1897006 161571 16136 2074713 1fa859 fs/btrfs/btrfs.ko
After:
$ size fs/btrfs/btrfs.ko
text data bss dec hex filename
1896848 161571 16136 2074555 1fa7bb fs/btrfs/btrfs.ko
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/compression.c')
0 files changed, 0 insertions, 0 deletions