@@ -735,7 +735,7 @@ impl FileSystem for Rafs {
735
735
let mut recorder = FopRecorder :: settle ( Getxattr , inode, & self . ios ) ;
736
736
737
737
if !self . xattr_supported ( ) {
738
- return Err ( std :: io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
738
+ return Err ( enosys ! ( ) ) ;
739
739
}
740
740
741
741
let name = OsStr :: from_bytes ( name. to_bytes ( ) ) ;
@@ -744,15 +744,15 @@ impl FileSystem for Rafs {
744
744
let r = match value {
745
745
Some ( value) => match size {
746
746
0 => Ok ( GetxattrReply :: Count ( ( value. len ( ) + 1 ) as u32 ) ) ,
747
- x if x < value. len ( ) as u32 => Err ( std :: io :: Error :: from_raw_os_error ( libc :: ERANGE ) ) ,
747
+ x if x < value. len ( ) as u32 => Err ( erange ! ( ) ) ,
748
748
_ => Ok ( GetxattrReply :: Value ( value) ) ,
749
749
} ,
750
750
None => {
751
751
// TODO: Hopefully, we can have a 'decorator' procedure macro in
752
752
// the future to wrap this method thus to handle different reasonable
753
753
// errors in a clean way.
754
754
recorder. mark_success ( 0 ) ;
755
- Err ( std :: io :: Error :: from_raw_os_error ( libc :: ENODATA ) )
755
+ Err ( enodata ! ( ) )
756
756
}
757
757
} ;
758
758
@@ -765,7 +765,7 @@ impl FileSystem for Rafs {
765
765
fn listxattr ( & self , _ctx : & Context , inode : u64 , size : u32 ) -> Result < ListxattrReply > {
766
766
let mut rec = FopRecorder :: settle ( Listxattr , inode, & self . ios ) ;
767
767
if !self . xattr_supported ( ) {
768
- return Err ( std :: io :: Error :: from_raw_os_error ( libc :: ENOSYS ) ) ;
768
+ return Err ( enosys ! ( ) ) ;
769
769
}
770
770
771
771
let inode = self . sb . get_inode ( inode, false ) ?;
@@ -783,7 +783,7 @@ impl FileSystem for Rafs {
783
783
784
784
match size {
785
785
0 => Ok ( ListxattrReply :: Count ( count as u32 ) ) ,
786
- x if x < count as u32 => Err ( std :: io :: Error :: from_raw_os_error ( libc :: ERANGE ) ) ,
786
+ x if x < count as u32 => Err ( erange ! ( ) ) ,
787
787
_ => Ok ( ListxattrReply :: Names ( buf) ) ,
788
788
}
789
789
}
0 commit comments