mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bernd Schubert <bernd@bsbernd.com>
To: Luis Henriques <luis@igalia.com>, Miklos Szeredi <miklos@szeredi.hu>
Cc: fuse-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
	kernel-dev@igalia.com
Subject: Re: [PATCH v2] fuse: rename fuse_direct_io() to fuse_do_direct_io()
Date: Thu, 15 Oct 2026 22:11:16 +0200	[thread overview]
Message-ID: <07756a64-0356-495d-a8b2-97e0423e472a@bsbernd.com> (raw)
In-Reply-To: <20261015175856.13333-1-luis@igalia.com>



On 10/15/26 19:58, Luis Henriques wrote:
> FUSE has two functions with very similar name: fuse_direct_io() and
> fuse_direct_IO().  Which is very confusing.  Rename one of them to remove
> the ambiguity.
> 
> Signed-off-by: Luis Henriques <luis@igalia.com>

I think I had done it similar as part of a direct-io consolidate patch
set quite some time ago (2023/24?), but didn't update it :/
I think I had called it fuse_send_direct_io, but fuse_do_direct_io is
also good.


Reviewed-by: Bernd Schubert <bernd@bsbernd.com>

> ---
>  fs/fuse/cuse.c   |  6 +++---
>  fs/fuse/dax.c    |  2 +-
>  fs/fuse/file.c   | 14 +++++++-------
>  fs/fuse/fuse_i.h |  8 ++++----
>  4 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
> index 4079cf8e5974..01f61fc8e354 100644
> --- a/fs/fuse/cuse.c
> +++ b/fs/fuse/cuse.c
> @@ -98,7 +98,7 @@ static ssize_t cuse_read_iter(struct kiocb *kiocb, struct iov_iter *to)
>  	struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(kiocb);
>  	loff_t pos = 0;
>  
> -	return fuse_direct_io(&io, to, &pos, FUSE_DIO_CUSE);
> +	return fuse_do_direct_io(&io, to, &pos, FUSE_DIO_CUSE);
>  }
>  
>  static ssize_t cuse_write_iter(struct kiocb *kiocb, struct iov_iter *from)
> @@ -109,8 +109,8 @@ static ssize_t cuse_write_iter(struct kiocb *kiocb, struct iov_iter *from)
>  	 * No locking or generic_write_checks(), the server is
>  	 * responsible for locking and sanity checks.
>  	 */
> -	return fuse_direct_io(&io, from, &pos,
> -			      FUSE_DIO_WRITE | FUSE_DIO_CUSE);
> +	return fuse_do_direct_io(&io, from, &pos,
> +				   FUSE_DIO_WRITE | FUSE_DIO_CUSE);
>  }
>  
>  static int cuse_open(struct inode *inode, struct file *file)
> diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
> index 85cdf0199bc0..86e308960b24 100644
> --- a/fs/fuse/dax.c
> +++ b/fs/fuse/dax.c
> @@ -709,7 +709,7 @@ static ssize_t fuse_dax_direct_write(struct kiocb *iocb, struct iov_iter *from)
>  	struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(iocb);
>  	ssize_t ret;
>  
> -	ret = fuse_direct_io(&io, from, &iocb->ki_pos, FUSE_DIO_WRITE);
> +	ret = fuse_do_direct_io(&io, from, &iocb->ki_pos, FUSE_DIO_WRITE);
>  
>  	fuse_write_update_attr(inode, iocb->ki_pos, ret);
>  	return ret;
> diff --git a/fs/fuse/file.c b/fs/fuse/file.c
> index 9a36d0329e22..801a2a269906 100644
> --- a/fs/fuse/file.c
> +++ b/fs/fuse/file.c
> @@ -1653,8 +1653,8 @@ static int fuse_get_user_pages(struct fuse_args_pages *ap, struct iov_iter *ii,
>  	return ret < 0 ? ret : 0;
>  }
>  
> -ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
> -		       loff_t *ppos, int flags)
> +ssize_t fuse_do_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
> +			    loff_t *ppos, int flags)
>  {
>  	int write = flags & FUSE_DIO_WRITE;
>  	int cuse = flags & FUSE_DIO_CUSE;
> @@ -1755,7 +1755,7 @@ ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
>  
>  	return res > 0 ? res : err;
>  }
> -EXPORT_SYMBOL_GPL(fuse_direct_io);
> +EXPORT_SYMBOL_GPL(fuse_do_direct_io);
>  
>  static ssize_t __fuse_direct_read(struct fuse_io_priv *io,
>  				  struct iov_iter *iter,
> @@ -1764,7 +1764,7 @@ static ssize_t __fuse_direct_read(struct fuse_io_priv *io,
>  	ssize_t res;
>  	struct inode *inode = file_inode(io->iocb->ki_filp);
>  
> -	res = fuse_direct_io(io, iter, ppos, 0);
> +	res = fuse_do_direct_io(io, iter, ppos, 0);
>  
>  	fuse_invalidate_atime(inode);
>  
> @@ -1806,8 +1806,8 @@ static ssize_t fuse_direct_write_iter(struct kiocb *iocb, struct iov_iter *from)
>  		} else {
>  			struct fuse_io_priv io = FUSE_IO_PRIV_SYNC(iocb);
>  
> -			res = fuse_direct_io(&io, from, &iocb->ki_pos,
> -					     FUSE_DIO_WRITE);
> +			res = fuse_do_direct_io(&io, from, &iocb->ki_pos,
> +						  FUSE_DIO_WRITE);
>  			fuse_write_update_attr(inode, iocb->ki_pos, res);
>  		}
>  		if (res > 0 && mapping->nrpages) {
> @@ -2787,7 +2787,7 @@ fuse_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
>  	}
>  
>  	if (iov_iter_rw(iter) == WRITE) {
> -		ret = fuse_direct_io(io, iter, &pos, FUSE_DIO_WRITE);
> +		ret = fuse_do_direct_io(io, iter, &pos, FUSE_DIO_WRITE);
>  		fuse_invalidate_attr_mask(inode, FUSE_STATX_MODSIZE);
>  	} else {
>  		ret = __fuse_direct_read(io, iter, &pos);
> diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
> index c8d4c5f3af7e..f892f60d3d22 100644
> --- a/fs/fuse/fuse_i.h
> +++ b/fs/fuse/fuse_i.h
> @@ -1167,17 +1167,17 @@ int fuse_do_open(struct fuse_mount *fm, u64 nodeid, struct file *file,
>  		 bool isdir);
>  
>  /*
> - * fuse_direct_io() flags
> + * fuse_do_direct_io() flags
>   */
>  
>  /** If set, it is WRITE; otherwise - READ */
>  #define FUSE_DIO_WRITE (1 << 0)
>  
> -/** CUSE pass fuse_direct_io() a file which f_mapping->host is not from FUSE */
> +/** CUSE pass fuse_do_direct_io() a file which f_mapping->host is not from FUSE */
>  #define FUSE_DIO_CUSE  (1 << 1)
>  
> -ssize_t fuse_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
> -		       loff_t *ppos, int flags);
> +ssize_t fuse_do_direct_io(struct fuse_io_priv *io, struct iov_iter *iter,
> +			    loff_t *ppos, int flags);
>  long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
>  		   unsigned int flags);
>  long fuse_ioctl_common(struct file *file, unsigned int cmd,
> 


  reply	other threads:[~2026-10-15 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15 17:58 Luis Henriques
2026-10-15 20:11 ` Bernd Schubert [this message]
2026-10-16  9:03 ` Miklos Szeredi

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=07756a64-0356-495d-a8b2-97e0423e472a@bsbernd.com \
    --to=bernd@bsbernd.com \
    --cc=fuse-devel@lists.linux.dev \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luis@igalia.com \
    --cc=miklos@szeredi.hu \
    /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

all inboxes | Powered by JetHome®