Message ID | 20250225194416.3076650-2-arnd@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/2] btrfs: use min_t() for mismatched type comparison | expand |
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 7dc996e7e249..e4ba4fa3f48c 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -1505,8 +1505,7 @@ static noinline_for_stack int writepage_delalloc(struct btrfs_inode *inode, * delalloc_end is already one less than the total length, so * we don't subtract one from folio_size(). */ - delalloc_to_write += - DIV_ROUND_UP(delalloc_end + 1 - page_start, folio_size(folio)); + delalloc_to_write += (delalloc_end + 1 - page_start + folio_size(folio) - 1) >> folio_order(folio); /* * If all ranges are submitted asynchronously, we just need to account