Skip to content

Commit

Permalink
dax: set did_zero to true when zeroing successfully
Browse files Browse the repository at this point in the history
It is unnecessary to check and set did_zero value in while() loop
in dax_zero_iter(), we can set did_zero to true only when zeroing
successfully at last.

Signed-off-by: Kaixu Xia <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Darrick J. Wong <[email protected]>
Signed-off-by: Darrick J. Wong <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
  • Loading branch information
kaixuxiakx authored and Darrick J. Wong committed Jun 30, 2022
1 parent 98eb8d9 commit f8189d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/dax.c
Original file line number Diff line number Diff line change
Expand Up @@ -1088,10 +1088,10 @@ static s64 dax_zero_iter(struct iomap_iter *iter, bool *did_zero)
pos += size;
length -= size;
written += size;
if (did_zero)
*did_zero = true;
} while (length > 0);

if (did_zero)
*did_zero = true;
return written;
}

Expand Down

0 comments on commit f8189d5

Please sign in to comment.