Skip to content

Commit

Permalink
btrfs: use round_down while calculating start position in btrfs_dirty…
Browse files Browse the repository at this point in the history
…_pages()

round_down looks prettier than the bit mask operations.

Reviewed-by: Nikolay Borisov <[email protected]>
Reviewed-by: Qu Wenruo <[email protected]>
Signed-off-by: Goldwyn Rodrigues <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
goldwynr authored and kdave committed Dec 8, 2020
1 parent 949b327 commit 13f0dd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ int btrfs_dirty_pages(struct btrfs_inode *inode, struct page **pages,
loff_t isize = i_size_read(&inode->vfs_inode);
unsigned int extra_bits = 0;

start_pos = pos & ~((u64) fs_info->sectorsize - 1);
start_pos = round_down(pos, fs_info->sectorsize);
num_bytes = round_up(write_bytes + pos - start_pos,
fs_info->sectorsize);

Expand Down

0 comments on commit 13f0dd8

Please sign in to comment.