Skip to content

Commit efa96cc

Browse files
Christoph HellwigDarrick J. Wong
authored andcommitted
iomap: micro optimize the ki_pos assignment in iomap_file_buffered_write
We have the new value for ki_pos right at hand in iter.pos, so assign that instead of recalculating it from ret. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Ritesh Harjani (IBM) <ritesh.harjani@gmail.com>
1 parent 20c64ec commit efa96cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/iomap/buffered-io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i,
875875
if (unlikely(iter.pos == iocb->ki_pos))
876876
return ret;
877877
ret = iter.pos - iocb->ki_pos;
878-
iocb->ki_pos += ret;
878+
iocb->ki_pos = iter.pos;
879879
return ret;
880880
}
881881
EXPORT_SYMBOL_GPL(iomap_file_buffered_write);

0 commit comments

Comments
 (0)