mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
btrfs: simplify range end calculations in truncate_block_zero_beyond_eof()
The way zero_end is calculated and used does a -1 and +1 that effectively cancel out, so this can be simplified. This is also preparatory patch for using a helper for folio_pos + folio_size with the semantics of exclusive end of the range. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
bdd01fb036
commit
e47c8a4767
|
|
@ -4819,9 +4819,9 @@ static int truncate_block_zero_beyond_eof(struct btrfs_inode *inode, u64 start)
|
|||
*/
|
||||
|
||||
zero_start = max_t(u64, folio_pos(folio), start);
|
||||
zero_end = folio_pos(folio) + folio_size(folio) - 1;
|
||||
zero_end = folio_pos(folio) + folio_size(folio);
|
||||
folio_zero_range(folio, zero_start - folio_pos(folio),
|
||||
zero_end - zero_start + 1);
|
||||
zero_end - zero_start);
|
||||
|
||||
out_unlock:
|
||||
folio_unlock(folio);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user