Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Bkeys have to be stored in native endianness: thus, for endian portability we
need a flag to indicate whether a givin btree node entry/journal entry was
written in big or little endian, and we need to swab when reading an entry in
non native endianness.
|
|
|
|
|
|
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|
|
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|
|
This is the other half of making it possible for the btree node iterator to not
compare against bkey_start_pos(): in order to still see keys in order by
start pos, we need to ensure that a 0 size extent sorts after a nonzero size
extent at the same position.
We could do this by comparing !k->size if the keys compare as equal, but part of
why we're making this change is for packed bkeys - once we have packed bkeys,
comparing !k->size will require unpacking the key (expensive).
So we'll use bkey_deleted() as a proxy for !k->size, and disallow bkey_deleted(k)
== true and k->size != 0.
Where previously we did discards by inserting KEY_DELETED keys, now we'll just
use KEY_DISCARD with version = 0 - and bch_extent_normalize() will drop these
keys later (the idea being that we can drop a KEY_DISCARD key with version = 0
without losing information).
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|
|
Move some methods out of btree_keys_ops and into a new bkey_ops struct; this is
partly because some methods really shouldn't require a btree_keys pointer to be
used (bkey_invalid()), and it also lets us clean up some duplicated code.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
|