diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-09-10 08:38:06 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-09-21 08:59:25 -0700 |
commit | 6cc19c5fad0908e4e5ed99c2236d740668985364 (patch) | |
tree | 0ef269ed532c3222a9952d283fbc03ed3db52626 /fs/iomap | |
parent | 14284fedf59f1647264f4603d64418cf1fcd3eb0 (diff) | |
download | linux-6cc19c5fad0908e4e5ed99c2236d740668985364.tar.bz2 |
iomap: Use round_down/round_up macros in __iomap_write_begin
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/iomap')
-rw-r--r-- | fs/iomap/buffered-io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 897ab9a26a74..2b4757dba825 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -571,8 +571,8 @@ __iomap_write_begin(struct inode *inode, loff_t pos, unsigned len, int flags, { struct iomap_page *iop = iomap_page_create(inode, page); loff_t block_size = i_blocksize(inode); - loff_t block_start = pos & ~(block_size - 1); - loff_t block_end = (pos + len + block_size - 1) & ~(block_size - 1); + loff_t block_start = round_down(pos, block_size); + loff_t block_end = round_up(pos + len, block_size); unsigned from = offset_in_page(pos), to = from + len, poff, plen; if (PageUptodate(page)) |