From: Joanne Koong <joannelkoong@gmail.com>
To: brauner@kernel.org
Cc: willy@infradead.org, hch@lst.de, djwong@kernel.org,
miklos@szeredi.hu, linux-fsdevel@vger.kernel.org,
fuse-devel@lists.linux.dev
Subject: [PATCH v2 1/2] iomap: add helper to mark folio uptodate
Date: Wed, 24 Jun 2026 14:29:24 -0700 [thread overview]
Message-ID: <20260624212925.1668662-2-joannelkoong@gmail.com> (raw)
In-Reply-To: <20260624212925.1668662-1-joannelkoong@gmail.com>
Add an exported helper iomap_folio_mark_uptodate() to mark a folio as
uptodate and update its uptodate bitmap if the folio has iomap state
data attached.
This is needed because there are some filesystems (eg fuse) that have
paths outside of conventional iomap calls that need to mark a folio as
uptodate (eg writing server-pushed data directly into the page cache)
and need the iomap-internal uptodate bitmap to be in sync with the
uptodate state of the folio.
Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
---
fs/iomap/buffered-io.c | 6 ++++++
include/linux/iomap.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 8d4806dc46d4..bc33c34800e8 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -105,6 +105,12 @@ static void iomap_set_range_uptodate(struct folio *folio, size_t off,
folio_mark_uptodate(folio);
}
+void iomap_folio_mark_uptodate(struct folio *folio)
+{
+ iomap_set_range_uptodate(folio, 0, folio_size(folio));
+}
+EXPORT_SYMBOL_GPL(iomap_folio_mark_uptodate);
+
/*
* Find the next dirty block in the folio. end_blk is inclusive.
* If no dirty block is found, this will return end_blk + 1.
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 3582ed1fe236..21e73cb9c51e 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -365,6 +365,7 @@ struct folio *iomap_get_folio(struct iomap_iter *iter, loff_t pos, size_t len);
bool iomap_release_folio(struct folio *folio, gfp_t gfp_flags);
void iomap_invalidate_folio(struct folio *folio, size_t offset, size_t len);
bool iomap_dirty_folio(struct address_space *mapping, struct folio *folio);
+void iomap_folio_mark_uptodate(struct folio *folio);
int iomap_file_unshare(struct inode *inode, loff_t pos, loff_t len,
const struct iomap_ops *ops,
const struct iomap_write_ops *write_ops);
--
2.52.0
next prev parent reply other threads:[~2026-06-24 21:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-24 21:29 [PATCH v2 0/2] iomap: add helper to keep uptodate bitmap in sync Joanne Koong
2026-06-24 21:29 ` Joanne Koong [this message]
2026-06-25 11:50 ` [PATCH v2 1/2] iomap: add helper to mark folio uptodate Christoph Hellwig
2026-06-25 18:55 ` Darrick J. Wong
2026-06-24 21:29 ` [PATCH v2 2/2] fuse: use iomap " Joanne Koong
2026-06-24 22:18 ` Darrick J. Wong
2026-06-25 0:35 ` Joanne Koong
2026-06-25 18:57 ` Darrick J. Wong
2026-06-25 7:46 ` [PATCH v2 0/2] iomap: add helper to keep uptodate bitmap in sync Christian Brauner
2026-06-25 21:54 ` Joanne Koong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260624212925.1668662-2-joannelkoong@gmail.com \
--to=joannelkoong@gmail.com \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=fuse-devel@lists.linux.dev \
--cc=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox