summaryrefslogtreecommitdiff
path: root/lib/dhry.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-06-28 17:31:30 +0200
committerDavid Sterba <dsterba@suse.com>2023-08-21 14:52:14 +0200
commit2c73162d649670045415537dc746f7524cda1405 (patch)
tree5ff4e80739d5f009f2aa18ba2249ddc91cf7f4e9 /lib/dhry.h
parent0835d1e66e7f22428bbc2ea56cb488a7759b51e2 (diff)
btrfs: improve the delalloc_to_write calculation in writepage_delalloc
Currently writepage_delalloc adds to delalloc_to_write in every loop operation. That is not only more work than doing it once after the loop, but can also over-increment the counter due to rounding errors when a new loop iteration starts with an offset into a page. Add a new page_start variable instead of recaculation that value over and over, move the delalloc_to_write calculation out of the loop, use the DIV_ROUND_UP helper instead of open coding it and remove the pointless found local variable. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'lib/dhry.h')
0 files changed, 0 insertions, 0 deletions