Re: [PATCH v3 1/5] iomap: add iomap_symlink_write
From: Christoph Hellwig
Date: Mon Jul 13 2026 - 05:44:23 EST
On Sat, Jul 11, 2026 at 01:59:05PM -0700, Jeremy Bingham wrote:
> 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@xxxxxxxxxx>
>
> Signed-off-by: Jeremy Bingham <jbingham@xxxxxxxxx>
No empty line between tags pleaase.
> +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)
There is nothign symlink-specific in this code. It's really just a
low-level write that doesn't need an iocb.
> + 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);
And given that a normal write doesn't mark the inode dirty we should
probably leave this to the caller for consistency.
> + return 0;
And maybe also return the length writtenn for consistency? Or if we
avoid partial writes for some reason, return an error when they happen?