@@ -226,6 +226,20 @@ struct MountPointData {
226
226
#[ derive( Debug , Copy , Clone ) ]
227
227
/// vfs init options
228
228
pub struct VfsOptions {
229
+ /// Make readdir/readdirplus request return zero dirent even if dir has children.
230
+ pub no_readdir : bool ,
231
+ /// Reject requests which will change the file size, or allocate file
232
+ /// blocks exceed file size.
233
+ pub seal_size : bool ,
234
+ /// File system options passed in from client
235
+ pub in_opts : FsOptions ,
236
+ /// File system options returned to client
237
+ pub out_opts : FsOptions ,
238
+ /// Declaration of ID mapping, in the format (internal ID, external ID, range).
239
+ /// For example, (0, 1, 65536) represents mapping the external UID/GID range of `1~65536`
240
+ /// to the range of `0~65535` within the filesystem.
241
+ pub id_mapping : ( u32 , u32 , u32 ) ,
242
+
229
243
/// Disable fuse open request handling. When enabled, fuse open
230
244
/// requests are always replied with ENOSYS.
231
245
#[ cfg( not( target_os = "macos" ) ) ]
@@ -238,24 +252,11 @@ pub struct VfsOptions {
238
252
/// buffer writes.
239
253
#[ cfg( not( target_os = "macos" ) ) ]
240
254
pub no_writeback : bool ,
241
- /// Make readdir/readdirplus request return zero dirent even if dir has children.
242
- pub no_readdir : bool ,
243
255
/// Enable fuse killpriv_v2 support. When enabled, fuse file system makes sure
244
256
/// to remove security.capability xattr and setuid/setgid bits. See details in
245
257
/// comments for HANDLE_KILLPRIV_V2
246
258
#[ cfg( not( target_os = "macos" ) ) ]
247
259
pub killpriv_v2 : bool ,
248
- /// Reject requests which will change the file size, or allocate file
249
- /// blocks exceed file size.
250
- pub seal_size : bool ,
251
- /// File system options passed in from client
252
- pub in_opts : FsOptions ,
253
- /// File system options returned to client
254
- pub out_opts : FsOptions ,
255
- /// Declaration of ID mapping, in the format (internal ID, external ID, range).
256
- /// For example, (0, 1, 65536) represents mapping the external UID/GID range of `1~65536`
257
- /// to the range of `0~65535` within the filesystem.
258
- pub id_mapping : ( u32 , u32 , u32 ) ,
259
260
}
260
261
261
262
impl VfsOptions {
@@ -265,8 +266,8 @@ impl VfsOptions {
265
266
}
266
267
267
268
impl Default for VfsOptions {
269
+ #[ cfg( not( target_os = "macos" ) ) ]
268
270
fn default ( ) -> Self {
269
- #[ cfg( not( target_os = "macos" ) ) ]
270
271
let out_opts = FsOptions :: ASYNC_READ
271
272
| FsOptions :: PARALLEL_DIROPS
272
273
| FsOptions :: BIG_WRITES
@@ -284,24 +285,30 @@ impl Default for VfsOptions {
284
285
| FsOptions :: ZERO_MESSAGE_OPENDIR
285
286
| FsOptions :: HANDLE_KILLPRIV_V2
286
287
| FsOptions :: PERFILE_DAX ;
287
- #[ cfg( target_os = "macos" ) ]
288
- let out_opts = FsOptions :: ASYNC_READ | FsOptions :: BIG_WRITES | FsOptions :: ATOMIC_O_TRUNC ;
289
288
VfsOptions {
290
- #[ cfg( not( target_os = "macos" ) ) ]
291
289
no_open : true ,
292
- #[ cfg( not( target_os = "macos" ) ) ]
293
290
no_opendir : true ,
294
- #[ cfg( not( target_os = "macos" ) ) ]
295
291
no_writeback : false ,
296
292
no_readdir : false ,
297
293
seal_size : false ,
298
- #[ cfg( not( target_os = "macos" ) ) ]
299
294
killpriv_v2 : false ,
300
295
in_opts : FsOptions :: empty ( ) ,
301
296
out_opts,
302
297
id_mapping : ( 0 , 0 , 0 ) ,
303
298
}
304
299
}
300
+
301
+ #[ cfg( target_os = "macos" ) ]
302
+ fn default ( ) -> Self {
303
+ let out_opts = FsOptions :: ASYNC_READ | FsOptions :: BIG_WRITES | FsOptions :: ATOMIC_O_TRUNC ;
304
+ VfsOptions {
305
+ no_readdir : false ,
306
+ seal_size : false ,
307
+ in_opts : FsOptions :: empty ( ) ,
308
+ out_opts,
309
+ id_mapping : ( 0 , 0 , 0 ) ,
310
+ }
311
+ }
305
312
}
306
313
307
314
/// A union fs that combines multiple backend file systems.
0 commit comments