diff options
author | Howard McLauchlan <hmclauchlan@fb.com> | 2018-04-18 18:02:36 -0700 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 18:07:18 +0200 |
commit | a565971ff3e0f584ec163a32abf95196be623041 (patch) | |
tree | 8ddc9f1f6b1d487fb7715aa621d5d6d415250588 /fs/btrfs/locking.c | |
parent | 6faa8f475eeaf5d89f985ad3b91b90ab0cf219e6 (diff) |
btrfs: optimize free space tree bitmap conversion
Presently, convert_free_space_to_extents() does a linear scan of the
bitmap. We can speed this up with find_next_{bit,zero_bit}_le().
This patch replaces the linear scan with find_next_{bit,zero_bit}_le().
Testing shows a 20-33% decrease in execution time for
convert_free_space_to_extents().
Since we change bitmap to be unsigned long, we have to do some casting
for the bitmap cursor. In le_bitmap_set() it makes sense to use u8, as
we are doing bit operations. Everywhere else, we're just using it for
pointer arithmetic and not directly accessing it, so char seems more
appropriate.
Suggested-by: Omar Sandoval <osandov@osandov.com>
Signed-off-by: Howard McLauchlan <hmclauchlan@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/locking.c')
0 files changed, 0 insertions, 0 deletions