summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_update_leaf.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-12-13 23:17:40 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:49 +0300
commit87ced107f37fc017d34b8f56afeb7daa06c87310 (patch)
tree619c930adba59e854911723f750c8260a7fad096 /fs/bcachefs/btree_update_leaf.c
parent858536c7cea8bb86511501768ef797d103642498 (diff)
downloadlinux-87ced107f37fc017d34b8f56afeb7daa06c87310.tar.xz
bcachefs: Convert EAGAIN errors to private error codes
More error code cleanup, for better error messages and debugability. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_update_leaf.c')
-rw-r--r--fs/bcachefs/btree_update_leaf.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index f44abb3fe469..61b61acef7a8 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -332,15 +332,10 @@ bch2_trans_journal_preres_get_cold(struct btree_trans *trans, unsigned u64s,
static __always_inline int bch2_trans_journal_res_get(struct btree_trans *trans,
unsigned flags)
{
- struct bch_fs *c = trans->c;
- int ret;
-
- ret = bch2_journal_res_get(&c->journal, &trans->journal_res,
- trans->journal_u64s,
- flags|
- (trans->flags & JOURNAL_WATERMARK_MASK));
-
- return ret == -EAGAIN ? -BCH_ERR_btree_insert_need_journal_res : ret;
+ return bch2_journal_res_get(&trans->c->journal, &trans->journal_res,
+ trans->journal_u64s,
+ flags|
+ (trans->flags & JOURNAL_WATERMARK_MASK));
}
#define JSET_ENTRY_LOG_U64s 4
@@ -864,7 +859,7 @@ static inline int do_bch2_trans_commit(struct btree_trans *trans,
&trans->journal_preres, trans->journal_preres_u64s,
JOURNAL_RES_GET_NONBLOCK|
(trans->flags & JOURNAL_WATERMARK_MASK));
- if (unlikely(ret == -EAGAIN))
+ if (unlikely(ret == -BCH_ERR_journal_preres_get_blocked))
ret = bch2_trans_journal_preres_get_cold(trans,
trans->journal_preres_u64s, trace_ip);
if (unlikely(ret))
@@ -936,7 +931,7 @@ int bch2_trans_commit_error(struct btree_trans *trans,
if (ret)
trace_and_count(c, trans_restart_mark_replicas, trans, trace_ip);
break;
- case -BCH_ERR_btree_insert_need_journal_res:
+ case -BCH_ERR_journal_res_get_blocked:
bch2_trans_unlock(trans);
if ((trans->flags & BTREE_INSERT_JOURNAL_RECLAIM) &&