Commit 31381636 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch2_trans_relock_notrace()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ee2c6ea7
...@@ -995,7 +995,7 @@ static int bch2_discard_one_bucket(struct btree_trans *trans, ...@@ -995,7 +995,7 @@ static int bch2_discard_one_bucket(struct btree_trans *trans,
GFP_KERNEL); GFP_KERNEL);
*discard_pos_done = iter.pos; *discard_pos_done = iter.pos;
ret = bch2_trans_relock(trans); ret = bch2_trans_relock_notrace(trans);
if (ret) if (ret)
goto out; goto out;
} }
......
...@@ -206,6 +206,7 @@ int bch2_btree_path_relock_intent(struct btree_trans *, struct btree_path *); ...@@ -206,6 +206,7 @@ int bch2_btree_path_relock_intent(struct btree_trans *, struct btree_path *);
void bch2_path_put(struct btree_trans *, struct btree_path *, bool); void bch2_path_put(struct btree_trans *, struct btree_path *, bool);
int bch2_trans_relock(struct btree_trans *); int bch2_trans_relock(struct btree_trans *);
int bch2_trans_relock_notrace(struct btree_trans *);
void bch2_trans_unlock(struct btree_trans *); void bch2_trans_unlock(struct btree_trans *);
bool bch2_trans_locked(struct btree_trans *); bool bch2_trans_locked(struct btree_trans *);
......
...@@ -691,6 +691,21 @@ int bch2_trans_relock(struct btree_trans *trans) ...@@ -691,6 +691,21 @@ int bch2_trans_relock(struct btree_trans *trans)
return 0; return 0;
} }
int bch2_trans_relock_notrace(struct btree_trans *trans)
{
struct btree_path *path;
if (unlikely(trans->restarted))
return -((int) trans->restarted);
trans_for_each_path(trans, path)
if (path->should_be_locked &&
!bch2_btree_path_relock_norestart(trans, path, _RET_IP_)) {
return btree_trans_restart(trans, BCH_ERR_transaction_restart_relock);
}
return 0;
}
void bch2_trans_unlock(struct btree_trans *trans) void bch2_trans_unlock(struct btree_trans *trans)
{ {
struct btree_path *path; struct btree_path *path;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment