@@ -1968,8 +1968,8 @@ static void bch2_do_discards_fast_work(struct work_struct *work)
1968
1968
break ;
1969
1969
}
1970
1970
1971
- bch2_write_ref_put (c , BCH_WRITE_REF_discard_fast );
1972
1971
percpu_ref_put (& ca -> io_ref );
1972
+ bch2_write_ref_put (c , BCH_WRITE_REF_discard_fast );
1973
1973
}
1974
1974
1975
1975
static void bch2_discard_one_bucket_fast (struct bch_dev * ca , u64 bucket )
@@ -1979,18 +1979,18 @@ static void bch2_discard_one_bucket_fast(struct bch_dev *ca, u64 bucket)
1979
1979
if (discard_in_flight_add (ca , bucket , false))
1980
1980
return ;
1981
1981
1982
- if (!bch2_dev_get_ioref (c , ca -> dev_idx , WRITE ))
1982
+ if (!bch2_write_ref_tryget (c , BCH_WRITE_REF_discard_fast ))
1983
1983
return ;
1984
1984
1985
- if (!bch2_write_ref_tryget (c , BCH_WRITE_REF_discard_fast ))
1986
- goto put_ioref ;
1985
+ if (!bch2_dev_get_ioref (c , ca -> dev_idx , WRITE ))
1986
+ goto put_ref ;
1987
1987
1988
1988
if (queue_work (c -> write_ref_wq , & ca -> discard_fast_work ))
1989
1989
return ;
1990
1990
1991
- bch2_write_ref_put (c , BCH_WRITE_REF_discard_fast );
1992
- put_ioref :
1993
1991
percpu_ref_put (& ca -> io_ref );
1992
+ put_ref :
1993
+ bch2_write_ref_put (c , BCH_WRITE_REF_discard_fast );
1994
1994
}
1995
1995
1996
1996
static int invalidate_one_bucket (struct btree_trans * trans ,
@@ -2132,26 +2132,26 @@ static void bch2_do_invalidates_work(struct work_struct *work)
2132
2132
bch2_trans_iter_exit (trans , & iter );
2133
2133
err :
2134
2134
bch2_trans_put (trans );
2135
- bch2_write_ref_put (c , BCH_WRITE_REF_invalidate );
2136
2135
percpu_ref_put (& ca -> io_ref );
2136
+ bch2_write_ref_put (c , BCH_WRITE_REF_invalidate );
2137
2137
}
2138
2138
2139
2139
void bch2_dev_do_invalidates (struct bch_dev * ca )
2140
2140
{
2141
2141
struct bch_fs * c = ca -> fs ;
2142
2142
2143
- if (!bch2_dev_get_ioref (c , ca -> dev_idx , WRITE ))
2143
+ if (!bch2_write_ref_tryget (c , BCH_WRITE_REF_invalidate ))
2144
2144
return ;
2145
2145
2146
- if (!bch2_write_ref_tryget (c , BCH_WRITE_REF_invalidate ))
2147
- goto put_ioref ;
2146
+ if (!bch2_dev_get_ioref (c , ca -> dev_idx , WRITE ))
2147
+ goto put_ref ;
2148
2148
2149
2149
if (queue_work (c -> write_ref_wq , & ca -> invalidate_work ))
2150
2150
return ;
2151
2151
2152
- bch2_write_ref_put (c , BCH_WRITE_REF_invalidate );
2153
- put_ioref :
2154
2152
percpu_ref_put (& ca -> io_ref );
2153
+ put_ref :
2154
+ bch2_write_ref_put (c , BCH_WRITE_REF_invalidate );
2155
2155
}
2156
2156
2157
2157
void bch2_do_invalidates (struct bch_fs * c )
0 commit comments