mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
iomap: set did_zero to true when zeroing successfully
It is unnecessary to check and set did_zero value in while() loop in iomap_zero_iter(), we can set did_zero to true only when zeroing successfully at last. Signed-off-by: Kaixu Xia <kaixuxia@tencent.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
d58562ca6c
commit
98eb8d9502
1 changed files with 2 additions and 2 deletions
|
@ -917,10 +917,10 @@ static loff_t iomap_zero_iter(struct iomap_iter *iter, bool *did_zero)
|
|||
pos += bytes;
|
||||
length -= bytes;
|
||||
written += bytes;
|
||||
if (did_zero)
|
||||
*did_zero = true;
|
||||
} while (length > 0);
|
||||
|
||||
if (did_zero)
|
||||
*did_zero = true;
|
||||
return written;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue