On 1/18/26 3:32 PM, John Groves wrote:
> From: John Groves <[email protected]>
>
> This patch starts the kernel ABI enablement of famfs in fuse.
>
> - Kconfig: Add FUSE_FAMFS_DAX config parameter, to control
> compilation of famfs within fuse.
> - FUSE_DAX_FMAP flag in INIT request/reply
> - fuse_conn->famfs_iomap (enable famfs-mapped files) to denote a
> famfs-enabled connection
>
> Reviewed-by: Joanne Koong <[email protected]>
> Signed-off-by: John Groves <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>
> ---
> fs/fuse/Kconfig | 14 ++++++++++++++
> fs/fuse/fuse_i.h | 3 +++
> fs/fuse/inode.c | 6 ++++++
> include/uapi/linux/fuse.h | 5 +++++
> 4 files changed, 28 insertions(+)
>
> diff --git a/fs/fuse/Kconfig b/fs/fuse/Kconfig
> index 3a4ae632c94a..5ca9fae62c7b 100644
> --- a/fs/fuse/Kconfig
> +++ b/fs/fuse/Kconfig
> @@ -76,3 +76,17 @@ config FUSE_IO_URING
>
> If you want to allow fuse server/client communication through
> io-uring,
> answer Y
> +
> +config FUSE_FAMFS_DAX
> + bool "FUSE support for fs-dax filesystems backed by devdax"
> + depends on FUSE_FS
> + depends on DEV_DAX
> + depends on FS_DAX
> + default FUSE_FS
> + help
> + This enables the fabric-attached memory file system (famfs),
> + which enables formatting devdax memory as a file system. Famfs
> + is primarily intended for scale-out shared access to
> + disaggregated memory.
> +
> + To enable famfs or other fuse/fs-dax file systems, answer Y
> diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
> index 45e108dec771..2839efb219a9 100644
> --- a/fs/fuse/fuse_i.h
> +++ b/fs/fuse/fuse_i.h
> @@ -921,6 +921,9 @@ struct fuse_conn {
> /* Is synchronous FUSE_INIT allowed? */
> unsigned int sync_init:1;
>
> + /* dev_dax_iomap support for famfs */
> + unsigned int famfs_iomap:1;
> +
> /* Use io_uring for communication */
> unsigned int io_uring;
>
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index ed667920997f..acabf92a11f8 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -1456,6 +1456,10 @@ static void process_init_reply(struct fuse_mount *fm,
> struct fuse_args *args,
>
> if (flags & FUSE_REQUEST_TIMEOUT)
> timeout = arg->request_timeout;
> +
> + if (IS_ENABLED(CONFIG_FUSE_FAMFS_DAX) &&
> + flags & FUSE_DAX_FMAP)
> + fc->famfs_iomap = 1;
> } else {
> ra_pages = fc->max_read / PAGE_SIZE;
> fc->no_lock = 1;
> @@ -1517,6 +1521,8 @@ static struct fuse_init_args *fuse_new_init(struct
> fuse_mount *fm)
> flags |= FUSE_SUBMOUNTS;
> if (IS_ENABLED(CONFIG_FUSE_PASSTHROUGH))
> flags |= FUSE_PASSTHROUGH;
> + if (IS_ENABLED(CONFIG_FUSE_FAMFS_DAX))
> + flags |= FUSE_DAX_FMAP;
>
> /*
> * This is just an information flag for fuse server. No need to check
> diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
> index c13e1f9a2f12..25686f088e6a 100644
> --- a/include/uapi/linux/fuse.h
> +++ b/include/uapi/linux/fuse.h
> @@ -240,6 +240,9 @@
> * - add FUSE_COPY_FILE_RANGE_64
> * - add struct fuse_copy_file_range_out
> * - add FUSE_NOTIFY_PRUNE
> + *
> + * 7.46
> + * - Add FUSE_DAX_FMAP capability - ability to handle in-kernel fsdax maps
> */
>
> #ifndef _LINUX_FUSE_H
> @@ -448,6 +451,7 @@ struct fuse_file_lock {
> * FUSE_OVER_IO_URING: Indicate that client supports io-uring
> * FUSE_REQUEST_TIMEOUT: kernel supports timing out requests.
> * init_out.request_timeout contains the timeout (in secs)
> + * FUSE_DAX_FMAP: kernel supports dev_dax_iomap (aka famfs) fmaps
> */
> #define FUSE_ASYNC_READ (1 << 0)
> #define FUSE_POSIX_LOCKS (1 << 1)
> @@ -495,6 +499,7 @@ struct fuse_file_lock {
> #define FUSE_ALLOW_IDMAP (1ULL << 40)
> #define FUSE_OVER_IO_URING (1ULL << 41)
> #define FUSE_REQUEST_TIMEOUT (1ULL << 42)
> +#define FUSE_DAX_FMAP (1ULL << 43)
>
> /**
> * CUSE INIT request/reply flags