Skip to content

Commit ceec02d

Browse files
rhvgoyalMiklos Szeredi
authored andcommitted
virtiofs: introduce setupmapping/removemapping commands
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 <vgoyal@redhat.com> Signed-off-by: Peng Tao <tao.peng@linux.alibaba.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent fd1a1dc commit ceec02d

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

‎include/uapi/linux/fuse.h‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,4 +894,33 @@ struct fuse_copy_file_range_in {
894894
uint64_t flags;
895895
};
896896

897+
#define FUSE_SETUPMAPPING_FLAG_WRITE (1ull << 0)
898+
struct fuse_setupmapping_in {
899+
/* An already open handle */
900+
uint64_t fh;
901+
/* Offset into the file to start the mapping */
902+
uint64_t foffset;
903+
/* Length of mapping required */
904+
uint64_t len;
905+
/* Flags, FUSE_SETUPMAPPING_FLAG_* */
906+
uint64_t flags;
907+
/* Offset in Memory Window */
908+
uint64_t moffset;
909+
};
910+
911+
struct fuse_removemapping_in {
912+
/* number of fuse_removemapping_one follows */
913+
uint32_t count;
914+
};
915+
916+
struct fuse_removemapping_one {
917+
/* Offset into the dax window start the unmapping */
918+
uint64_t moffset;
919+
/* Length of mapping required */
920+
uint64_t len;
921+
};
922+
923+
#define FUSE_REMOVEMAPPING_MAX_ENTRY \
924+
(PAGE_SIZE / sizeof(struct fuse_removemapping_one))
925+
897926
#endif /* _LINUX_FUSE_H */

0 commit comments

Comments
 (0)