summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-19 04:49:37 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:53 +0300
commit627a231239e050e70cf55a9eec316a8270a2fd63 (patch)
tree6883f90ff71a379d925ff15790fc1162f367111c /fs/bcachefs/buckets.c
parent5e2d8be8bd7985aa590dcccec14fb38fb529b3f0 (diff)
downloadlinux-627a231239e050e70cf55a9eec316a8270a2fd63.tar.xz
bcachefs: Switch ec_stripes_heap_lock to a mutex
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 2e1751eeaef4..ddbf88a759f9 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -907,10 +907,10 @@ static int bch2_mark_stripe_ptr(struct btree_trans *trans,
return -ENOMEM;
}
- spin_lock(&c->ec_stripes_heap_lock);
+ mutex_lock(&c->ec_stripes_heap_lock);
if (!m || !m->alive) {
- spin_unlock(&c->ec_stripes_heap_lock);
+ mutex_unlock(&c->ec_stripes_heap_lock);
bch_err_ratelimited(c, "pointer to nonexistent stripe %llu",
(u64) p.idx);
bch2_inconsistent_error(c);
@@ -920,7 +920,7 @@ static int bch2_mark_stripe_ptr(struct btree_trans *trans,
m->block_sectors[p.block] += sectors;
r = m->r;
- spin_unlock(&c->ec_stripes_heap_lock);
+ mutex_unlock(&c->ec_stripes_heap_lock);
r.e.data_type = data_type;
update_replicas(c, k, &r.e, sectors, trans->journal_res.seq, true);
@@ -1047,9 +1047,9 @@ int bch2_mark_stripe(struct btree_trans *trans,
}
if (!new_s) {
- spin_lock(&c->ec_stripes_heap_lock);
+ mutex_lock(&c->ec_stripes_heap_lock);
bch2_stripes_heap_del(c, m, idx);
- spin_unlock(&c->ec_stripes_heap_lock);
+ mutex_unlock(&c->ec_stripes_heap_lock);
memset(m, 0, sizeof(*m));
} else {
@@ -1063,9 +1063,9 @@ int bch2_mark_stripe(struct btree_trans *trans,
for (i = 0; i < new_s->nr_blocks; i++)
m->blocks_nonempty += !!stripe_blockcount_get(new_s, i);
- spin_lock(&c->ec_stripes_heap_lock);
+ mutex_lock(&c->ec_stripes_heap_lock);
bch2_stripes_heap_update(c, m, idx);
- spin_unlock(&c->ec_stripes_heap_lock);
+ mutex_unlock(&c->ec_stripes_heap_lock);
}
} else {
struct gc_stripe *m =