cmd_list_journal: Tweak extent matching

Extents can now additionally be matched by the end position, the same as
normal keys.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-08-01 16:57:52 -04:00
parent 3e39c57c70
commit 2d7982de78

View File

@ -61,14 +61,13 @@ static bool bkey_matches_filter(d_bbpos filter, struct jset_entry *entry, struct
if (i->btree != entry->btree_id)
continue;
if (!btree_node_type_is_extents(i->btree)) {
if (bkey_eq(i->pos, k->k.p))
return true;
} else {
if (bkey_ge(i->pos, bkey_start_pos(&k->k)) &&
bkey_lt(i->pos, k->k.p))
return true;
}
if (bkey_eq(i->pos, k->k.p))
return true;
if (btree_node_type_is_extents(i->btree) &&
bkey_ge(i->pos, bkey_start_pos(&k->k)) &&
bkey_lt(i->pos, k->k.p))
return true;
}
return false;
}