diff options
author | 2025-02-24 09:47:49 -0500 | |
---|---|---|
committer | 2025-02-26 09:42:36 +0100 | |
commit | e1e6bae60732d1aea4f583a23794306a952bb76d (patch) | |
tree | a35ada3973313dab029666b278a75de1a64b7c44 | |
parent | iomap: convert misc simple ops to incremental advance (diff) | |
download | wireguard-linux-e1e6bae60732d1aea4f583a23794306a952bb76d.tar.xz wireguard-linux-e1e6bae60732d1aea4f583a23794306a952bb76d.zip |
dax: advance the iomap_iter in the read/write path
DAX reads and writes flow through dax_iomap_iter(), which has one or
more subtleties in terms of how it processes a range vs. what is
specified in the iomap_iter. To keep things simple and remove the
dependency on iomap_iter() advances, convert a positive return from
dax_iomap_iter() to the new advance and status return semantics. The
advance can be pushed further down in future patches.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Link: https://lore.kernel.org/r/20250224144757.237706-5-bfoster@redhat.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
-rw-r--r-- | fs/dax.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1585,8 +1585,12 @@ dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter, if (iocb->ki_flags & IOCB_NOWAIT) iomi.flags |= IOMAP_NOWAIT; - while ((ret = iomap_iter(&iomi, ops)) > 0) + while ((ret = iomap_iter(&iomi, ops)) > 0) { iomi.processed = dax_iomap_iter(&iomi, iter); + if (iomi.processed > 0) + iomi.processed = iomap_iter_advance(&iomi, + &iomi.processed); + } done = iomi.pos - iocb->ki_pos; iocb->ki_pos = iomi.pos; |