]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/btree_iter.h
Update bcachefs sources to a5da815430 bcachefs: Convert constants to consts
[bcachefs-tools-debian] / libbcachefs / btree_iter.h
index 0ede02c34eac59ce84828f860ee91a3711fdefa4..448be089956968f1ad2440764ff768f3ce493c55 100644 (file)
@@ -198,6 +198,15 @@ struct bkey_i *bch2_btree_journal_peek_slot(struct btree_trans *,
 
 void bch2_btree_path_level_init(struct btree_trans *, struct btree_path *, struct btree *);
 
+int __bch2_trans_mutex_lock(struct btree_trans *, struct mutex *);
+
+static inline int bch2_trans_mutex_lock(struct btree_trans *trans, struct mutex *lock)
+{
+       return mutex_trylock(lock)
+               ? 0
+               : __bch2_trans_mutex_lock(trans, lock);
+}
+
 #ifdef CONFIG_BCACHEFS_DEBUG
 void bch2_trans_verify_paths(struct btree_trans *);
 void bch2_assert_pos_locked(struct btree_trans *, enum btree_id,
@@ -252,6 +261,7 @@ static inline int btree_trans_restart_nounlock(struct btree_trans *trans, int er
        BUG_ON(!bch2_err_matches(err, BCH_ERR_transaction_restart));
 
        trans->restarted = err;
+       trans->last_restarted_ip = _THIS_IP_;
        return -err;
 }
 
@@ -586,6 +596,8 @@ static inline int btree_trans_too_many_iters(struct btree_trans *trans)
        return 0;
 }
 
+struct bkey_s_c bch2_btree_iter_peek_and_restart_outlined(struct btree_iter *);
+
 static inline struct bkey_s_c
 __bch2_btree_iter_peek_and_restart(struct btree_trans *trans,
                                   struct btree_iter *iter, unsigned flags)