@@ -554,7 +554,7 @@ where
554
554
writes : writes. to_vec ( ) ,
555
555
} ;
556
556
557
- let mut d = ad. lock ( ) . await ;
557
+ let d = ad. lock ( ) . await ;
558
558
d. add_work ( upstairs_connection, * job_id, new_write) . await ?;
559
559
Some ( * job_id)
560
560
}
@@ -588,7 +588,7 @@ where
588
588
extent_limit : * extent_limit,
589
589
} ;
590
590
591
- let mut d = ad. lock ( ) . await ;
591
+ let d = ad. lock ( ) . await ;
592
592
d. add_work ( upstairs_connection, * job_id, new_flush) . await ?;
593
593
Some ( * job_id)
594
594
}
@@ -616,7 +616,7 @@ where
616
616
writes : writes. to_vec ( ) ,
617
617
} ;
618
618
619
- let mut d = ad. lock ( ) . await ;
619
+ let d = ad. lock ( ) . await ;
620
620
d. add_work ( upstairs_connection, * job_id, new_write) . await ?;
621
621
Some ( * job_id)
622
622
}
@@ -644,7 +644,7 @@ where
644
644
requests : requests. to_vec ( ) ,
645
645
} ;
646
646
647
- let mut d = ad. lock ( ) . await ;
647
+ let d = ad. lock ( ) . await ;
648
648
d. add_work ( upstairs_connection, * job_id, new_read) . await ?;
649
649
Some ( * job_id)
650
650
}
@@ -673,7 +673,7 @@ where
673
673
extent : * extent_id,
674
674
} ;
675
675
676
- let mut d = ad. lock ( ) . await ;
676
+ let d = ad. lock ( ) . await ;
677
677
d. add_work ( upstairs_connection, * job_id, ext_close) . await ?;
678
678
Some ( * job_id)
679
679
}
@@ -708,7 +708,7 @@ where
708
708
repair_downstairs : vec ! [ ] , // Unused in the downstairs
709
709
} ;
710
710
711
- let mut d = ad. lock ( ) . await ;
711
+ let d = ad. lock ( ) . await ;
712
712
d. add_work ( upstairs_connection, * job_id, new_flush) . await ?;
713
713
Some ( * job_id)
714
714
}
@@ -742,7 +742,7 @@ where
742
742
repair_downstairs : vec ! [ ] ,
743
743
} ;
744
744
745
- let mut d = ad. lock ( ) . await ;
745
+ let d = ad. lock ( ) . await ;
746
746
debug ! ( d. log, "Received ExtentLiveRepair {}" , job_id) ;
747
747
d. add_work ( upstairs_connection, * job_id, new_repair) . await ?;
748
748
Some ( * job_id)
@@ -771,7 +771,7 @@ where
771
771
extent : * extent_id,
772
772
} ;
773
773
774
- let mut d = ad. lock ( ) . await ;
774
+ let d = ad. lock ( ) . await ;
775
775
d. add_work ( upstairs_connection, * job_id, new_open) . await ?;
776
776
Some ( * job_id)
777
777
}
@@ -796,7 +796,7 @@ where
796
796
dependencies : dependencies. to_vec ( ) ,
797
797
} ;
798
798
799
- let mut d = ad. lock ( ) . await ;
799
+ let d = ad. lock ( ) . await ;
800
800
debug ! ( d. log, "Received NoOP {}" , job_id) ;
801
801
d. add_work ( upstairs_connection, * job_id, new_open) . await ?;
802
802
Some ( * job_id)
@@ -1464,7 +1464,7 @@ where
1464
1464
negotiated = 4 ;
1465
1465
1466
1466
{
1467
- let mut ds = ads. lock( ) . await ;
1467
+ let ds = ads. lock( ) . await ;
1468
1468
let mut work = ds. work_lock(
1469
1469
upstairs_connection. unwrap( ) ,
1470
1470
) . await ?;
@@ -1831,7 +1831,7 @@ impl Downstairs {
1831
1831
* newly active Upstairs.
1832
1832
*/
1833
1833
async fn work_lock (
1834
- & mut self ,
1834
+ & self ,
1835
1835
upstairs_connection : UpstairsConnection ,
1836
1836
) -> Result < MutexGuard < ' _ , Work > > {
1837
1837
let upstairs_uuid = upstairs_connection. upstairs_id ;
@@ -1863,15 +1863,15 @@ impl Downstairs {
1863
1863
}
1864
1864
1865
1865
async fn jobs (
1866
- & mut self ,
1866
+ & self ,
1867
1867
upstairs_connection : UpstairsConnection ,
1868
1868
) -> Result < usize > {
1869
1869
let work = self . work_lock ( upstairs_connection) . await ?;
1870
1870
Ok ( work. jobs ( ) )
1871
1871
}
1872
1872
1873
1873
async fn new_work (
1874
- & mut self ,
1874
+ & self ,
1875
1875
upstairs_connection : UpstairsConnection ,
1876
1876
) -> Result < Vec < u64 > > {
1877
1877
let work = self . work_lock ( upstairs_connection) . await ?;
@@ -1880,7 +1880,7 @@ impl Downstairs {
1880
1880
1881
1881
// Add work to the Downstairs
1882
1882
async fn add_work (
1883
- & mut self ,
1883
+ & self ,
1884
1884
upstairs_connection : UpstairsConnection ,
1885
1885
ds_id : u64 ,
1886
1886
work : IOop ,
@@ -1920,7 +1920,7 @@ impl Downstairs {
1920
1920
1921
1921
#[ cfg( test) ]
1922
1922
async fn get_job (
1923
- & mut self ,
1923
+ & self ,
1924
1924
upstairs_connection : UpstairsConnection ,
1925
1925
ds_id : u64 ,
1926
1926
) -> Result < DownstairsWork > {
@@ -1930,7 +1930,7 @@ impl Downstairs {
1930
1930
1931
1931
// Downstairs, move a job to in_progress, if we can
1932
1932
async fn in_progress (
1933
- & mut self ,
1933
+ & self ,
1934
1934
upstairs_connection : UpstairsConnection ,
1935
1935
ds_id : u64 ,
1936
1936
) -> Result < Option < u64 > > {
@@ -2287,7 +2287,7 @@ impl Downstairs {
2287
2287
* - putting the id on the completed list.
2288
2288
*/
2289
2289
async fn complete_work (
2290
- & mut self ,
2290
+ & self ,
2291
2291
upstairs_connection : UpstairsConnection ,
2292
2292
ds_id : u64 ,
2293
2293
m : Message ,
@@ -2619,7 +2619,7 @@ impl Downstairs {
2619
2619
}
2620
2620
}
2621
2621
2622
- fn is_active ( & mut self , connection : UpstairsConnection ) -> bool {
2622
+ fn is_active ( & self , connection : UpstairsConnection ) -> bool {
2623
2623
let uuid = connection. upstairs_id ;
2624
2624
if let Some ( active_upstairs) = self . active_upstairs . get ( & uuid) {
2625
2625
active_upstairs. upstairs_connection == connection
@@ -2628,7 +2628,7 @@ impl Downstairs {
2628
2628
}
2629
2629
}
2630
2630
2631
- fn active_upstairs ( & mut self ) -> Vec < UpstairsConnection > {
2631
+ fn active_upstairs ( & self ) -> Vec < UpstairsConnection > {
2632
2632
self . active_upstairs
2633
2633
. values ( )
2634
2634
. map ( |x| x. upstairs_connection )
0 commit comments