Pull fuse updates from Miklos Szeredi: - Fix a regression introduced in 5.15 - Extend the size of the FUSE_INIT request to accommodate for more flags. There's a slight possibility of a regression for obscure fuse servers; if this happens, then more complexity will need to be added to the protocol - Allow the DAX property to be controlled by the server on a per-inode basis in virtiofs - Allow sending security context to the server when creating a file or directory * tag 'fuse-update-5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: Documentation/filesystem/dax: DAX on virtiofs fuse: mark inode DONT_CACHE when per inode DAX hint changes fuse: negotiate per inode DAX in FUSE_INIT fuse: enable per inode DAX fuse: support per inode DAX in fuse protocol fuse: make DAX mount option a tri-state fuse: add fuse_should_enable_dax() helper fuse: Pass correct lend value to filemap_write_and_wait_range() fuse: send security context of inode on file fuse: extend init flags
Showing the changes to include/uapi (1 of 8 files). Show all
Unified · Split
| @@ -187,6 +187,13 @@ · 186 unmodified lines | ||
| 187 | 187 | * |
| 188 | 188 | * 7.35 |
| 189 | 189 | * - add FOPEN_NOFLUSH |
| 190 | + * | |
| 191 | + * 7.36 | |
| 192 | + * - extend fuse_init_in with reserved fields, add FUSE_INIT_EXT init flag | |
| 193 | + * - add flags2 to fuse_init_in and fuse_init_out | |
| 194 | + * - add FUSE_SECURITY_CTX init flag | |
| 195 | + * - add security context to create, mkdir, symlink, and mknod requests | |
| 196 | + * - add FUSE_HAS_INODE_DAX, FUSE_ATTR_DAX | |
| 190 | 197 | */ |
| 191 | 198 | |
| 192 | 199 | #ifndef _LINUX_FUSE_H |
| @@ -222,7 +229,7 @@ · 29 unmodified lines | ||
| 222 | 229 | #define FUSE_KERNEL_VERSION 7 |
| 223 | 230 | |
| 224 | 231 | /** Minor version number of this interface */ |
| 225 | −#define FUSE_KERNEL_MINOR_VERSION 35 | |
| 232 | +#define FUSE_KERNEL_MINOR_VERSION 36 | |
| 226 | 233 | |
| 227 | 234 | /** The node ID of the root inode */ |
| 228 | 235 | #define FUSE_ROOT_ID 1 |
| @@ -341,6 +348,11 @@ struct fuse_file_lock { · 112 unmodified lines | ||
| 341 | 348 | * write/truncate sgid is killed only if file has group |
| 342 | 349 | * execute permission. (Same as Linux VFS behavior). |
| 343 | 350 | * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in |
| 351 | + * FUSE_INIT_EXT: extended fuse_init_in request | |
| 352 | + * FUSE_INIT_RESERVED: reserved, do not use | |
| 353 | + * FUSE_SECURITY_CTX: add security context to create, mkdir, symlink, and | |
| 354 | + * mknod | |
| 355 | + * FUSE_HAS_INODE_DAX: use per inode DAX | |
| 344 | 356 | */ |
| 345 | 357 | #define FUSE_ASYNC_READ (1 << 0) |
| 346 | 358 | #define FUSE_POSIX_LOCKS (1 << 1) |
| @@ -372,6 +384,11 @@ struct fuse_file_lock { · 25 unmodified lines | ||
| 372 | 384 | #define FUSE_SUBMOUNTS (1 << 27) |
| 373 | 385 | #define FUSE_HANDLE_KILLPRIV_V2 (1 << 28) |
| 374 | 386 | #define FUSE_SETXATTR_EXT (1 << 29) |
| 387 | +#define FUSE_INIT_EXT (1 << 30) | |
| 388 | +#define FUSE_INIT_RESERVED (1 << 31) | |
| 389 | +/* bits 32..63 get shifted down 32 bits into the flags2 field */ | |
| 390 | +#define FUSE_SECURITY_CTX (1ULL << 32) | |
| 391 | +#define FUSE_HAS_INODE_DAX (1ULL << 33) | |
| 375 | 392 | |
| 376 | 393 | /** |
| 377 | 394 | * CUSE INIT request/reply flags |
| @@ -454,8 +471,10 @@ struct fuse_file_lock { · 76 unmodified lines | ||
| 454 | 471 | * fuse_attr flags |
| 455 | 472 | * |
| 456 | 473 | * FUSE_ATTR_SUBMOUNT: Object is a submount root |
| 474 | + * FUSE_ATTR_DAX: Enable DAX for this file in per inode DAX mode | |
| 457 | 475 | */ |
| 458 | 476 | #define FUSE_ATTR_SUBMOUNT (1 << 0) |
| 477 | +#define FUSE_ATTR_DAX (1 << 1) | |
| 459 | 478 | |
| 460 | 479 | /** |
| 461 | 480 | * Open flags |
| @@ -741,6 +760,8 @@ struct fuse_init_in { · 279 unmodified lines | ||
| 741 | 760 | uint32_t minor; |
| 742 | 761 | uint32_t max_readahead; |
| 743 | 762 | uint32_t flags; |
| 763 | + uint32_t flags2; | |
| 764 | + uint32_t unused[11]; | |
| 744 | 765 | }; |
| 745 | 766 | |
| 746 | 767 | #define FUSE_COMPAT_INIT_OUT_SIZE 8 |
| @@ -757,7 +778,8 @@ struct fuse_init_out { · 10 unmodified lines | ||
| 757 | 778 | uint32_t time_gran; |
| 758 | 779 | uint16_t max_pages; |
| 759 | 780 | uint16_t map_alignment; |
| 760 | − uint32_t unused[8]; | |
| 781 | + uint32_t flags2; | |
| 782 | + uint32_t unused[7]; | |
| 761 | 783 | }; |
| 762 | 784 | |
| 763 | 785 | #define CUSE_INIT_INFO_MAX 4096 |
| @@ -865,9 +887,12 @@ struct fuse_dirent { · 101 unmodified lines | ||
| 865 | 887 | char name[]; |
| 866 | 888 | }; |
| 867 | 889 | |
| 868 | −#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) | |
| 869 | −#define FUSE_DIRENT_ALIGN(x) \ | |
| 890 | +/* Align variable length records to 64bit boundary */ | |
| 891 | +#define FUSE_REC_ALIGN(x) \ | |
| 870 | 892 | (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1)) |
| 893 | + | |
| 894 | +#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) | |
| 895 | +#define FUSE_DIRENT_ALIGN(x) FUSE_REC_ALIGN(x) | |
| 871 | 896 | #define FUSE_DIRENT_SIZE(d) \ |
| 872 | 897 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
| 873 | 898 | |
| @@ -984,4 +1009,26 @@ struct fuse_syncfs_in { · 110 unmodified lines | ||
| 984 | 1009 | uint64_t padding; |
| 985 | 1010 | }; |
| 986 | 1011 | |
| 1012 | +/* | |
| 1013 | + * For each security context, send fuse_secctx with size of security context | |
| 1014 | + * fuse_secctx will be followed by security context name and this in turn | |
| 1015 | + * will be followed by actual context label. | |
| 1016 | + * fuse_secctx, name, context | |
| 1017 | + */ | |
| 1018 | +struct fuse_secctx { | |
| 1019 | + uint32_t size; | |
| 1020 | + uint32_t padding; | |
| 1021 | +}; | |
| 1022 | + | |
| 1023 | +/* | |
| 1024 | + * Contains the information about how many fuse_secctx structures are being | |
| 1025 | + * sent and what's the total size of all security contexts (including | |
| 1026 | + * size of fuse_secctx_header). | |
| 1027 | + * | |
| 1028 | + */ | |
| 1029 | +struct fuse_secctx_header { | |
| 1030 | + uint32_t size; | |
| 1031 | + uint32_t nr_secctx; | |
| 1032 | +}; | |
| 1033 | + | |
| 987 | 1034 | #endif /* _LINUX_FUSE_H */ |