Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bcachefs: for_each_keylist_key() declares loop iter

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>

+4 -13
-2
fs/bcachefs/btree_update_interior.c
··· 556 556 static int btree_update_nodes_written_trans(struct btree_trans *trans, 557 557 struct btree_update *as) 558 558 { 559 - struct bkey_i *k; 560 - 561 559 struct jset_entry *e = bch2_trans_jset_entry_alloc(trans, as->journal_u64s); 562 560 int ret = PTR_ERR_OR_ZERO(e); 563 561 if (ret)
+3 -6
fs/bcachefs/io_write.c
··· 1106 1106 static inline void bch2_nocow_write_unlock(struct bch_write_op *op) 1107 1107 { 1108 1108 struct bch_fs *c = op->c; 1109 - struct bkey_i *k; 1110 1109 1111 1110 for_each_keylist_key(&op->insert_keys, k) { 1112 1111 struct bkey_ptrs_c ptrs = bch2_bkey_ptrs_c(bkey_i_to_s_c(k)); 1113 1112 1114 1113 bkey_for_each_ptr(ptrs, ptr) 1115 1114 bch2_bucket_nocow_unlock(&c->nocow_locks, 1116 - PTR_BUCKET_POS(c, ptr), 1117 - BUCKET_NOCOW_LOCK_UPDATE); 1115 + PTR_BUCKET_POS(c, ptr), 1116 + BUCKET_NOCOW_LOCK_UPDATE); 1118 1117 } 1119 1118 } 1120 1119 ··· 1157 1158 { 1158 1159 struct bch_fs *c = op->c; 1159 1160 struct btree_trans *trans = bch2_trans_get(c); 1160 - struct bkey_i *orig; 1161 - int ret; 1162 1161 1163 1162 for_each_keylist_key(&op->insert_keys, orig) { 1164 - ret = for_each_btree_key_upto_commit(trans, iter, BTREE_ID_extents, 1163 + int ret = for_each_btree_key_upto_commit(trans, iter, BTREE_ID_extents, 1165 1164 bkey_start_pos(&orig->k), orig->k.p, 1166 1165 BTREE_ITER_INTENT, k, 1167 1166 NULL, NULL, BCH_TRANS_COMMIT_no_enospc, ({
-2
fs/bcachefs/keylist.c
··· 43 43 #ifdef CONFIG_BCACHEFS_DEBUG 44 44 void bch2_verify_keylist_sorted(struct keylist *l) 45 45 { 46 - struct bkey_i *k; 47 - 48 46 for_each_keylist_key(l, k) 49 47 BUG_ON(bkey_next(k) != l->top && 50 48 bpos_ge(k->k.p, bkey_next(k)->k.p));
+1 -3
fs/bcachefs/keylist.h
··· 50 50 } 51 51 52 52 #define for_each_keylist_key(_keylist, _k) \ 53 - for (_k = (_keylist)->keys; \ 53 + for (struct bkey_i *_k = (_keylist)->keys; \ 54 54 _k != (_keylist)->top; \ 55 55 _k = bkey_next(_k)) 56 56 57 57 static inline u64 keylist_sectors(struct keylist *keys) 58 58 { 59 - struct bkey_i *k; 60 59 u64 ret = 0; 61 60 62 61 for_each_keylist_key(keys, k) 63 62 ret += k->k.size; 64 - 65 63 return ret; 66 64 } 67 65