Skip to content

Commit

Permalink
virtio-fs: update fuse protocol header
Browse files Browse the repository at this point in the history
Taken from upstream QEMU 5.2.0.

Signed-off-by: Fotis Xenakis <foxen@windowslive.com>
Message-Id: <VI1PR03MB377327CEBD67843CE316F30BA6959@VI1PR03MB3773.eurprd03.prod.outlook.com>
  • Loading branch information
foxeng authored and wkozaczuk committed Mar 13, 2021
1 parent 4d32934 commit 2275ed4
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions fs/virtiofs/fuse_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
* - add FUSE_WRITE_KILL_PRIV flag
* - add FUSE_SETUPMAPPING and FUSE_REMOVEMAPPING
* - add map_alignment to fuse_init_out, add FUSE_MAP_ALIGNMENT flag
*
* 7.32
* - add flags to fuse_attr, add FUSE_ATTR_SUBMOUNT, add FUSE_SUBMOUNTS
*/

#ifndef _LINUX_FUSE_H
Expand Down Expand Up @@ -203,7 +206,7 @@
#define FUSE_KERNEL_VERSION 7

/** Minor version number of this interface */
#define FUSE_KERNEL_MINOR_VERSION 31
#define FUSE_KERNEL_MINOR_VERSION 32

/** The node ID of the root inode */
#define FUSE_ROOT_ID 1
Expand All @@ -227,7 +230,7 @@ struct fuse_attr {
uint32_t gid;
uint32_t rdev;
uint32_t blksize;
uint32_t padding;
uint32_t flags;
};

struct fuse_kstatfs {
Expand Down Expand Up @@ -309,7 +312,10 @@ struct fuse_file_lock {
* FUSE_CACHE_SYMLINKS: cache READLINK responses
* FUSE_NO_OPENDIR_SUPPORT: kernel supports zero-message opendir
* FUSE_EXPLICIT_INVAL_DATA: only invalidate cached pages on explicit request
* FUSE_MAP_ALIGNMENT: map_alignment field is valid
* FUSE_MAP_ALIGNMENT: init_out.map_alignment contains log2(byte alignment) for
* foffset and moffset fields in struct
* fuse_setupmapping_out and fuse_removemapping_one.
* FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts
*/
#define FUSE_ASYNC_READ (1 << 0)
#define FUSE_POSIX_LOCKS (1 << 1)
Expand Down Expand Up @@ -338,6 +344,7 @@ struct fuse_file_lock {
#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
#define FUSE_MAP_ALIGNMENT (1 << 26)
#define FUSE_SUBMOUNTS (1 << 27)

/**
* CUSE INIT request/reply flags
Expand Down Expand Up @@ -413,6 +420,13 @@ struct fuse_file_lock {
*/
#define FUSE_FSYNC_FDATASYNC (1 << 0)

/**
* fuse_attr flags
*
* FUSE_ATTR_SUBMOUNT: Object is a submount root
*/
#define FUSE_ATTR_SUBMOUNT (1 << 0)

enum fuse_opcode {
FUSE_LOOKUP = 1,
FUSE_FORGET = 2, /* no reply */
Expand Down Expand Up @@ -496,11 +510,6 @@ struct fuse_entry_out {
struct fuse_attr attr;
};

struct fuse_entryver_out {
uint64_t version_index;
int64_t initial_version;
};

struct fuse_forget_in {
uint64_t nlookup;
};
Expand Down Expand Up @@ -894,17 +903,18 @@ struct fuse_copy_file_range_in {
};

#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
#define FUSE_SETUPMAPPING_FLAG_READ (1ull << 1)
struct fuse_setupmapping_in {
/* An already open handle */
uint64_t fh;
uint64_t fh;
/* Offset into the file to start the mapping */
uint64_t foffset;
uint64_t foffset;
/* Length of mapping required */
uint64_t len;
uint64_t len;
/* Flags, FUSE_SETUPMAPPING_FLAG_* */
uint64_t flags;
/* memory offset in to dax window */
uint64_t moffset;
uint64_t flags;
/* Offset in Memory Window */
uint64_t moffset;
};

struct fuse_removemapping_in {
Expand All @@ -913,10 +923,13 @@ struct fuse_removemapping_in {
};

struct fuse_removemapping_one {
/* Offset into the dax to start the unmapping */
/* Offset into the dax window start the unmapping */
uint64_t moffset;
/* Length of mapping required */
uint64_t len;
uint64_t len;
};

#define FUSE_REMOVEMAPPING_MAX_ENTRY \
(PAGE_SIZE / sizeof(struct fuse_removemapping_one))

#endif /* _LINUX_FUSE_H */

0 comments on commit 2275ed4

Please sign in to comment.