diff options
author | Goldwyn Rodrigues <rgoldwyn@suse.com> | 2020-10-14 16:55:44 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-12-08 15:53:38 +0100 |
commit | 13f0dd8f786152404fa5bc1f9436aad83556a311 (patch) | |
tree | 1631e31413c341bff2866971d4b024e529ea70e9 /fs/btrfs/file.c | |
parent | btrfs: use iosize while reading compressed pages (diff) | |
download | linux-13f0dd8f786152404fa5bc1f9436aad83556a311.tar.xz linux-13f0dd8f786152404fa5bc1f9436aad83556a311.zip |
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>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 7c5e3d406574..c7ed30edf1cd 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -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); |