From 0e7fba27a26694f6babe5bd5de93733760cd770d Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 12 May 2019 11:30:22 +0200 Subject: Add xattr indices to inodes Signed-off-by: David Oberhollenzer --- lib/fstree/fstree.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/fstree/fstree.c b/lib/fstree/fstree.c index 356f65a..0c3f13d 100644 --- a/lib/fstree/fstree.c +++ b/lib/fstree/fstree.c @@ -260,6 +260,15 @@ static int cmp_u64(const void *lhs, const void *rhs) return l < r ? -1 : (l > r ? 1 : 0); } +void fstree_xattr_reindex(fstree_t *fs) +{ + tree_xattr_t *it; + size_t index = 0; + + for (it = fs->xattr; it != NULL; it = it->next) + it->index = index++; +} + void fstree_xattr_deduplicate(fstree_t *fs) { tree_xattr_t *it, *it1, *prev; @@ -293,6 +302,8 @@ void fstree_xattr_deduplicate(fstree_t *fs) it = it->next; } } + + fstree_xattr_reindex(fs); } int fstree_init(fstree_t *fs, size_t block_size, uint32_t mtime, -- cgit v1.2.3