Skip to main content

fuser/ll/flags/
init_flags.rs

1//! Init request/reply flags.
2
3use bitflags::bitflags;
4
5bitflags! {
6    /// Init request/reply flags.
7    #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
8    pub struct InitFlags: u64 {
9        /// asynchronous read requests
10        const FUSE_ASYNC_READ = 1 << 0;
11        /// remote locking for POSIX file locks
12        const FUSE_POSIX_LOCKS = 1 << 1;
13        /// kernel sends file handle for fstat, etc...
14        const FUSE_FILE_OPS = 1 << 2;
15        /// handles the O_TRUNC open flag in the filesystem
16        const FUSE_ATOMIC_O_TRUNC = 1 << 3;
17        /// filesystem handles lookups of "." and ".."
18        const FUSE_EXPORT_SUPPORT = 1 << 4;
19        /// filesystem can handle write size larger than 4kB
20        const FUSE_BIG_WRITES = 1 << 5;
21        /// don't apply umask to file mode on create operations
22        const FUSE_DONT_MASK = 1 << 6;
23        /// kernel supports splice write on the device
24        const FUSE_SPLICE_WRITE = 1 << 7;
25        /// kernel supports splice move on the device
26        const FUSE_SPLICE_MOVE = 1 << 8;
27        /// kernel supports splice read on the device
28        const FUSE_SPLICE_READ = 1 << 9;
29        /// remote locking for BSD style file locks
30        const FUSE_FLOCK_LOCKS = 1 << 10;
31        /// kernel supports ioctl on directories
32        const FUSE_HAS_IOCTL_DIR = 1 << 11;
33        /// automatically invalidate cached pages
34        const FUSE_AUTO_INVAL_DATA = 1 << 12;
35        /// do READDIRPLUS (READDIR+LOOKUP in one)
36        const FUSE_DO_READDIRPLUS = 1 << 13;
37        /// adaptive readdirplus
38        const FUSE_READDIRPLUS_AUTO = 1 << 14;
39        /// asynchronous direct I/O submission
40        const FUSE_ASYNC_DIO = 1 << 15;
41        /// use writeback cache for buffered writes
42        const FUSE_WRITEBACK_CACHE = 1 << 16;
43        /// kernel supports zero-message opens
44        const FUSE_NO_OPEN_SUPPORT = 1 << 17;
45        /// allow parallel lookups and readdir
46        const FUSE_PARALLEL_DIROPS = 1 << 18;
47        /// fs handles killing suid/sgid/cap on write/chown/trunc
48        const FUSE_HANDLE_KILLPRIV = 1 << 19;
49        /// filesystem supports posix acls
50        const FUSE_POSIX_ACL = 1 << 20;
51        /// reading the device after abort returns ECONNABORTED
52        const FUSE_ABORT_ERROR = 1 << 21;
53        /// init_out.max_pages contains the max number of req pages
54        const FUSE_MAX_PAGES = 1 << 22;
55        /// cache READLINK responses
56        const FUSE_CACHE_SYMLINKS = 1 << 23;
57        /// kernel supports zero-message opendir
58        const FUSE_NO_OPENDIR_SUPPORT = 1 << 24;
59        /// only invalidate cached pages on explicit request
60        const FUSE_EXPLICIT_INVAL_DATA = 1 << 25;
61        /// map_alignment field is valid
62        const FUSE_MAP_ALIGNMENT = 1 << 26;
63        /// filesystem supports submounts
64        const FUSE_SUBMOUNTS = 1 << 27;
65        /// fs handles killing suid/sgid/cap on write/chown/trunc (v2)
66        const FUSE_HANDLE_KILLPRIV_V2 = 1 << 28;
67        /// extended setxattr support
68        const FUSE_SETXATTR_EXT = 1 << 29;
69        /// extended fuse_init_in request
70        const FUSE_INIT_EXT = 1 << 30;
71        /// reserved, do not use
72        const FUSE_INIT_RESERVED = 1 << 31;
73        /// add security context to create/mkdir/symlink/mknod
74        const FUSE_SECURITY_CTX = 1 << 32;
75        /// filesystem supports per-inode DAX
76        const FUSE_HAS_INODE_DAX = 1 << 33;
77        /// create with supplementary group
78        const FUSE_CREATE_SUPP_GROUP = 1 << 34;
79        /// kernel supports expire-only invalidation
80        const FUSE_HAS_EXPIRE_ONLY = 1 << 35;
81        /// allow mmap for direct I/O files
82        const FUSE_DIRECT_IO_ALLOW_MMAP = 1 << 36;
83        /// filesystem wants to use passthrough files
84        const FUSE_PASSTHROUGH = 1 << 37;
85        /// filesystem does not support export
86        const FUSE_NO_EXPORT_SUPPORT = 1 << 38;
87        /// kernel supports resend requests
88        const FUSE_HAS_RESEND = 1 << 39;
89        /// allow idmapped mounts
90        const FUSE_ALLOW_IDMAP = 1 << 40;
91        /// kernel supports io_uring for communication
92        const FUSE_OVER_IO_URING = 1 << 41;
93        /// kernel supports request timeout
94        const FUSE_REQUEST_TIMEOUT = 1 << 42;
95
96        /// pre-allocate space for a file
97        #[cfg(target_os = "macos")]
98        const FUSE_ALLOCATE = 1 << 27;
99        /// atomically exchange data between files
100        #[cfg(target_os = "macos")]
101        const FUSE_EXCHANGE_DATA = 1 << 28;
102        /// filesystem is case-insensitive
103        #[cfg(target_os = "macos")]
104        const FUSE_CASE_INSENSITIVE = 1 << 29;
105        /// filesystem supports volume renaming
106        #[cfg(target_os = "macos")]
107        const FUSE_VOL_RENAME = 1 << 30;
108        /// filesystem supports extended times (backup and creation times)
109        #[cfg(target_os = "macos")]
110        const FUSE_XTIMES = 1 << 31;
111    }
112}
113
114impl InitFlags {
115    /// Returns the flags as a pair of (low, high) u32 values.
116    /// The low value contains bits 0-31, the high value contains bits 32-63.
117    pub(crate) fn pair(self) -> (u32, u32) {
118        let bits = self.bits();
119        (bits as u32, (bits >> 32) as u32)
120    }
121}