]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/btree_locking.h
Update bcachefs sources to 841a95c29f4c bcachefs: fix userspace build errors
[bcachefs-tools-debian] / libbcachefs / btree_locking.h
index a49f1dd1d223613c5f9c59b28a6a53f1410a5143..64810ea544c9af6e7818429d0ebed14921cde8b8 100644 (file)
@@ -175,6 +175,7 @@ bch2_btree_node_unlock_write_inlined(struct btree_trans *trans, struct btree_pat
                                     struct btree *b)
 {
        struct btree_path *linked;
+       unsigned i;
 
        EBUG_ON(path->l[b->c.level].b != b);
        EBUG_ON(path->l[b->c.level].lock_seq != six_lock_seq(&b->c.lock));
@@ -182,7 +183,7 @@ bch2_btree_node_unlock_write_inlined(struct btree_trans *trans, struct btree_pat
 
        mark_btree_node_locked_noreset(path, b->c.level, BTREE_NODE_INTENT_LOCKED);
 
-       trans_for_each_path_with_node(trans, b, linked)
+       trans_for_each_path_with_node(trans, b, linked, i)
                linked->l[b->c.level].lock_seq++;
 
        six_unlock_write(&b->c.lock);
@@ -242,8 +243,9 @@ static inline bool btree_node_lock_increment(struct btree_trans *trans,
                                             enum btree_node_locked_type want)
 {
        struct btree_path *path;
+       unsigned i;
 
-       trans_for_each_path(trans, path)
+       trans_for_each_path(trans, path, i)
                if (&path->l[level].b->c == b &&
                    btree_node_locked_type(path, level) >= want) {
                        six_lock_increment(&b->lock, (enum six_lock_type) want);
@@ -263,7 +265,6 @@ static inline int btree_node_lock(struct btree_trans *trans,
        int ret = 0;
 
        EBUG_ON(level >= BTREE_MAX_DEPTH);
-       EBUG_ON(!test_bit(path->idx, trans->paths_allocated));
 
        if (likely(six_trylock_type(&b->lock, type)) ||
            btree_node_lock_increment(trans, b, level, (enum btree_node_locked_type) type) ||