* [PATCH v2] fuse: rename fuse_direct_io() to fuse_do_direct_io()
@ 2026-10-15 17:58 Luis Henriques
2026-10-15 20:11 ` Bernd Schubert
2026-10-16 9:03 ` Miklos Szeredi
0 siblings, 2 replies; 3+ messages in thread
From: Luis Henriques @ 2026-10-15 17:58 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: fuse-devel, linux-kernel, kernel-dev, Luis Henriques
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>
---
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,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] fuse: rename fuse_direct_io() to fuse_do_direct_io()
2026-10-15 17:58 [PATCH v2] fuse: rename fuse_direct_io() to fuse_do_direct_io() Luis Henriques
@ 2026-10-15 20:11 ` Bernd Schubert
2026-10-16 9:03 ` Miklos Szeredi
1 sibling, 0 replies; 3+ messages in thread
From: Bernd Schubert @ 2026-10-15 20:11 UTC (permalink / raw)
To: Luis Henriques, Miklos Szeredi; +Cc: fuse-devel, linux-kernel, kernel-dev
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,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] fuse: rename fuse_direct_io() to fuse_do_direct_io()
2026-10-15 17:58 [PATCH v2] fuse: rename fuse_direct_io() to fuse_do_direct_io() Luis Henriques
2026-10-15 20:11 ` Bernd Schubert
@ 2026-10-16 9:03 ` Miklos Szeredi
1 sibling, 0 replies; 3+ messages in thread
From: Miklos Szeredi @ 2026-10-16 9:03 UTC (permalink / raw)
To: Luis Henriques; +Cc: fuse-devel, linux-kernel, kernel-dev
On Thu, 15 Oct 2026 at 19:57, Luis Henriques <luis@igalia.com> 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.
Applied, thanks.
Miklos
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-16 9:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-15 17:58 [PATCH v2] fuse: rename fuse_direct_io() to fuse_do_direct_io() Luis Henriques
2026-10-15 20:11 ` Bernd Schubert
2026-10-16 9:03 ` Miklos Szeredi
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®