Re: [PATCH 2/2] iomap: micro optimize the ki_pos assignment in iomap_file_buffered_write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christoph Hellwig <hch@xxxxxx> writes:

> We have the new value for ki_pos right at hand in iter.pos, so assign
> that instead of recalculating it from ret.
>

Looks good to me. Feel free to add - 

Reviewed-by: Ritesh Harjani (IBM) <ritesh.harjani@xxxxxxxxx>

> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  fs/iomap/buffered-io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 7cc9f7274883a5..aa8967cca1a31b 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -875,7 +875,7 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
>  	if (unlikely(iter.pos == iocb->ki_pos))
>  		return ret;
>  	ret = iter.pos - iocb->ki_pos;
> -	iocb->ki_pos += ret;
> +	iocb->ki_pos = iter.pos;
>  	return ret;
>  }
>  EXPORT_SYMBOL_GPL(iomap_file_buffered_write);
> -- 
> 2.39.2



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux