Re: [PATCH 002/437] fs: add generic read/write iterator helpers

Al Viro
2024-04-15T19:55:06Z

On Thu, Apr 11, 2024 at 09:12:22AM -0600, Jens Axboe wrote:

> +/* generic read side helper for drivers converting to ->read_iter() */
> +ssize_t vfs_read_iter(struct kiocb *iocb, struct iov_iter *to,
> + ssize_t (*read)(struct file *, char __user *,
> + size_t, loff_t *))
> +{
> + return do_loop_readv(iocb->ki_filp, to, &iocb->ki_pos, 0, read);
> +}
> +EXPORT_SYMBOL(vfs_read_iter);
> +
> +/* generic write side helper for drivers converting to ->write_iter() */
> +ssize_t vfs_write_iter(struct kiocb *iocb, struct iov_iter *from,
> + ssize_t (*write)(struct file *, const char __user *,
> + size_t, loff_t *))
> +{
> + return do_loop_writev(iocb->ki_filp, from, &iocb->ki_pos, 0, write);
> +}
> +EXPORT_SYMBOL(vfs_write_iter);

Wait a minute; just what do you expect to happen if that ever gets called
for ITER_BVEC or ITER_XARRAY?