fuse.h (29eb5c2c86f935b0e9700fad2ecfe8a32b011d57) fuse.h (ef17dd6a8e6b6e3aeb29233996d44dfcb736d515)
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*
3 This file defines the kernel interface of FUSE
4 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
5
6 This program can be distributed under the terms of the GNU GPL.
7 See the file COPYING.
8

--- 170 unchanged lines hidden (view full) ---

179 * 7.33
180 * - add FUSE_HANDLE_KILLPRIV_V2, FUSE_WRITE_KILL_SUIDGID, FATTR_KILL_SUIDGID
181 * - add FUSE_OPEN_KILL_SUIDGID
182 * - extend fuse_setxattr_in, add FUSE_SETXATTR_EXT
183 * - add FUSE_SETXATTR_ACL_KILL_SGID
184 *
185 * 7.34
186 * - add FUSE_SYNCFS
1/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) */
2/*
3 This file defines the kernel interface of FUSE
4 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
5
6 This program can be distributed under the terms of the GNU GPL.
7 See the file COPYING.
8

--- 170 unchanged lines hidden (view full) ---

179 * 7.33
180 * - add FUSE_HANDLE_KILLPRIV_V2, FUSE_WRITE_KILL_SUIDGID, FATTR_KILL_SUIDGID
181 * - add FUSE_OPEN_KILL_SUIDGID
182 * - extend fuse_setxattr_in, add FUSE_SETXATTR_EXT
183 * - add FUSE_SETXATTR_ACL_KILL_SGID
184 *
185 * 7.34
186 * - add FUSE_SYNCFS
187 *
188 * 7.35
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
187 */
188
189#ifndef _LINUX_FUSE_H
190#define _LINUX_FUSE_H
191
192#include <stdint.h>
193
194/*

--- 15 unchanged lines hidden (view full) ---

210 * communication and reply with that major version (and an arbitrary
211 * supported minor version).
212 */
213
214/** Version number of this interface */
215#define FUSE_KERNEL_VERSION 7
216
217/** Minor version number of this interface */
197 */
198
199#ifndef _LINUX_FUSE_H
200#define _LINUX_FUSE_H
201
202#include <stdint.h>
203
204/*

--- 15 unchanged lines hidden (view full) ---

220 * communication and reply with that major version (and an arbitrary
221 * supported minor version).
222 */
223
224/** Version number of this interface */
225#define FUSE_KERNEL_VERSION 7
226
227/** Minor version number of this interface */
218#define FUSE_KERNEL_MINOR_VERSION 34
228#define FUSE_KERNEL_MINOR_VERSION 36
219
220/** The node ID of the root inode */
221#define FUSE_ROOT_ID 1
222
223/* Make sure all structures are padded to 64bit boundary, so 32bit
224 userspace works under 64bit kernels */
225
226struct fuse_attr {

--- 54 unchanged lines hidden (view full) ---

281/**
282 * Flags returned by the OPEN request
283 *
284 * FOPEN_DIRECT_IO: bypass page cache for this open file
285 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
286 * FOPEN_NONSEEKABLE: the file is not seekable
287 * FOPEN_CACHE_DIR: allow caching this directory
288 * FOPEN_STREAM: the file is stream-like (no file position at all)
229
230/** The node ID of the root inode */
231#define FUSE_ROOT_ID 1
232
233/* Make sure all structures are padded to 64bit boundary, so 32bit
234 userspace works under 64bit kernels */
235
236struct fuse_attr {

--- 54 unchanged lines hidden (view full) ---

291/**
292 * Flags returned by the OPEN request
293 *
294 * FOPEN_DIRECT_IO: bypass page cache for this open file
295 * FOPEN_KEEP_CACHE: don't invalidate the data cache on open
296 * FOPEN_NONSEEKABLE: the file is not seekable
297 * FOPEN_CACHE_DIR: allow caching this directory
298 * FOPEN_STREAM: the file is stream-like (no file position at all)
299 * FOPEN_NOFLUSH: don't flush data cache on close (unless FUSE_WRITEBACK_CACHE)
289 */
290#define FOPEN_DIRECT_IO (1 << 0)
291#define FOPEN_KEEP_CACHE (1 << 1)
292#define FOPEN_NONSEEKABLE (1 << 2)
293#define FOPEN_CACHE_DIR (1 << 3)
294#define FOPEN_STREAM (1 << 4)
300 */
301#define FOPEN_DIRECT_IO (1 << 0)
302#define FOPEN_KEEP_CACHE (1 << 1)
303#define FOPEN_NONSEEKABLE (1 << 2)
304#define FOPEN_CACHE_DIR (1 << 3)
305#define FOPEN_STREAM (1 << 4)
306#define FOPEN_NOFLUSH (1 << 5)
295
296/**
297 * INIT request/reply flags
298 *
299 * FUSE_ASYNC_READ: asynchronous read requests
300 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
301 * FUSE_FILE_OPS: kernel sends file handle for fstat, etc... (not yet supported)
302 * FUSE_ATOMIC_O_TRUNC: handles the O_TRUNC open flag in the filesystem

--- 24 unchanged lines hidden (view full) ---

327 * fuse_setupmapping_out and fuse_removemapping_one.
328 * FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts
329 * FUSE_HANDLE_KILLPRIV_V2: fs kills suid/sgid/cap on write/chown/trunc.
330 * Upon write/truncate suid/sgid is only killed if caller
331 * does not have CAP_FSETID. Additionally upon
332 * write/truncate sgid is killed only if file has group
333 * execute permission. (Same as Linux VFS behavior).
334 * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in
307
308/**
309 * INIT request/reply flags
310 *
311 * FUSE_ASYNC_READ: asynchronous read requests
312 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
313 * FUSE_FILE_OPS: kernel sends file handle for fstat, etc... (not yet supported)
314 * FUSE_ATOMIC_O_TRUNC: handles the O_TRUNC open flag in the filesystem

--- 24 unchanged lines hidden (view full) ---

339 * fuse_setupmapping_out and fuse_removemapping_one.
340 * FUSE_SUBMOUNTS: kernel supports auto-mounting directory submounts
341 * FUSE_HANDLE_KILLPRIV_V2: fs kills suid/sgid/cap on write/chown/trunc.
342 * Upon write/truncate suid/sgid is only killed if caller
343 * does not have CAP_FSETID. Additionally upon
344 * write/truncate sgid is killed only if file has group
345 * execute permission. (Same as Linux VFS behavior).
346 * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in
347 * FUSE_INIT_EXT: extended fuse_init_in request
348 * FUSE_INIT_RESERVED: reserved, do not use
349 * FUSE_SECURITY_CTX: add security context to create, mkdir, symlink, and
350 * mknod
351 * FUSE_HAS_INODE_DAX: use per inode DAX
335 */
336#define FUSE_ASYNC_READ (1 << 0)
337#define FUSE_POSIX_LOCKS (1 << 1)
338#define FUSE_FILE_OPS (1 << 2)
339#define FUSE_ATOMIC_O_TRUNC (1 << 3)
340#define FUSE_EXPORT_SUPPORT (1 << 4)
341#define FUSE_BIG_WRITES (1 << 5)
342#define FUSE_DONT_MASK (1 << 6)

--- 15 unchanged lines hidden (view full) ---

358#define FUSE_MAX_PAGES (1 << 22)
359#define FUSE_CACHE_SYMLINKS (1 << 23)
360#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
361#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
362#define FUSE_MAP_ALIGNMENT (1 << 26)
363#define FUSE_SUBMOUNTS (1 << 27)
364#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
365#define FUSE_SETXATTR_EXT (1 << 29)
352 */
353#define FUSE_ASYNC_READ (1 << 0)
354#define FUSE_POSIX_LOCKS (1 << 1)
355#define FUSE_FILE_OPS (1 << 2)
356#define FUSE_ATOMIC_O_TRUNC (1 << 3)
357#define FUSE_EXPORT_SUPPORT (1 << 4)
358#define FUSE_BIG_WRITES (1 << 5)
359#define FUSE_DONT_MASK (1 << 6)

--- 15 unchanged lines hidden (view full) ---

375#define FUSE_MAX_PAGES (1 << 22)
376#define FUSE_CACHE_SYMLINKS (1 << 23)
377#define FUSE_NO_OPENDIR_SUPPORT (1 << 24)
378#define FUSE_EXPLICIT_INVAL_DATA (1 << 25)
379#define FUSE_MAP_ALIGNMENT (1 << 26)
380#define FUSE_SUBMOUNTS (1 << 27)
381#define FUSE_HANDLE_KILLPRIV_V2 (1 << 28)
382#define FUSE_SETXATTR_EXT (1 << 29)
383#define FUSE_INIT_EXT (1 << 30)
384#define FUSE_INIT_RESERVED (1 << 31)
385/* bits 32..63 get shifted down 32 bits into the flags2 field */
386#define FUSE_SECURITY_CTX (1ULL << 32)
387#define FUSE_HAS_INODE_DAX (1ULL << 33)
366
367/**
368 * CUSE INIT request/reply flags
369 *
370 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
371 */
372#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
373

--- 66 unchanged lines hidden (view full) ---

440 * FUSE_FSYNC_FDATASYNC: Sync data only, not metadata
441 */
442#define FUSE_FSYNC_FDATASYNC (1 << 0)
443
444/**
445 * fuse_attr flags
446 *
447 * FUSE_ATTR_SUBMOUNT: Object is a submount root
388
389/**
390 * CUSE INIT request/reply flags
391 *
392 * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl
393 */
394#define CUSE_UNRESTRICTED_IOCTL (1 << 0)
395

--- 66 unchanged lines hidden (view full) ---

462 * FUSE_FSYNC_FDATASYNC: Sync data only, not metadata
463 */
464#define FUSE_FSYNC_FDATASYNC (1 << 0)
465
466/**
467 * fuse_attr flags
468 *
469 * FUSE_ATTR_SUBMOUNT: Object is a submount root
470 * FUSE_ATTR_DAX: Enable DAX for this file in per inode DAX mode
448 */
449#define FUSE_ATTR_SUBMOUNT (1 << 0)
471 */
472#define FUSE_ATTR_SUBMOUNT (1 << 0)
473#define FUSE_ATTR_DAX (1 << 1)
450
451/**
452 * Open flags
453 * FUSE_OPEN_KILL_SUIDGID: Kill suid and sgid if executable
454 */
455#define FUSE_OPEN_KILL_SUIDGID (1 << 0)
456
457/**

--- 269 unchanged lines hidden (view full) ---

727 uint32_t padding;
728};
729
730struct fuse_init_in {
731 uint32_t major;
732 uint32_t minor;
733 uint32_t max_readahead;
734 uint32_t flags;
474
475/**
476 * Open flags
477 * FUSE_OPEN_KILL_SUIDGID: Kill suid and sgid if executable
478 */
479#define FUSE_OPEN_KILL_SUIDGID (1 << 0)
480
481/**

--- 269 unchanged lines hidden (view full) ---

751 uint32_t padding;
752};
753
754struct fuse_init_in {
755 uint32_t major;
756 uint32_t minor;
757 uint32_t max_readahead;
758 uint32_t flags;
759 uint32_t flags2;
760 uint32_t unused[11];
735};
736
737#define FUSE_COMPAT_INIT_OUT_SIZE 8
738#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
739
740struct fuse_init_out {
741 uint32_t major;
742 uint32_t minor;
743 uint32_t max_readahead;
744 uint32_t flags;
745 uint16_t max_background;
746 uint16_t congestion_threshold;
747 uint32_t max_write;
748 uint32_t time_gran;
749 uint16_t max_pages;
750 uint16_t map_alignment;
761};
762
763#define FUSE_COMPAT_INIT_OUT_SIZE 8
764#define FUSE_COMPAT_22_INIT_OUT_SIZE 24
765
766struct fuse_init_out {
767 uint32_t major;
768 uint32_t minor;
769 uint32_t max_readahead;
770 uint32_t flags;
771 uint16_t max_background;
772 uint16_t congestion_threshold;
773 uint32_t max_write;
774 uint32_t time_gran;
775 uint16_t max_pages;
776 uint16_t map_alignment;
751 uint32_t unused[8];
777 uint32_t flags2;
778 uint32_t unused[7];
752};
753
754#define CUSE_INIT_INFO_MAX 4096
755
756struct cuse_init_in {
757 uint32_t major;
758 uint32_t minor;
759 uint32_t unused;

--- 91 unchanged lines hidden (view full) ---

851struct fuse_dirent {
852 uint64_t ino;
853 uint64_t off;
854 uint32_t namelen;
855 uint32_t type;
856 char name[];
857};
858
779};
780
781#define CUSE_INIT_INFO_MAX 4096
782
783struct cuse_init_in {
784 uint32_t major;
785 uint32_t minor;
786 uint32_t unused;

--- 91 unchanged lines hidden (view full) ---

878struct fuse_dirent {
879 uint64_t ino;
880 uint64_t off;
881 uint32_t namelen;
882 uint32_t type;
883 char name[];
884};
885
859#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
860#define FUSE_DIRENT_ALIGN(x) \
886/* Align variable length records to 64bit boundary */
887#define FUSE_REC_ALIGN(x) \
861 (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
888 (((x) + sizeof(uint64_t) - 1) & ~(sizeof(uint64_t) - 1))
889
890#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
891#define FUSE_DIRENT_ALIGN(x) FUSE_REC_ALIGN(x)
862#define FUSE_DIRENT_SIZE(d) \
863 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
864
865struct fuse_direntplus {
866 struct fuse_entry_out entry_out;
867 struct fuse_dirent dirent;
868};
869

--- 100 unchanged lines hidden (view full) ---

970
971#define FUSE_REMOVEMAPPING_MAX_ENTRY \
972 (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
973
974struct fuse_syncfs_in {
975 uint64_t padding;
976};
977
892#define FUSE_DIRENT_SIZE(d) \
893 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
894
895struct fuse_direntplus {
896 struct fuse_entry_out entry_out;
897 struct fuse_dirent dirent;
898};
899

--- 100 unchanged lines hidden (view full) ---

1000
1001#define FUSE_REMOVEMAPPING_MAX_ENTRY \
1002 (PAGE_SIZE / sizeof(struct fuse_removemapping_one))
1003
1004struct fuse_syncfs_in {
1005 uint64_t padding;
1006};
1007
1008/*
1009 * For each security context, send fuse_secctx with size of security context
1010 * fuse_secctx will be followed by security context name and this in turn
1011 * will be followed by actual context label.
1012 * fuse_secctx, name, context
1013 */
1014struct fuse_secctx {
1015 uint32_t size;
1016 uint32_t padding;
1017};
1018
1019/*
1020 * Contains the information about how many fuse_secctx structures are being
1021 * sent and what's the total size of all security contexts (including
1022 * size of fuse_secctx_header).
1023 *
1024 */
1025struct fuse_secctx_header {
1026 uint32_t size;
1027 uint32_t nr_secctx;
1028};
1029
978#endif /* _LINUX_FUSE_H */
1030#endif /* _LINUX_FUSE_H */