Commit 9a768ab7 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch2_bkey_drop_ptrs() declares loop iter

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent b895c703
...@@ -1865,7 +1865,6 @@ static void btree_node_write_work(struct work_struct *work) ...@@ -1865,7 +1865,6 @@ static void btree_node_write_work(struct work_struct *work)
container_of(work, struct btree_write_bio, work); container_of(work, struct btree_write_bio, work);
struct bch_fs *c = wbio->wbio.c; struct bch_fs *c = wbio->wbio.c;
struct btree *b = wbio->wbio.bio.bi_private; struct btree *b = wbio->wbio.bio.bi_private;
struct bch_extent_ptr *ptr;
int ret = 0; int ret = 0;
btree_bounce_free(c, btree_bounce_free(c,
......
...@@ -2491,7 +2491,6 @@ int bch2_btree_node_update_key_get_iter(struct btree_trans *trans, ...@@ -2491,7 +2491,6 @@ int bch2_btree_node_update_key_get_iter(struct btree_trans *trans,
BUG_ON(!btree_node_hashed(b)); BUG_ON(!btree_node_hashed(b));
struct bch_extent_ptr *ptr;
bch2_bkey_drop_ptrs(bkey_i_to_s(new_key), ptr, bch2_bkey_drop_ptrs(bkey_i_to_s(new_key), ptr,
!bch2_bkey_has_device(bkey_i_to_s(&b->key), ptr->dev)); !bch2_bkey_has_device(bkey_i_to_s(&b->key), ptr->dev));
......
...@@ -467,7 +467,6 @@ int bch2_extent_drop_ptrs(struct btree_trans *trans, ...@@ -467,7 +467,6 @@ int bch2_extent_drop_ptrs(struct btree_trans *trans,
while (data_opts.kill_ptrs) { while (data_opts.kill_ptrs) {
unsigned i = 0, drop = __fls(data_opts.kill_ptrs); unsigned i = 0, drop = __fls(data_opts.kill_ptrs);
struct bch_extent_ptr *ptr;
bch2_bkey_drop_ptrs(bkey_i_to_s(n), ptr, i++ == drop); bch2_bkey_drop_ptrs(bkey_i_to_s(n), ptr, i++ == drop);
data_opts.kill_ptrs ^= 1U << drop; data_opts.kill_ptrs ^= 1U << drop;
......
...@@ -1200,7 +1200,7 @@ static int ec_stripe_update_extent(struct btree_trans *trans, ...@@ -1200,7 +1200,7 @@ static int ec_stripe_update_extent(struct btree_trans *trans,
struct btree_iter iter; struct btree_iter iter;
struct bkey_s_c k; struct bkey_s_c k;
const struct bch_extent_ptr *ptr_c; const struct bch_extent_ptr *ptr_c;
struct bch_extent_ptr *ptr, *ec_ptr = NULL; struct bch_extent_ptr *ec_ptr = NULL;
struct bch_extent_stripe_ptr stripe_ptr; struct bch_extent_stripe_ptr stripe_ptr;
struct bkey_i *n; struct bkey_i *n;
int ret, dev, block; int ret, dev, block;
......
...@@ -838,8 +838,6 @@ union bch_extent_entry *bch2_bkey_drop_ptr(struct bkey_s k, ...@@ -838,8 +838,6 @@ union bch_extent_entry *bch2_bkey_drop_ptr(struct bkey_s k,
void bch2_bkey_drop_device(struct bkey_s k, unsigned dev) void bch2_bkey_drop_device(struct bkey_s k, unsigned dev)
{ {
struct bch_extent_ptr *ptr;
bch2_bkey_drop_ptrs(k, ptr, ptr->dev == dev); bch2_bkey_drop_ptrs(k, ptr, ptr->dev == dev);
} }
...@@ -974,8 +972,6 @@ void bch2_extent_ptr_set_cached(struct bkey_s k, struct bch_extent_ptr *ptr) ...@@ -974,8 +972,6 @@ void bch2_extent_ptr_set_cached(struct bkey_s k, struct bch_extent_ptr *ptr)
*/ */
bool bch2_extent_normalize(struct bch_fs *c, struct bkey_s k) bool bch2_extent_normalize(struct bch_fs *c, struct bkey_s k)
{ {
struct bch_extent_ptr *ptr;
bch2_bkey_drop_ptrs(k, ptr, bch2_bkey_drop_ptrs(k, ptr,
ptr->cached && ptr->cached &&
ptr_stale(bch2_dev_bkey_exists(c, ptr->dev), ptr)); ptr_stale(bch2_dev_bkey_exists(c, ptr->dev), ptr));
......
...@@ -654,7 +654,7 @@ union bch_extent_entry *bch2_bkey_drop_ptr(struct bkey_s, ...@@ -654,7 +654,7 @@ union bch_extent_entry *bch2_bkey_drop_ptr(struct bkey_s,
do { \ do { \
struct bkey_ptrs _ptrs = bch2_bkey_ptrs(_k); \ struct bkey_ptrs _ptrs = bch2_bkey_ptrs(_k); \
\ \
_ptr = &_ptrs.start->ptr; \ struct bch_extent_ptr *_ptr = &_ptrs.start->ptr; \
\ \
while ((_ptr = bkey_ptr_next(_ptrs, _ptr))) { \ while ((_ptr = bkey_ptr_next(_ptrs, _ptr))) { \
if (_cond) { \ if (_cond) { \
......
...@@ -481,7 +481,6 @@ static void bch2_write_done(struct closure *cl) ...@@ -481,7 +481,6 @@ static void bch2_write_done(struct closure *cl)
static noinline int bch2_write_drop_io_error_ptrs(struct bch_write_op *op) static noinline int bch2_write_drop_io_error_ptrs(struct bch_write_op *op)
{ {
struct keylist *keys = &op->insert_keys; struct keylist *keys = &op->insert_keys;
struct bch_extent_ptr *ptr;
struct bkey_i *src, *dst = keys->keys, *n; struct bkey_i *src, *dst = keys->keys, *n;
for (src = keys->keys; src != keys->top; src = n) { for (src = keys->keys; src != keys->top; src = n) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment