Commit ac35d1e
btrfs: replace for_each_set_bit() with for_each_set_bitmap()
Inside extent_io.c, there are several simple call sites doing things
like:
for_each_set_bit(bit, bitmap, bitmap_size) {
/* handle one fs block */
}
The workload includes:
- set_bit()
Inside extent_writepage_io().
This can be replaced with a bitmap_set().
- btrfs_folio_set_lock()
- btrfs_mark_ordered_io_finished()
Inside writepage_delalloc().
Instead of calling it multiple times, we can pass a range into the
function with one call.
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent ee15967 commit ac35d1e
1 file changed
+16
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1426 | 1426 | | |
1427 | 1427 | | |
1428 | 1428 | | |
| 1429 | + | |
| 1430 | + | |
1429 | 1431 | | |
1430 | | - | |
1431 | 1432 | | |
1432 | 1433 | | |
1433 | 1434 | | |
| |||
1437 | 1438 | | |
1438 | 1439 | | |
1439 | 1440 | | |
1440 | | - | |
1441 | | - | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1442 | 1445 | | |
1443 | | - | |
| 1446 | + | |
1444 | 1447 | | |
1445 | 1448 | | |
1446 | 1449 | | |
| |||
1557 | 1560 | | |
1558 | 1561 | | |
1559 | 1562 | | |
1560 | | - | |
1561 | | - | |
1562 | | - | |
1563 | | - | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
1564 | 1570 | | |
1565 | 1571 | | |
1566 | 1572 | | |
| |||
1728 | 1734 | | |
1729 | 1735 | | |
1730 | 1736 | | |
1731 | | - | |
1732 | | - | |
| 1737 | + | |
| 1738 | + | |
1733 | 1739 | | |
1734 | 1740 | | |
1735 | 1741 | | |
| |||
0 commit comments