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_flush.c | |
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_flush.c')
-rw-r--r-- | lib/sqfs/xattr/xattr_writer_flush.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqfs/xattr/xattr_writer_flush.c b/lib/sqfs/xattr/xattr_writer_flush.c index 53c3187..92f9be3 100644 --- a/lib/sqfs/xattr/xattr_writer_flush.c +++ b/lib/sqfs/xattr/xattr_writer_flush.c @@ -207,7 +207,7 @@ static int write_kv_pairs(const sqfs_xattr_writer_t *xwr, for (i = 0; i < xwr->values.num_strings; ++i) ool_locations[i] = 0xFFFFFFFFFFFFFFFFUL; - for (blk = xwr->kv_blocks; blk != NULL; blk = blk->next) { + for (blk = xwr->kv_block_first; blk != NULL; blk = blk->next) { sqfs_meta_writer_get_position(mw, &block, &offset); blk->start_ref = (block << 16) | (offset & 0xFFFF); @@ -237,7 +237,7 @@ static int write_id_table(const sqfs_xattr_writer_t *xwr, locations[i++] = 0; - for (blk = xwr->kv_blocks; blk != NULL; blk = blk->next) { + for (blk = xwr->kv_block_first; blk != NULL; blk = blk->next) { memset(&id_ent, 0, sizeof(id_ent)); id_ent.xattr = htole64(blk->start_ref); id_ent.count = htole32(blk->count); |