diff options
| author | Filipe Manana <fdmanana@suse.com> | 2025-06-02 13:27:49 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-07-21 23:53:30 +0200 |
| commit | 71c086b30d4373a01bd5627f54516a72891a026a (patch) | |
| tree | d0dbf9b91a8a1fe755dd9bbce2c1a1f01a377f43 /tools/perf/scripts/python | |
| parent | 41e4ea0bf5558c03c8e7e3fc45ddf61da00e7c80 (diff) | |
btrfs: reorganize logic at free_extent_buffer() for better readability
It's hard to read the logic to break out of the while loop since it's a
very long expression consisting of a logical or of two composite
expressions, each one composed by a logical and. Further each one is also
testing for the EXTENT_BUFFER_UNMAPPED bit, making it more verbose than
necessary.
So change from this:
if ((!test_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags) && refs <= 3)
|| (test_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags) &&
refs == 1))
break;
To this:
if (test_bit(EXTENT_BUFFER_UNMAPPED, &eb->bflags)) {
if (refs == 1)
break;
} else if (refs <= 3) {
break;
}
At least on x86_64 using gcc 9.3.0, this doesn't change the object size.
Reviewed-by: Boris Burkov <boris@bur.io>
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 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
