diff options
Diffstat (limited to 'lib/sqfs/dir_writer.c')
-rw-r--r-- | lib/sqfs/dir_writer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqfs/dir_writer.c b/lib/sqfs/dir_writer.c index a02faa7..ce63a1e 100644 --- a/lib/sqfs/dir_writer.c +++ b/lib/sqfs/dir_writer.c @@ -21,6 +21,8 @@ #include <stdlib.h> #include <string.h> +#define DIR_INDEX_THRESHOLD (256) + typedef struct dir_entry_t { struct dir_entry_t *next; sqfs_u64 inode_ref; @@ -385,6 +387,9 @@ sqfs_inode_generic_t inode->base.type = SQFS_INODE_DIR; } + if (writer->ent_count >= DIR_INDEX_THRESHOLD) + inode->base.type = SQFS_INODE_EXT_DIR; + if (inode->base.type == SQFS_INODE_DIR) { inode->data.dir.start_block = start_block; inode->data.dir.nlink = writer->ent_count + hlinks + 2; |