Skip to content

Commit

Permalink
virtiofs: introduce setupmapping/removemapping commands
Browse files Browse the repository at this point in the history
Introduce two new fuse commands to setup/remove memory mappings. This
will be used to setup/tear down file mapping in dax window.

Signed-off-by: Vivek Goyal <[email protected]>
Signed-off-by: Peng Tao <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
rhvgoyal authored and Miklos Szeredi committed Sep 10, 2020
1 parent fd1a1dc commit ceec02d
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions include/uapi/linux/fuse.h
Original file line number Diff line number Diff line change
Expand Up @@ -894,4 +894,33 @@ struct fuse_copy_file_range_in {
uint64_t flags;
};

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

struct fuse_removemapping_in {
/* number of fuse_removemapping_one follows */
uint32_t count;
};

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

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

#endif /* _LINUX_FUSE_H */

0 comments on commit ceec02d

Please sign in to comment.