]> Git Repo - J-linux.git/commitdiff
dax: set did_zero to true when zeroing successfully
authorKaixu Xia <[email protected]>
Thu, 30 Jun 2022 17:04:18 +0000 (10:04 -0700)
committerDarrick J. Wong <[email protected]>
Thu, 30 Jun 2022 17:05:11 +0000 (10:05 -0700)
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]>
fs/dax.c

index 4155a6107fa10d20914446e5798110fcddddc08f..649ff51c9a267f9bb1cb786b494ef333b729b548 100644 (file)
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -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;
 }
 
This page took 0.053285 seconds and 4 git commands to generate.