@@ -339,8 +339,8 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
339
339
}
340
340
341
341
fn statfs ( & self , _ctx : & Context , inode : Inode ) -> io:: Result < libc:: statvfs64 > {
342
- let data = self . inode_map . get ( inode) ?;
343
342
let mut out = MaybeUninit :: < libc:: statvfs64 > :: zeroed ( ) ;
343
+ let data = self . inode_map . get ( inode) ?;
344
344
let file = data. get_file ( ) ?;
345
345
346
346
// Safe because this will only modify `out` and we check the return value.
@@ -381,7 +381,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
381
381
) -> io:: Result < ( Option < Handle > , OpenOptions ) > {
382
382
if self . no_opendir . load ( Ordering :: Relaxed ) {
383
383
info ! ( "fuse: opendir is not supported." ) ;
384
- Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) )
384
+ Err ( enosys ( ) )
385
385
} else {
386
386
self . do_open ( inode, flags | ( libc:: O_DIRECTORY as u32 ) , 0 )
387
387
}
@@ -507,7 +507,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
507
507
) -> io:: Result < ( Option < Handle > , OpenOptions ) > {
508
508
if self . no_open . load ( Ordering :: Relaxed ) {
509
509
info ! ( "fuse: open is not supported." ) ;
510
- Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) )
510
+ Err ( enosys ( ) )
511
511
} else {
512
512
self . do_open ( inode, flags, fuse_flags)
513
513
}
@@ -524,7 +524,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
524
524
_lock_owner : Option < u64 > ,
525
525
) -> io:: Result < ( ) > {
526
526
if self . no_open . load ( Ordering :: Relaxed ) {
527
- Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) )
527
+ Err ( enosys ( ) )
528
528
} else {
529
529
self . do_release ( inode, handle)
530
530
}
@@ -764,13 +764,13 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
764
764
attr. st_uid
765
765
} else {
766
766
// Cannot use -1 here because these are unsigned values.
767
- :: std :: u32:: MAX
767
+ u32:: MAX
768
768
} ;
769
769
let gid = if valid. contains ( SetattrValid :: GID ) {
770
770
attr. st_gid
771
771
} else {
772
772
// Cannot use -1 here because these are unsigned values.
773
- :: std :: u32:: MAX
773
+ u32:: MAX
774
774
} ;
775
775
776
776
// Safe because this is a constant value and a valid C string.
@@ -1020,7 +1020,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
1020
1020
_lock_owner : u64 ,
1021
1021
) -> io:: Result < ( ) > {
1022
1022
if self . no_open . load ( Ordering :: Relaxed ) {
1023
- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1023
+ return Err ( enosys ( ) ) ;
1024
1024
}
1025
1025
1026
1026
let data = self . handle_map . get ( handle, inode) ?;
@@ -1128,7 +1128,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
1128
1128
flags : u32 ,
1129
1129
) -> io:: Result < ( ) > {
1130
1130
if !self . cfg . xattr {
1131
- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1131
+ return Err ( enosys ( ) ) ;
1132
1132
}
1133
1133
1134
1134
let data = self . inode_map . get ( inode) ?;
@@ -1163,7 +1163,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
1163
1163
size : u32 ,
1164
1164
) -> io:: Result < GetxattrReply > {
1165
1165
if !self . cfg . xattr {
1166
- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1166
+ return Err ( enosys ( ) ) ;
1167
1167
}
1168
1168
1169
1169
let data = self . inode_map . get ( inode) ?;
@@ -1198,7 +1198,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
1198
1198
1199
1199
fn listxattr ( & self , _ctx : & Context , inode : Inode , size : u32 ) -> io:: Result < ListxattrReply > {
1200
1200
if !self . cfg . xattr {
1201
- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1201
+ return Err ( enosys ( ) ) ;
1202
1202
}
1203
1203
1204
1204
let data = self . inode_map . get ( inode) ?;
@@ -1232,7 +1232,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
1232
1232
1233
1233
fn removexattr ( & self , _ctx : & Context , inode : Inode , name : & CStr ) -> io:: Result < ( ) > {
1234
1234
if !self . cfg . xattr {
1235
- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1235
+ return Err ( enosys ( ) ) ;
1236
1236
}
1237
1237
1238
1238
let data = self . inode_map . get ( inode) ?;
0 commit comments