@@ -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 > {
@@ -214,7 +214,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
214
214
res
215
215
}
216
216
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 > {
218
221
let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , 0 ) ?;
219
222
let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
220
223
Ok ( name) => name,
@@ -226,8 +229,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
226
229
return Err ( e) ;
227
230
}
228
231
} ;
229
-
230
- let version = self . vers . load ( ) ;
232
+ let version = & self . meta . load ( ) . version ;
231
233
let result = self
232
234
. fs
233
235
. async_lookup ( ctx. context ( ) , ctx. nodeid ( ) , name)
@@ -250,7 +252,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
250
252
}
251
253
}
252
254
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 > {
254
259
let GetattrIn { flags, fh, .. } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
255
260
let handle = if ( flags & GETATTR_FH ) != 0 {
256
261
Some ( fh. into ( ) )
@@ -265,7 +270,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
265
270
ctx. async_handle_attr_result ( result) . await
266
271
}
267
272
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 > {
269
277
let setattr_in: SetattrIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
270
278
let handle = if setattr_in. valid & FATTR_FH != 0 {
271
279
Some ( setattr_in. fh . into ( ) )
@@ -282,7 +290,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
282
290
ctx. async_handle_attr_result ( result) . await
283
291
}
284
292
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 > {
286
294
let OpenIn { flags, fuse_flags } = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
287
295
let result = self
288
296
. fs
@@ -303,7 +311,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
303
311
}
304
312
}
305
313
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 > {
307
315
let ReadIn {
308
316
fh,
309
317
offset,
@@ -361,7 +369,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
361
369
. await
362
370
. map_err ( Error :: EncodeMessage ) ?;
363
371
ctx. w
364
- . async_commit ( Some ( & data_writer. 0 ) )
372
+ . async_commit ( Some ( & mut data_writer. 0 ) )
365
373
. await
366
374
. map_err ( Error :: EncodeMessage ) ?;
367
375
Ok ( out. len as usize )
@@ -370,7 +378,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
370
378
}
371
379
}
372
380
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 > {
374
385
let WriteIn {
375
386
fh,
376
387
offset,
@@ -422,7 +433,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
422
433
}
423
434
}
424
435
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 > {
426
440
let FsyncIn {
427
441
fh, fsync_flags, ..
428
442
} = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -438,7 +452,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
438
452
}
439
453
}
440
454
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 > {
442
459
let FsyncIn {
443
460
fh, fsync_flags, ..
444
461
} = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
@@ -454,7 +471,10 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
454
471
}
455
472
}
456
473
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 > {
458
478
let args: CreateIn = ctx. r . read_obj ( ) . map_err ( Error :: DecodeMessage ) ?;
459
479
let buf = ServerUtil :: get_message_body ( & mut ctx. r , & ctx. in_header , size_of :: < CreateIn > ( ) ) ?;
460
480
let name = match bytes_to_cstr ( buf. as_ref ( ) ) {
@@ -500,7 +520,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
500
520
501
521
async fn async_fallocate < S : BitmapSlice > (
502
522
& self ,
503
- mut ctx : SrvContext < ' _ , F , S > ,
523
+ mut ctx : SrvContext < ' _ , ' _ , F , S > ,
504
524
) -> Result < usize > {
505
525
let FallocateIn {
506
526
fh,
@@ -521,7 +541,7 @@ impl<F: AsyncFileSystem + Sync> Server<F> {
521
541
}
522
542
}
523
543
524
- impl < ' a , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , F , S > {
544
+ impl < ' a , ' b , F : AsyncFileSystem , S : BitmapSlice > SrvContext < ' a , ' b , F , S > {
525
545
async fn async_reply_ok < T : ByteValued > (
526
546
& mut self ,
527
547
out : Option < T > ,
0 commit comments