mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-06 05:02:31 +00:00
bcachefs: set_btree_iter_dontneed also clears should_be_locked
This is part of a larger series cleaning up the semantics of should_be_locked and adding assertions around it; if we don't need an iterator/path anymore, it clearly doesn't need to be locked. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
3078e059a5
commit
ad29cf999a
@ -498,8 +498,13 @@ static inline void set_btree_iter_dontneed(struct btree_iter *iter)
|
||||
{
|
||||
struct btree_trans *trans = iter->trans;
|
||||
|
||||
if (!trans->restarted)
|
||||
btree_iter_path(trans, iter)->preserve = false;
|
||||
if (!iter->path || trans->restarted)
|
||||
return;
|
||||
|
||||
struct btree_path *path = btree_iter_path(trans, iter);
|
||||
path->preserve = false;
|
||||
if (path->ref == 1)
|
||||
path->should_be_locked = false;
|
||||
}
|
||||
|
||||
void *__bch2_trans_kmalloc(struct btree_trans *, size_t);
|
||||
|
Loading…
Reference in New Issue
Block a user