summaryrefslogtreecommitdiff
path: root/fs/bcachefs/io.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/io.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/io.c')
-rw-r--r--fs/bcachefs/io.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/bcachefs/io.c b/fs/bcachefs/io.c
index 62a9a0b32d5b..8125642aef7c 100644
--- a/fs/bcachefs/io.c
+++ b/fs/bcachefs/io.c
@@ -207,8 +207,6 @@ static int sum_sector_overwrites(struct btree_trans *trans,
*delta = 0;
iter = bch2_trans_copy_iter(trans, extent_iter);
- if (IS_ERR(iter))
- return PTR_ERR(iter);
for_each_btree_key_continue(iter, BTREE_ITER_SLOTS, old, ret) {
if (!may_allocate &&
@@ -1781,9 +1779,6 @@ static int __bch2_rbio_narrow_crcs(struct btree_trans *trans,
iter = bch2_trans_get_iter(trans, BTREE_ID_EXTENTS, rbio->pos,
BTREE_ITER_SLOTS|BTREE_ITER_INTENT);
- if ((ret = PTR_ERR_OR_ZERO(iter)))
- goto out;
-
k = bch2_btree_iter_peek_slot(iter);
if ((ret = bkey_err(k)))
goto out;
@@ -1991,10 +1986,6 @@ int __bch2_read_indirect_extent(struct btree_trans *trans,
iter = bch2_trans_get_iter(trans, BTREE_ID_REFLINK,
POS(0, reflink_offset),
BTREE_ITER_SLOTS);
- ret = PTR_ERR_OR_ZERO(iter);
- if (ret)
- return ret;
-
k = bch2_btree_iter_peek_slot(iter);
ret = bkey_err(k);
if (ret)