From d81b85ba4db12c2052a8fdd3b4e77343740d6fba Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Thu, 19 Jan 2023 15:18:43 +0100 Subject: 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 --- lib/sqfs/inode.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'lib/sqfs/inode.c') diff --git a/lib/sqfs/inode.c b/lib/sqfs/inode.c index 0fb4809..ce51cf5 100644 --- a/lib/sqfs/inode.c +++ b/lib/sqfs/inode.c @@ -110,12 +110,6 @@ int sqfs_inode_set_xattr_index(sqfs_inode_generic_t *inode, sqfs_u32 index) return SQFS_ERROR_CORRUPTED; } - if (index == 0xFFFFFFFF) { - err = sqfs_inode_make_basic(inode); - if (err) - return err; - } - return 0; } -- cgit v1.2.3