bcachefs: kill ca->freelist_lock

All uses were supposed to be switched over to c->freelist_lock

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2019-11-20 16:16:57 -05:00 committed by Kent Overstreet
parent 4de774952b
commit bd7e82ee2a
4 changed files with 4 additions and 6 deletions

View file

@ -427,7 +427,6 @@ struct bch_dev {
*/
alloc_fifo free[RESERVE_NR];
alloc_fifo free_inc;
spinlock_t freelist_lock;
u8 open_buckets_partial[OPEN_BUCKETS_COUNT];
unsigned open_buckets_partial_nr;

View file

@ -107,10 +107,10 @@ static bool have_copygc_reserve(struct bch_dev *ca)
{
bool ret;
spin_lock(&ca->freelist_lock);
spin_lock(&ca->fs->freelist_lock);
ret = fifo_full(&ca->free[RESERVE_MOVINGGC]) ||
ca->allocator_state != ALLOCATOR_RUNNING;
spin_unlock(&ca->freelist_lock);
spin_unlock(&ca->fs->freelist_lock);
return ret;
}

View file

@ -1059,7 +1059,6 @@ static struct bch_dev *__bch2_dev_alloc(struct bch_fs *c,
writepoint_init(&ca->copygc_write_point, BCH_DATA_USER);
spin_lock_init(&ca->freelist_lock);
bch2_dev_copygc_init(ca);
INIT_WORK(&ca->io_error_work, bch2_io_error_work);

View file

@ -775,7 +775,7 @@ static ssize_t show_reserve_stats(struct bch_dev *ca, char *buf)
struct printbuf out = _PBUF(buf, PAGE_SIZE);
enum alloc_reserve i;
spin_lock(&ca->freelist_lock);
spin_lock(&ca->fs->freelist_lock);
pr_buf(&out, "free_inc:\t%zu\t%zu\n",
fifo_used(&ca->free_inc),
@ -786,7 +786,7 @@ static ssize_t show_reserve_stats(struct bch_dev *ca, char *buf)
fifo_used(&ca->free[i]),
ca->free[i].size);
spin_unlock(&ca->freelist_lock);
spin_unlock(&ca->fs->freelist_lock);
return out.pos - buf;
}