Commit 98046f74 authored by Jeffle Xu's avatar Jeffle Xu Committed by Miklos Szeredi
Browse files

fuse: support per inode DAX in fuse protocol



Expand the fuse protocol to support per inode DAX.

FUSE_HAS_INODE_DAX flag is added indicating if fuse server/client
supporting per inode DAX. It can be conveyed in both FUSE_INIT request and
reply.

FUSE_ATTR_DAX flag is added indicating if DAX shall be enabled for
corresponding file. It is conveyed in FUSE_LOOKUP reply.

Signed-off-by: default avatarJeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 780b1b95
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -193,6 +193,7 @@
 *  - add flags2 to fuse_init_in and fuse_init_out
 *  - add flags2 to fuse_init_in and fuse_init_out
 *  - add FUSE_SECURITY_CTX init flag
 *  - add FUSE_SECURITY_CTX init flag
 *  - add security context to create, mkdir, symlink, and mknod requests
 *  - add security context to create, mkdir, symlink, and mknod requests
 *  - add FUSE_HAS_INODE_DAX, FUSE_ATTR_DAX
 */
 */


#ifndef _LINUX_FUSE_H
#ifndef _LINUX_FUSE_H
@@ -351,6 +352,7 @@ struct fuse_file_lock {
 * FUSE_INIT_RESERVED: reserved, do not use
 * FUSE_INIT_RESERVED: reserved, do not use
 * FUSE_SECURITY_CTX:	add security context to create, mkdir, symlink, and
 * FUSE_SECURITY_CTX:	add security context to create, mkdir, symlink, and
 *			mknod
 *			mknod
 * FUSE_HAS_INODE_DAX:  use per inode DAX
 */
 */
#define FUSE_ASYNC_READ		(1 << 0)
#define FUSE_ASYNC_READ		(1 << 0)
#define FUSE_POSIX_LOCKS	(1 << 1)
#define FUSE_POSIX_LOCKS	(1 << 1)
@@ -386,6 +388,7 @@ struct fuse_file_lock {
#define FUSE_INIT_RESERVED	(1 << 31)
#define FUSE_INIT_RESERVED	(1 << 31)
/* bits 32..63 get shifted down 32 bits into the flags2 field */
/* bits 32..63 get shifted down 32 bits into the flags2 field */
#define FUSE_SECURITY_CTX	(1ULL << 32)
#define FUSE_SECURITY_CTX	(1ULL << 32)
#define FUSE_HAS_INODE_DAX	(1ULL << 33)


/**
/**
 * CUSE INIT request/reply flags
 * CUSE INIT request/reply flags
@@ -468,8 +471,10 @@ struct fuse_file_lock {
 * fuse_attr flags
 * fuse_attr flags
 *
 *
 * FUSE_ATTR_SUBMOUNT: Object is a submount root
 * FUSE_ATTR_SUBMOUNT: Object is a submount root
 * FUSE_ATTR_DAX: Enable DAX for this file in per inode DAX mode
 */
 */
#define FUSE_ATTR_SUBMOUNT      (1 << 0)
#define FUSE_ATTR_SUBMOUNT      (1 << 0)
#define FUSE_ATTR_DAX		(1 << 1)


/**
/**
 * Open flags
 * Open flags