aboutsummaryrefslogtreecommitdiff
path: root/lib/common/writer
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-19 15:18:43 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-01-19 16:24:56 +0100
commita90dfb17b0a418a1824a2b228a683b444f7bc902 (patch)
treeaad44e90624d51e9ef57f48cac73a250752a9d2e /lib/common/writer
parent73711939b54f1eb2f8235daaa41adee65ebd2bd0 (diff)
libsqfs: add a threshold for extended directory inodes with index
mksquashfs generates extended inodes if a directory contains 256 entries. libsquashfs so far only generated extended inodes if there is no other way to encode it. Mimic the behaviour of mksquashfs by adding a threshold. For this to work, the "sqfs_inode_set_xattr_index" function has to be changed to not immediately try to demote inodes to basic types. The fstree serialization is modified to do that itself if the index is 0xFFFFFFFF and the target is not a directory inode. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/common/writer')
-rw-r--r--lib/common/writer/serialize_fstree.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/common/writer/serialize_fstree.c b/lib/common/writer/serialize_fstree.c
index b15f30d..9776874 100644
--- a/lib/common/writer/serialize_fstree.c
+++ b/lib/common/writer/serialize_fstree.c
@@ -144,6 +144,9 @@ static int serialize_tree_node(const char *filename, sqfs_writer_t *wr,
sqfs_inode_set_xattr_index(inode, n->xattr_idx);
+ if (n->xattr_idx == 0xFFFFFFFF && !S_ISDIR(n->mode))
+ sqfs_inode_make_basic(inode);
+
ret = sqfs_id_table_id_to_index(wr->idtbl, n->uid,
&inode->base.uid_idx);
if (ret)