@@ -60,15 +60,15 @@ impl<'a, S: BitmapSlice> io::Read for AsyncZcReader<'a, S> {
6060 }
6161}
6262
63- struct AsyncZcWriter < ' a , S : BitmapSlice = ( ) > ( Writer < ' a , S > ) ;
63+ struct AsyncZcWriter < ' a , ' b , S : BitmapSlice = ( ) > ( Writer < ' a , ' b , S > ) ;
6464
6565// The underlying VolatileSlice contains "*mut u8", which is just a pointer to a u8 array.
6666// Actually we rely on the AsyncExecutor is a single-threaded worker, and we do not really send
6767// 'Reader' to other threads.
68- unsafe impl < ' a , S : BitmapSlice > Send for AsyncZcWriter < ' a , S > { }
68+ unsafe impl < ' a , ' b , S : BitmapSlice > Send for AsyncZcWriter < ' a , ' b , S > { }
6969
7070#[ async_trait( ?Send ) ]
71- impl < ' a , S : BitmapSlice > AsyncZeroCopyWriter for AsyncZcWriter < ' a , S > {
71+ impl < ' a , ' b , S : BitmapSlice > AsyncZeroCopyWriter for AsyncZcWriter < ' a , ' b , S > {
7272 async fn async_write_from (
7373 & mut self ,
7474 f : Arc < dyn AsyncFileReadWriteVolatile > ,
@@ -79,7 +79,7 @@ impl<'a, S: BitmapSlice> AsyncZeroCopyWriter for AsyncZcWriter<'a, S> {
7979 }
8080}
8181
82- impl < ' a , S : BitmapSlice > ZeroCopyWriter for AsyncZcWriter < ' a , S > {
82+ impl < ' a , ' b , S : BitmapSlice > ZeroCopyWriter for AsyncZcWriter < ' a , ' b , S > {
8383 fn write_from (
8484 & mut self ,
8585 f : & mut dyn FileReadWriteVolatile ,
@@ -94,7 +94,7 @@ impl<'a, S: BitmapSlice> ZeroCopyWriter for AsyncZcWriter<'a, S> {
9494 }
9595}
9696
97- impl < ' a , S : BitmapSlice > io:: Write for AsyncZcWriter < ' a , S > {
97+ impl < ' a , ' b , S : BitmapSlice > io:: Write for AsyncZcWriter < ' a , ' b , S > {
9898 fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
9999 self . 0 . write ( buf)
100100 }
@@ -120,7 +120,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
120120 pub async unsafe fn async_handle_message < S : BitmapSlice > (
121121 & self ,
122122 mut r : Reader < ' _ , S > ,
123- w : Writer < ' _ , S > ,
123+ w : Writer < ' _ , ' _ , S > ,
124124 vu_req : Option < & mut dyn FsCacheReqHandler > ,
125125 hook : Option < & dyn MetricsHook > ,
126126 ) -> Result < usize > {
@@ -214,7 +214,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
214214 res
215215 }
216216
217- async fn async_lookup < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
217+ async fn async_lookup < S : BitmapSlice > (
218+ & self ,
219+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
220+ ) -> Result < usize > {
218221 let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , 0 ) ?;
219222 let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
220223 Ok ( name) => name,
@@ -226,8 +229,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
226229 return Err ( e) ;
227230 }
228231 } ;
229-
230- let version = self . vers . load ( ) ;
232+ let version = & self . meta . load ( ) . version ;
231233 let result = self
232234 . fs
233235 . async_lookup ( ctx. context ( ) , ctx. nodeid ( ) , name)
@@ -250,7 +252,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
250252 }
251253 }
252254
253- async fn async_getattr < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
255+ async fn async_getattr < S : BitmapSlice > (
256+ & self ,
257+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
258+ ) -> Result < usize > {
254259 let GetattrIn { flags, fh, .. } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
255260 let handle = if ( flags & GETATTR_FH ) != 0 {
256261 Some ( fh. into ( ) )
@@ -265,7 +270,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
265270 ctx. async_handle_attr_result ( result) . await
266271 }
267272
268- async fn async_setattr < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
273+ async fn async_setattr < S : BitmapSlice > (
274+ & self ,
275+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
276+ ) -> Result < usize > {
269277 let setattr_in: SetattrIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
270278 let handle = if setattr_in. valid & FATTR_FH != 0 {
271279 Some ( setattr_in. fh . into ( ) )
@@ -282,7 +290,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
282290 ctx. async_handle_attr_result ( result) . await
283291 }
284292
285- async fn async_open < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
293+ async fn async_open < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , ' _ , F , S > ) -> Result < usize > {
286294 let OpenIn { flags, fuse_flags } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
287295 let result = self
288296 . fs
@@ -303,7 +311,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
303311 }
304312 }
305313
306- async fn async_read < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
314+ async fn async_read < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , ' _ , F , S > ) -> Result < usize > {
307315 let ReadIn {
308316 fh,
309317 offset,
@@ -361,7 +369,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
361369 . await
362370 . map_err ( Error :: EncodeMessage ) ?;
363371 ctx. w
364- . async_commit ( Some ( & data_writer. 0 ) )
372+ . async_commit ( Some ( & mut data_writer. 0 ) )
365373 . await
366374 . map_err ( Error :: EncodeMessage ) ?;
367375 Ok ( out. len as usize )
@@ -370,7 +378,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
370378 }
371379 }
372380
373- async fn async_write < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
381+ async fn async_write < S : BitmapSlice > (
382+ & self ,
383+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
384+ ) -> Result < usize > {
374385 let WriteIn {
375386 fh,
376387 offset,
@@ -422,7 +433,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
422433 }
423434 }
424435
425- async fn async_fsync < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
436+ async fn async_fsync < S : BitmapSlice > (
437+ & self ,
438+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
439+ ) -> Result < usize > {
426440 let FsyncIn {
427441 fh, fsync_flags, ..
428442 } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -438,7 +452,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
438452 }
439453 }
440454
441- async fn async_fsyncdir < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
455+ async fn async_fsyncdir < S : BitmapSlice > (
456+ & self ,
457+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
458+ ) -> Result < usize > {
442459 let FsyncIn {
443460 fh, fsync_flags, ..
444461 } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -454,7 +471,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
454471 }
455472 }
456473
457- async fn async_create < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
474+ async fn async_create < S : BitmapSlice > (
475+ & self ,
476+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
477+ ) -> Result < usize > {
458478 let args: CreateIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
459479 let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , size_of :: < CreateIn > ( ) ) ?;
460480 let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
@@ -500,7 +520,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
500520
501521 async fn async_fallocate < S : BitmapSlice > (
502522 & self ,
503- mut ctx : SrvContext < ' _ , F , S > ,
523+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
504524 ) -> Result < usize > {
505525 let FallocateIn {
506526 fh,
@@ -521,7 +541,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
521541 }
522542}
523543
524- impl < ' a , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , F , S > {
544+ impl < ' a , ' b , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , ' b , F , S > {
525545 async fn async_reply_ok < T : ByteValued > (
526546 & mut self ,
527547 out : Option < T > ,
0 commit comments