diff options
author | Qu Wenruo <wqu@suse.com> | 2019-10-23 16:57:26 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-11-18 19:51:48 +0300 |
commit | 2d974619a77f106f3d1341686dea95c0eaad601f (patch) | |
tree | 784cf29f785c8c27d0f498658d479b5363bcb1a0 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | 153a6d299956983de890ffaf429e5904503eb94c (diff) | |
download | linux-2d974619a77f106f3d1341686dea95c0eaad601f.tar.xz |
btrfs: volumes: Use more straightforward way to calculate map length
The old code goes:
offset = logical - em->start;
length = min_t(u64, em->len - offset, length);
Where @length calculation is dependent on offset, it can take reader
several more seconds to find it's just the same code as:
offset = logical - em->start;
length = min_t(u64, em->start + em->len - logical, length);
Use above code to make the length calculate independent from other
variable, thus slightly increase the readability.
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions