diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-05 19:01:22 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-03-06 22:08:36 +0100 |
commit | 8e2b5d633d1e33ec7bc478bf97b2f1e94776b925 (patch) | |
tree | b04748a5041252e1dc7d03dada3b729042b67b3d /lib/sqfs/xattr/xattr_writer.h | |
parent | 919d1e85f2cc17059f72db48c3bc38e0b524f6c0 (diff) |
Store xattr writer block description in a red-black tree
By storing the blocks in a tree, the de-duplication can lookup
existing blocks in logartihmic instead of linear time.
The linked list is still maintained, because we need to iterate
over the blocks in creation order during serialization.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/xattr/xattr_writer.h')
-rw-r--r-- | lib/sqfs/xattr/xattr_writer.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqfs/xattr/xattr_writer.h b/lib/sqfs/xattr/xattr_writer.h index 826b6f6..8ff9691 100644 --- a/lib/sqfs/xattr/xattr_writer.h +++ b/lib/sqfs/xattr/xattr_writer.h @@ -19,6 +19,7 @@ #include "sqfs/io.h" #include "str_table.h" +#include "rbtree.h" #include "util.h" #include <stdlib.h> @@ -56,7 +57,9 @@ struct sqfs_xattr_writer_t { size_t kv_start; - kv_block_desc_t *kv_blocks; + rbtree_t kv_block_tree; + kv_block_desc_t *kv_block_first; + kv_block_desc_t *kv_block_last; size_t num_blocks; }; |