struct ext2_db_entry2 *dir_blocks_info,
char *buf, struct problem_context *pctx);
static void clear_htree(e2fsck_t ctx, ext2_ino_t ino);
-static int htree_depth(struct dx_dir_info *dx_dir,
- struct dx_dirblock_info *dx_db);
+static short htree_depth(struct dx_dir_info *dx_dir,
+ struct dx_dirblock_info *dx_db);
static EXT2_QSORT_TYPE special_dir_block_cmp(const void *a, const void *b);
struct check_dir_struct {
struct dx_dir_info *dx_dir;
struct dx_dirblock_info *dx_db;
int b;
- int i, depth;
+ ext2_ino_t i;
+ short depth;
problem_t code;
int bad_dir;
int (*check_dir_func)(ext2_filsys fs,
}
#define MAX_DEPTH 32000
-static int htree_depth(struct dx_dir_info *dx_dir,
- struct dx_dirblock_info *dx_db)
+static short htree_depth(struct dx_dir_info *dx_dir,
+ struct dx_dirblock_info *dx_db)
{
- int depth = 0;
+ short depth = 0;
while (dx_db->type != DX_DIRBLOCK_ROOT && depth < MAX_DEPTH) {
dx_db = &dx_dir->dx_block[dx_db->parent];
#ifdef DX_DEBUG
printf("Root node dump:\n");
printf("\t Reserved zero: %u\n", root->reserved_zero);
- printf("\t Hash Version: %d\n", root->hash_version);
- printf("\t Info length: %d\n", root->info_length);
- printf("\t Indirect levels: %d\n", root->indirect_levels);
- printf("\t Flags: %d\n", root->unused_flags);
+ printf("\t Hash Version: %u\n", root->hash_version);
+ printf("\t Info length: %u\n", root->info_length);
+ printf("\t Indirect levels: %u\n", root->indirect_levels);
+ printf("\t Flags: %x\n", root->unused_flags);
#endif
ent = (struct ext2_dx_entry *) (block_buf + 24 + root->info_length);
int encrypted = 0;
size_t max_block_size;
int hash_flags = 0;
+ static char *eop_read_dirblock = NULL;
cd = (struct check_dir_struct *) priv_data;
ibuf = buf = cd->buf;
* very large and then the files are deleted. For now, all that is
* needed is to avoid e2fsck filling in these holes as part of
* feature flag. */
- if (db->blk == 0 && ext2fs_has_feature_largedir(fs->super))
+ if (db->blk == 0 && ext2fs_has_feature_largedir(fs->super) &&
+ !ext2fs_has_feature_inline_data(fs->super))
return 0;
if (db->blk == 0 && !inline_data_size) {
db->blockcnt, ino);
#endif
- ehandler_operation(_("reading directory block"));
+ if (!eop_read_dirblock)
+ eop_read_dirblock = (char *) _("reading directory block");
+ ehandler_operation(eop_read_dirblock);
if (inline_data_size) {
memset(buf, 0, fs->blocksize - inline_data_size);
cd->pctx.errcode = ext2fs_inline_data_get(fs, ino, 0, buf, 0);