diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-12-02 07:11:53 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:48 +0300 |
commit | 3eb26d0157781c262a85f13c20de92889f1a2a8f (patch) | |
tree | d81d9c3b847b69f257db02f42e4f1e06e025b360 /fs/bcachefs/str_hash.h | |
parent | ec3d21a9f25d495e0b6042a25f27cc711390195b (diff) | |
download | linux-3eb26d0157781c262a85f13c20de92889f1a2a8f.tar.xz |
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/str_hash.h')
-rw-r--r-- | fs/bcachefs/str_hash.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/bcachefs/str_hash.h b/fs/bcachefs/str_hash.h index 9c9549d0a8f6..f6b694b9346b 100644 --- a/fs/bcachefs/str_hash.h +++ b/fs/bcachefs/str_hash.h @@ -205,8 +205,6 @@ int bch2_hash_needs_whiteout(struct btree_trans *trans, int ret; iter = bch2_trans_copy_iter(trans, start); - if (IS_ERR(iter)) - return PTR_ERR(iter); bch2_btree_iter_next_slot(iter); @@ -253,11 +251,8 @@ int bch2_hash_set(struct btree_trans *trans, } if (!slot && - !(flags & BCH_HASH_SET_MUST_REPLACE)) { + !(flags & BCH_HASH_SET_MUST_REPLACE)) slot = bch2_trans_copy_iter(trans, iter); - if (IS_ERR(slot)) - return PTR_ERR(slot); - } if (k.k->type != KEY_TYPE_whiteout) goto not_found; |