summaryrefslogtreecommitdiff
path: root/fs/dax.c
diff options
context:
space:
mode:
authorKaixu Xia <kaixuxia@tencent.com>2022-06-30 10:04:18 -0700
committerDarrick J. Wong <djwong@kernel.org>2022-06-30 10:05:11 -0700
commitf8189d5d5fbf082786fb91c549f5127f23daec09 (patch)
tree440ced279adbacd91a057b1044810ead5fa9e73a /fs/dax.c
parent98eb8d95025bd96d78fa4d27fb9e1e8d162c7227 (diff)
dax: set did_zero to true when zeroing successfully
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 <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>
Diffstat (limited to 'fs/dax.c')
-rw-r--r--fs/dax.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/dax.c b/fs/dax.c
index 4155a6107fa1..649ff51c9a26 100644
--- 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;
}