aboutsummaryrefslogtreecommitdiff
path: root/include
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>2024-01-24 09:56:10 +0100
commitd81b85ba4db12c2052a8fdd3b4e77343740d6fba (patch)
tree7d3bc26ffb041ce601d6c894687b8cb65683155a /include
parent78a6f0b30e648c8ba3a3fb28f1f818548a81978b (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 'include')
-rw-r--r--include/sqfs/inode.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/sqfs/inode.h b/include/sqfs/inode.h
index 8df7158..7f4e7b5 100644
--- a/include/sqfs/inode.h
+++ b/include/sqfs/inode.h
@@ -576,9 +576,10 @@ SQFS_API int sqfs_inode_get_xattr_index(const sqfs_inode_generic_t *inode,
*
* @memberof sqfs_inode_generic_t
*
- * For basic inodes, this function promes the inodes to extended inodes if the
- * index is not 0xFFFFFFFF. If the index is 0xFFFFFFFF, the function tries to
- * demote extended inode to a basic inode after setting the index.
+ * For basic inodes, this function promotes the inodes to extended inodes if
+ * the index is not 0xFFFFFFFF. The function does not try to demote extended
+ * inodes if the index is 0xFFFFFFFF, because that would cause additional
+ * information like a directory index to be lost.
*
* @param inode A pointer to an inode.
* @param index The extended attribute index.