@@ -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 ,
@@ -90,7 +90,7 @@ impl<'a, S: BitmapSlice> ZeroCopyWriter for AsyncZcWriter<'a, S> {
90
90
}
91
91
}
92
92
93
- impl < ' a , S : BitmapSlice > io:: Write for AsyncZcWriter < ' a , S > {
93
+ impl < ' a , ' b , S : BitmapSlice > io:: Write for AsyncZcWriter < ' a , ' b , S > {
94
94
fn write ( & mut self , buf : & [ u8 ] ) -> io:: Result < usize > {
95
95
self . 0 . write ( buf)
96
96
}
@@ -116,7 +116,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
116
116
pub async unsafe fn async_handle_message < S : BitmapSlice > (
117
117
& self ,
118
118
mut r : Reader < ' _ , S > ,
119
- w : Writer < ' _ , S > ,
119
+ w : Writer < ' _ , ' _ , S > ,
120
120
vu_req : Option < & mut dyn FsCacheReqHandler > ,
121
121
hook : Option < & dyn MetricsHook > ,
122
122
) -> Result < usize > {
@@ -210,7 +210,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
210
210
res
211
211
}
212
212
213
- async fn async_lookup < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
213
+ async fn async_lookup < S : BitmapSlice > (
214
+ & self ,
215
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
216
+ ) -> Result < usize > {
214
217
let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , 0 ) ?;
215
218
let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
216
219
Ok ( name) => name,
@@ -222,8 +225,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
222
225
return Err ( e) ;
223
226
}
224
227
} ;
225
-
226
- let version = self . vers . load ( ) ;
228
+ let version = & self . meta . load ( ) . version ;
227
229
let result = self
228
230
. fs
229
231
. async_lookup ( ctx. context ( ) , ctx. nodeid ( ) , name)
@@ -246,7 +248,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
246
248
}
247
249
}
248
250
249
- async fn async_getattr < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
251
+ async fn async_getattr < S : BitmapSlice > (
252
+ & self ,
253
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
254
+ ) -> Result < usize > {
250
255
let GetattrIn { flags, fh, .. } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
251
256
let handle = if ( flags & GETATTR_FH ) != 0 {
252
257
Some ( fh. into ( ) )
@@ -261,7 +266,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
261
266
ctx. async_handle_attr_result ( result) . await
262
267
}
263
268
264
- async fn async_setattr < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
269
+ async fn async_setattr < S : BitmapSlice > (
270
+ & self ,
271
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
272
+ ) -> Result < usize > {
265
273
let setattr_in: SetattrIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
266
274
let handle = if setattr_in. valid & FATTR_FH != 0 {
267
275
Some ( setattr_in. fh . into ( ) )
@@ -278,7 +286,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
278
286
ctx. async_handle_attr_result ( result) . await
279
287
}
280
288
281
- async fn async_open < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
289
+ async fn async_open < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , ' _ , F , S > ) -> Result < usize > {
282
290
let OpenIn { flags, fuse_flags } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
283
291
let result = self
284
292
. fs
@@ -299,7 +307,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
299
307
}
300
308
}
301
309
302
- async fn async_read < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
310
+ async fn async_read < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , ' _ , F , S > ) -> Result < usize > {
303
311
let ReadIn {
304
312
fh,
305
313
offset,
@@ -357,7 +365,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
357
365
. await
358
366
. map_err ( Error :: EncodeMessage ) ?;
359
367
ctx. w
360
- . async_commit ( Some ( & data_writer. 0 ) )
368
+ . async_commit ( Some ( & mut data_writer. 0 ) )
361
369
. await
362
370
. map_err ( Error :: EncodeMessage ) ?;
363
371
Ok ( out. len as usize )
@@ -366,7 +374,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
366
374
}
367
375
}
368
376
369
- async fn async_write < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
377
+ async fn async_write < S : BitmapSlice > (
378
+ & self ,
379
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
380
+ ) -> Result < usize > {
370
381
let WriteIn {
371
382
fh,
372
383
offset,
@@ -418,7 +429,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
418
429
}
419
430
}
420
431
421
- async fn async_fsync < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
432
+ async fn async_fsync < S : BitmapSlice > (
433
+ & self ,
434
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
435
+ ) -> Result < usize > {
422
436
let FsyncIn {
423
437
fh, fsync_flags, ..
424
438
} = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -434,7 +448,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
434
448
}
435
449
}
436
450
437
- async fn async_fsyncdir < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
451
+ async fn async_fsyncdir < S : BitmapSlice > (
452
+ & self ,
453
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
454
+ ) -> Result < usize > {
438
455
let FsyncIn {
439
456
fh, fsync_flags, ..
440
457
} = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -450,7 +467,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
450
467
}
451
468
}
452
469
453
- async fn async_create < S : BitmapSlice > ( & self , mut ctx : SrvContext < ' _ , F , S > ) -> Result < usize > {
470
+ async fn async_create < S : BitmapSlice > (
471
+ & self ,
472
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
473
+ ) -> Result < usize > {
454
474
let args: CreateIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
455
475
let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , size_of :: < CreateIn > ( ) ) ?;
456
476
let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
@@ -496,7 +516,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
496
516
497
517
async fn async_fallocate < S : BitmapSlice > (
498
518
& self ,
499
- mut ctx : SrvContext < ' _ , F , S > ,
519
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
500
520
) -> Result < usize > {
501
521
let FallocateIn {
502
522
fh,
@@ -517,7 +537,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
517
537
}
518
538
}
519
539
520
- impl < ' a , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , F , S > {
540
+ impl < ' a , ' b , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , ' b , F , S > {
521
541
async fn async_reply_ok < T : ByteValued > (
522
542
& mut self ,
523
543
out : Option < T > ,
0 commit comments