Commit 1ae8a090 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: Kill memset() in bch2_btree_iter_init()

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent ae0e6117
......@@ -307,6 +307,13 @@ struct bkey_i {
struct bch_val v;
};
#define POS_KEY(_pos) \
((struct bkey) { \
.u64s = BKEY_U64s, \
.format = KEY_FORMAT_CURRENT, \
.p = _pos, \
})
#define KEY(_inode, _offset, _size) \
((struct bkey) { \
.u64s = BKEY_U64s, \
......
......@@ -445,14 +445,17 @@ static inline void bch2_trans_iter_init_common(struct btree_trans *trans,
unsigned flags,
unsigned long ip)
{
memset(iter, 0, sizeof(*iter));
iter->trans = trans;
iter->update_path = NULL;
iter->key_cache_path = NULL;
iter->btree_id = btree_id;
iter->min_depth = 0;
iter->flags = flags;
iter->snapshot = pos.snapshot;
iter->pos = pos;
iter->k.p = pos;
iter->k = POS_KEY(pos);
iter->journal_idx = 0;
iter->journal_pos = POS_MIN;
#ifdef CONFIG_BCACHEFS_DEBUG
iter->ip_allocated = ip;
#endif
......
......@@ -287,8 +287,7 @@ struct btree_iter {
struct btree_path *key_cache_path;
enum btree_id btree_id:8;
unsigned min_depth:3;
unsigned advanced:1;
u8 min_depth;
/* btree_iter_copy starts here: */
u16 flags;
......
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