mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-06 03:06:50 -04:00
bcachefs: drop bogus percpu_ref_tryget
caller should already be guarding against rw, and checking here breaks when caller needs to finish updates for going RO Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
committed by
Kent Overstreet
parent
f0cfb963ec
commit
eb8632657f
@@ -562,7 +562,6 @@ static void bch2_btree_update_free(struct btree_update *as)
|
||||
|
||||
closure_debug_destroy(&as->cl);
|
||||
mempool_free(as, &c->btree_interior_update_pool);
|
||||
percpu_ref_put(&c->writes);
|
||||
|
||||
closure_wake_up(&c->btree_interior_update_wait);
|
||||
mutex_unlock(&c->btree_interior_update_lock);
|
||||
@@ -1012,14 +1011,9 @@ bch2_btree_update_start(struct bch_fs *c, enum btree_id id,
|
||||
struct btree_reserve *reserve;
|
||||
struct btree_update *as;
|
||||
|
||||
if (unlikely(!percpu_ref_tryget(&c->writes)))
|
||||
return ERR_PTR(-EROFS);
|
||||
|
||||
reserve = bch2_btree_reserve_get(c, nr_nodes, flags, cl);
|
||||
if (IS_ERR(reserve)) {
|
||||
percpu_ref_put(&c->writes);
|
||||
if (IS_ERR(reserve))
|
||||
return ERR_CAST(reserve);
|
||||
}
|
||||
|
||||
as = mempool_alloc(&c->btree_interior_update_pool, GFP_NOIO);
|
||||
memset(as, 0, sizeof(*as));
|
||||
|
||||
Reference in New Issue
Block a user