@@ -339,8 +339,8 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
339339 }
340340
341341 fn statfs ( & self , _ctx : & Context , inode : Inode ) -> io:: Result < libc:: statvfs64 > {
342- let data = self . inode_map . get ( inode) ?;
343342 let mut out = MaybeUninit :: < libc:: statvfs64 > :: zeroed ( ) ;
343+ let data = self . inode_map . get ( inode) ?;
344344 let file = data. get_file ( ) ?;
345345
346346 // 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> {
381381 ) -> io:: Result < ( Option < Handle > , OpenOptions ) > {
382382 if self . no_opendir . load ( Ordering :: Relaxed ) {
383383 info ! ( "fuse: opendir is not supported." ) ;
384- Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) )
384+ Err ( enosys ( ) )
385385 } else {
386386 self . do_open ( inode, flags | ( libc:: O_DIRECTORY as u32 ) , 0 )
387387 }
@@ -507,7 +507,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
507507 ) -> io:: Result < ( Option < Handle > , OpenOptions ) > {
508508 if self . no_open . load ( Ordering :: Relaxed ) {
509509 info ! ( "fuse: open is not supported." ) ;
510- Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) )
510+ Err ( enosys ( ) )
511511 } else {
512512 self . do_open ( inode, flags, fuse_flags)
513513 }
@@ -524,7 +524,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
524524 _lock_owner : Option < u64 > ,
525525 ) -> io:: Result < ( ) > {
526526 if self . no_open . load ( Ordering :: Relaxed ) {
527- Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) )
527+ Err ( enosys ( ) )
528528 } else {
529529 self . do_release ( inode, handle)
530530 }
@@ -764,13 +764,13 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
764764 attr. st_uid
765765 } else {
766766 // Cannot use -1 here because these are unsigned values.
767- :: std :: u32:: MAX
767+ u32:: MAX
768768 } ;
769769 let gid = if valid. contains ( SetattrValid :: GID ) {
770770 attr. st_gid
771771 } else {
772772 // Cannot use -1 here because these are unsigned values.
773- :: std :: u32:: MAX
773+ u32:: MAX
774774 } ;
775775
776776 // 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> {
10201020 _lock_owner : u64 ,
10211021 ) -> io:: Result < ( ) > {
10221022 if self . no_open . load ( Ordering :: Relaxed ) {
1023- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1023+ return Err ( enosys ( ) ) ;
10241024 }
10251025
10261026 let data = self . handle_map . get ( handle, inode) ?;
@@ -1128,7 +1128,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
11281128 flags : u32 ,
11291129 ) -> io:: Result < ( ) > {
11301130 if !self . cfg . xattr {
1131- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1131+ return Err ( enosys ( ) ) ;
11321132 }
11331133
11341134 let data = self . inode_map . get ( inode) ?;
@@ -1163,7 +1163,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
11631163 size : u32 ,
11641164 ) -> io:: Result < GetxattrReply > {
11651165 if !self . cfg . xattr {
1166- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1166+ return Err ( enosys ( ) ) ;
11671167 }
11681168
11691169 let data = self . inode_map . get ( inode) ?;
@@ -1198,7 +1198,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
11981198
11991199 fn listxattr ( & self , _ctx : & Context , inode : Inode , size : u32 ) -> io:: Result < ListxattrReply > {
12001200 if !self . cfg . xattr {
1201- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1201+ return Err ( enosys ( ) ) ;
12021202 }
12031203
12041204 let data = self . inode_map . get ( inode) ?;
@@ -1232,7 +1232,7 @@ impl<S: BitmapSlice + Send + Sync> FileSystem for PassthroughFs<S> {
12321232
12331233 fn removexattr ( & self , _ctx : & Context , inode : Inode , name : & CStr ) -> io:: Result < ( ) > {
12341234 if !self . cfg . xattr {
1235- return Err ( io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
1235+ return Err ( enosys ( ) ) ;
12361236 }
12371237
12381238 let data = self . inode_map . get ( inode) ?;
0 commit comments