summaryrefslogtreecommitdiff
path: root/fs/btrfs/dir-item.c
diff options
context:
space:
mode:
authorHoward McLauchlan <hmclauchlan@fb.com>2018-04-18 18:02:36 -0700
committerDavid Sterba <dsterba@suse.com>2018-05-28 18:07:18 +0200
commita565971ff3e0f584ec163a32abf95196be623041 (patch)
tree8ddc9f1f6b1d487fb7715aa621d5d6d415250588 /fs/btrfs/dir-item.c
parent6faa8f475eeaf5d89f985ad3b91b90ab0cf219e6 (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/dir-item.c')
0 files changed, 0 insertions, 0 deletions