@@ -60,15 +60,15 @@ impl<'a, S: BitmapSlice> io::Read for AsyncZcReader<'a, S> {
60
60
}
61
61
}
62
62
63
- struct AsyncZcWriter < ' a , S : BitmapSlice = ( ) > ( Writer < ' a , S > ) ;
63
+ struct AsyncZcWriter < ' a , ' b , S : BitmapSlice = ( ) > ( Writer < ' a , ' b , S > ) ;
64
64
65
65
// The underlying VolatileSlice contains "*mut u8", which is just a pointer to a u8 array.
66
66
// Actually we rely on the AsyncExecutor is a single-threaded worker, and we do not really send
67
67
// '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 > { }
69
69
70
70
#[ 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 > {
72
72
async fn async_write_from (
73
73
& mut self ,
74
74
f : Arc < dyn AsyncFileReadWriteVolatile > ,
@@ -79,7 +79,7 @@ impl<'a, S: BitmapSlice> AsyncZeroCopyWriter for AsyncZcWriter<'a, S> {
79
79
}
80
80
}
81
81
82
- impl < ' a , S : BitmapSlice > ZeroCopyWriter for AsyncZcWriter < ' a , S > {
82
+ impl < ' a , ' b , S : BitmapSlice > ZeroCopyWriter for AsyncZcWriter < ' a , ' b , S > {
83
83
fn write_from (
84
84
& mut self ,
85
85
f : & mut dyn FileReadWriteVolatile ,
@@ -94,7 +94,7 @@ impl<'a, S: BitmapSlice> ZeroCopyWriter for AsyncZcWriter<'a, S> {
94
94
}
95
95
}
96
96
97
- impl < ' a , S : BitmapSlice > io:: Write for AsyncZcWriter < ' a , S > {
97
+ impl < ' a , ' b , S : BitmapSlice > io:: Write for AsyncZcWriter < ' a , ' b , S > {
98
98
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
99
99
self . 0 . write ( buf)
100
100
}
@@ -120,7 +120,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
120
120
pub async unsafe fn async_handle_message < S : BitmapSlice > (
121
121
& self ,
122
122
mut r : Reader < ' _ , S > ,
123
- w : Writer < ' _ , S > ,
123
+ w : Writer < ' _ , ' _ , S > ,
124
124
vu_req : Option < & mut dyn FsCacheReqHandler > ,
125
125
hook : Option < & dyn MetricsHook > ,
126
126
) -> Result < usize > {
@@ -222,7 +222,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
222
222
res
223
223
}
224
224
225
- async fn async_lookup < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
225
+ async fn async_lookup < S : BitmapSlice > (
226
+ & self ,
227
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
228
+ ) -> Result < usize > {
226
229
let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , 0 ) ?;
227
230
let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
228
231
Ok ( name) => name,
@@ -234,8 +237,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
234
237
return Err ( e) ;
235
238
}
236
239
} ;
237
-
238
- let version = self . vers . load ( ) ;
240
+ let version = & self . meta . load ( ) . version ;
239
241
let result = self
240
242
. fs
241
243
. async_lookup ( ctx. context ( ) , ctx. nodeid ( ) , name)
@@ -258,7 +260,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
258
260
}
259
261
}
260
262
261
- async fn async_getattr < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
263
+ async fn async_getattr < S : BitmapSlice > (
264
+ & self ,
265
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
266
+ ) -> Result < usize > {
262
267
let GetattrIn { flags, fh, .. } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
263
268
let handle = if ( flags & GETATTR_FH ) != 0 {
264
269
Some ( fh. into ( ) )
@@ -273,7 +278,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
273
278
ctx. async_handle_attr_result ( result) . await
274
279
}
275
280
276
- async fn async_setattr < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
281
+ async fn async_setattr < S : BitmapSlice > (
282
+ & self ,
283
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
284
+ ) -> Result < usize > {
277
285
let setattr_in: SetattrIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
278
286
let handle = if setattr_in. valid & FATTR_FH != 0 {
279
287
Some ( setattr_in. fh . into ( ) )
@@ -290,7 +298,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
290
298
ctx. async_handle_attr_result ( result) . await
291
299
}
292
300
293
- async fn async_open < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
301
+ async fn async_open < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , ' _ , F , S > ) -> Result < usize > {
294
302
let OpenIn { flags, fuse_flags } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
295
303
let result = self
296
304
. fs
@@ -311,7 +319,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
311
319
}
312
320
}
313
321
314
- async fn async_read < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
322
+ async fn async_read < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , ' _ , F , S > ) -> Result < usize > {
315
323
let ReadIn {
316
324
fh,
317
325
offset,
@@ -369,7 +377,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
369
377
. await
370
378
. map_err ( Error :: EncodeMessage ) ?;
371
379
ctx. w
372
- . async_commit ( Some ( & data_writer. 0 ) )
380
+ . async_commit ( Some ( & mut data_writer. 0 ) )
373
381
. await
374
382
. map_err ( Error :: EncodeMessage ) ?;
375
383
Ok ( out. len as usize )
@@ -378,7 +386,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
378
386
}
379
387
}
380
388
381
- async fn async_write < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
389
+ async fn async_write < S : BitmapSlice > (
390
+ & self ,
391
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
392
+ ) -> Result < usize > {
382
393
let WriteIn {
383
394
fh,
384
395
offset,
@@ -430,7 +441,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
430
441
}
431
442
}
432
443
433
- async fn async_fsync < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
444
+ async fn async_fsync < S : BitmapSlice > (
445
+ & self ,
446
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
447
+ ) -> Result < usize > {
434
448
let FsyncIn {
435
449
fh, fsync_flags, ..
436
450
} = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -446,7 +460,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
446
460
}
447
461
}
448
462
449
- async fn async_fsyncdir < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
463
+ async fn async_fsyncdir < S : BitmapSlice > (
464
+ & self ,
465
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
466
+ ) -> Result < usize > {
450
467
let FsyncIn {
451
468
fh, fsync_flags, ..
452
469
} = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -462,7 +479,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
462
479
}
463
480
}
464
481
465
- async fn async_create < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
482
+ async fn async_create < S : BitmapSlice > (
483
+ & self ,
484
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
485
+ ) -> Result < usize > {
466
486
let args: CreateIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
467
487
let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , size_of :: < CreateIn > ( ) ) ?;
468
488
let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
@@ -508,7 +528,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
508
528
509
529
async fn async_fallocate < S : BitmapSlice > (
510
530
& self ,
511
- mut ctx : SrvContext < ' _ , F , S > ,
531
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
512
532
) -> Result < usize > {
513
533
let FallocateIn {
514
534
fh,
@@ -529,7 +549,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
529
549
}
530
550
}
531
551
532
- impl < ' a , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , F , S > {
552
+ impl < ' a , ' b , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , ' b , F , S > {
533
553
async fn async_reply_ok < T : ByteValued > (
534
554
& mut self ,
535
555
out : Option < T > ,
0 commit comments