summaryrefslogtreecommitdiff
path: root/fs/bcachefs/recovery.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-12-01 23:11:53 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:48 -0400
commit3eb26d0157781c262a85f13c20de92889f1a2a8f (patch)
treed81d9c3b847b69f257db02f42e4f1e06e025b360 /fs/bcachefs/recovery.c
parentec3d21a9f25d495e0b6042a25f27cc711390195b (diff)
downloadlwn-3eb26d0157781c262a85f13c20de92889f1a2a8f.tar.gz
lwn-3eb26d0157781c262a85f13c20de92889f1a2a8f.zip
bcachefs: bch2_trans_get_iter() no longer returns errors
Since we now always preallocate the maximum number of iterators when we initialize a btree transaction, getting an iterator never fails - we can delete a fair amount of error path code. This patch also simplifies the iterator allocation code a bit. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r--fs/bcachefs/recovery.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c
index a837d9eb0f6d..d24cef2bf1aa 100644
--- a/fs/bcachefs/recovery.c
+++ b/fs/bcachefs/recovery.c
@@ -443,9 +443,6 @@ retry:
bch2_cut_back(atomic_end, split);
split_iter = bch2_trans_copy_iter(&trans, iter);
- ret = PTR_ERR_OR_ZERO(split_iter);
- if (ret)
- goto err;
/*
* It's important that we don't go through the
@@ -502,8 +499,6 @@ static int __bch2_journal_replay_key(struct btree_trans *trans,
iter = bch2_trans_get_node_iter(trans, id, k->k.p,
BTREE_MAX_DEPTH, level,
BTREE_ITER_INTENT);
- if (IS_ERR(iter))
- return PTR_ERR(iter);
/*
* iter->flags & BTREE_ITER_IS_EXTENTS triggers the update path to run
@@ -538,8 +533,7 @@ static int __bch2_alloc_replay_key(struct btree_trans *trans, struct bkey_i *k)
BTREE_ITER_CACHED|
BTREE_ITER_CACHED_NOFILL|
BTREE_ITER_INTENT);
- ret = PTR_ERR_OR_ZERO(iter) ?:
- bch2_trans_update(trans, iter, k, BTREE_TRIGGER_NORUN);
+ ret = bch2_trans_update(trans, iter, k, BTREE_TRIGGER_NORUN);
bch2_trans_iter_put(trans, iter);
return ret;
}