btrfs: use round_down while calculating start position in btrfs_dirty_pages()
round_down looks prettier than the bit mask operations. Reviewed-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
949b32732e
commit
13f0dd8f78
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user