@@ -2,8 +2,6 @@ use std::{
22 io,
33 mem:: { self , size_of} ,
44 os:: fd:: { AsRawFd , RawFd } ,
5- sync:: atomic:: Ordering ,
6- time:: Duration ,
75} ;
86use vm_memory:: { bitmap:: BitmapSlice , ByteValued } ;
97
@@ -13,7 +11,7 @@ use crate::{
1311 passthrough:: { os_compat:: LinuxDirent64 , util:: einval} ,
1412} ;
1513
16- use super :: { util :: stat_fd , Handle , Inode , LibCStat , OffT , PassthroughFs } ;
14+ use super :: { Handle , Inode , OffT , PassthroughFs } ;
1715
1816impl < S : BitmapSlice + Send + Sync > PassthroughFs < S > {
1917 pub fn do_readdir (
@@ -67,7 +65,6 @@ impl<S: BitmapSlice + Send + Sync> PassthroughFs<S> {
6765 let mut rem = & buf[ ..] ;
6866 let orig_rem_len = rem. len ( ) ;
6967
70- #[ cfg( target_os = "linux" ) ]
7168 while !rem. is_empty ( ) {
7269 // We only use debug asserts here because these values are coming from the kernel and we
7370 // trust them implicitly.
@@ -137,32 +134,4 @@ impl<S: BitmapSlice + Send + Sync> PassthroughFs<S> {
137134
138135 Ok ( ( ) )
139136 }
140-
141- pub fn do_getattr (
142- & self ,
143- inode : Inode ,
144- handle : Option < Handle > ,
145- ) -> io:: Result < ( LibCStat , Duration ) > {
146- let st;
147- let data = self . inode_map . get ( inode) . map_err ( |e| {
148- error ! ( "fuse: do_getattr ino {} Not find err {:?}" , inode, e) ;
149- e
150- } ) ?;
151-
152- // kernel sends 0 as handle in case of no_open, and it depends on fuse server to handle
153- // this case correctly.
154- if !self . no_open . load ( Ordering :: Relaxed ) && handle. is_some ( ) {
155- // Safe as we just checked handle
156- let hd = self . handle_map . get ( handle. unwrap ( ) , inode) ?;
157- st = stat_fd ( hd. get_file ( ) , None ) ;
158- } else {
159- st = data. handle . stat ( ) ;
160- }
161-
162- let st = st. map_err ( |e| {
163- error ! ( "fuse: do_getattr stat failed ino {} err {:?}" , inode, e) ;
164- e
165- } ) ?;
166- Ok ( ( st, self . cfg . attr_timeout ) )
167- }
168137}
0 commit comments