From: Jeremy Bingham <jbingham@gmail.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, brauner@kernel.org,
jkoolstra@xs4all.nl, jack@suse.cz, djwong@kernel.org,
viro@zeniv.linux.org.uk, Jeremy Bingham <jbingham@gmail.com>
Subject: [PATCH v3 1/5] iomap: add iomap_symlink_write
Date: Sat, 11 Jul 2026 13:59:05 -0700 [thread overview]
Message-ID: <570b47ec69233efcdde6644fc11bc5a8af6a9577.1783707063.git.jbingham@gmail.com> (raw)
In-Reply-To: <cover.1783707063.git.jbingham@gmail.com>
Add a new iomap_symlink_write function as an iomap based equivalent to
page_symlink found in fs/namei.c. This implementation was suggested by
Darrick J. Wong, who also provided the initial implementation that I
only needed to change slightly to get working.
Suggested-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Jeremy Bingham <jbingham@gmail.com>
---
fs/iomap/buffered-io.c | 31 +++++++++++++++++++++++++++++++
include/linux/iomap.h | 4 ++++
2 files changed, 35 insertions(+)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 276720bc18dc..6f3f79fdbd8b 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -2066,3 +2066,34 @@ iomap_writepages(struct iomap_writepage_ctx *wpc)
return error;
}
EXPORT_SYMBOL_GPL(iomap_writepages);
+
+int iomap_symlink_write(struct inode *inode, const char *target, int len,
+ const struct iomap_ops *ops,
+ const struct iomap_write_ops *write_ops, void *private)
+{
+ struct kvec vec = {
+ .iov_base = (void *)target,
+ .iov_len = len,
+ };
+ struct iomap_iter iter = {
+ .inode = inode,
+ .pos = 0,
+ .len = len,
+ .flags = IOMAP_WRITE,
+ .private = private,
+ };
+ struct iov_iter iov;
+ int ret;
+
+ iov_iter_kvec(&iov, ITER_SOURCE, &vec, 1, len);
+
+ while ((ret = iomap_iter(&iter, ops)) > 0)
+ iter.status = iomap_write_iter(&iter, &iov, write_ops);
+
+ if (unlikely(iter.pos == 0))
+ return ret;
+
+ mark_inode_dirty(inode);
+ return 0;
+}
+EXPORT_SYMBOL_GPL(iomap_symlink_write);
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 56b43d594e6e..9274fa256bc9 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -393,6 +393,10 @@ loff_t iomap_seek_data(struct inode *inode, loff_t offset,
sector_t iomap_bmap(struct address_space *mapping, sector_t bno,
const struct iomap_ops *ops);
+int iomap_symlink_write(struct inode *inode, const char *target, int len,
+ const struct iomap_ops *ops,
+ const struct iomap_write_ops *write_ops, void *private);
+
/*
* Flags for iomap_ioend->io_flags.
*/
--
2.47.3
next prev parent reply other threads:[~2026-07-11 20:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-11 20:59 [PATCH v3 0/5] minix: convert to iomap and add direct I/O Jeremy Bingham
2026-07-11 20:59 ` Jeremy Bingham [this message]
2026-07-13 9:44 ` [PATCH v3 1/5] iomap: add iomap_symlink_write Christoph Hellwig
2026-07-11 20:59 ` [PATCH v3 2/5] minix: add base iomap begin/end functions Jeremy Bingham
2026-07-13 9:46 ` Christoph Hellwig
2026-07-11 20:59 ` [PATCH v3 3/5] minix: update itree* files to add iomap functions Jeremy Bingham
2026-07-11 20:59 ` [PATCH v3 4/5] minix: add file operation functions Jeremy Bingham
2026-07-13 9:48 ` Christoph Hellwig
2026-07-13 19:17 ` Jeremy Bingham
2026-07-11 20:59 ` [PATCH v3 5/5] minix: iomap inode operations Jeremy Bingham
2026-07-13 9:32 ` [PATCH v3 0/5] minix: convert to iomap and add direct I/O Christoph Hellwig
2026-07-13 19:26 ` Jeremy Bingham
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=570b47ec69233efcdde6644fc11bc5a8af6a9577.1783707063.git.jbingham@gmail.com \
--to=jbingham@gmail.com \
--cc=brauner@kernel.org \
--cc=djwong@kernel.org \
--cc=jack@suse.cz \
--cc=jkoolstra@xs4all.nl \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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