All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iomap: Use round_down/round_up macros in __iomap_write_begin
@ 2020-09-10 12:47 Nikolay Borisov
  2020-09-10 15:37 ` Darrick J. Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Nikolay Borisov @ 2020-09-10 12:47 UTC (permalink / raw)
  To: darrick.wong; +Cc: linux-xfs, linux-fsdevel, hch, Nikolay Borisov

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/iomap/buffered-io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index bcfc288dba3f..31eb680d8c64 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;
 	int status;
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iomap: Use round_down/round_up macros in __iomap_write_begin
  2020-09-10 12:47 [PATCH] iomap: Use round_down/round_up macros in __iomap_write_begin Nikolay Borisov
@ 2020-09-10 15:37 ` Darrick J. Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Darrick J. Wong @ 2020-09-10 15:37 UTC (permalink / raw)
  To: Nikolay Borisov; +Cc: linux-xfs, linux-fsdevel, hch

On Thu, Sep 10, 2020 at 03:47:43PM +0300, Nikolay Borisov wrote:
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Looks ok to me,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/iomap/buffered-io.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index bcfc288dba3f..31eb680d8c64 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;
>  	int status;
>  
> -- 
> 2.17.1
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-10 21:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 12:47 [PATCH] iomap: Use round_down/round_up macros in __iomap_write_begin Nikolay Borisov
2020-09-10 15:37 ` Darrick J. Wong

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.