Lines Matching refs:rec_len
379 unsigned int rec_len, new_len; in check_dot() local
392 (void) ext2fs_get_rec_len(ctx->fs, dirent, &rec_len); in check_dot()
395 if (rec_len < 12) in check_dot()
396 rec_len = dirent->rec_len = 12; in check_dot()
412 if (rec_len > 12) { in check_dot()
413 new_len = rec_len - 12; in check_dot()
419 dirent->rec_len = 12; in check_dot()
443 unsigned int rec_len; in check_dotdot() local
454 (void) ext2fs_get_rec_len(ctx->fs, dirent, &rec_len); in check_dotdot()
457 if (rec_len < 12) in check_dotdot()
458 dirent->rec_len = 12; in check_dotdot()
712 unsigned int rec_len, prev_rec_len; in salvage_directory() local
722 rec_len = block_len - *offset; in salvage_directory()
725 (void) ext2fs_get_rec_len(fs, dirent, &rec_len); in salvage_directory()
727 left = block_len - *offset - rec_len; in salvage_directory()
733 if ((left >= 12) && (rec_len == EXT2_DIR_ENTRY_HEADER_LEN)) { in salvage_directory()
744 ((int) rec_len + left > EXT2_DIR_ENTRY_HEADER_LEN) && in salvage_directory()
745 ((int) name_len + EXT2_DIR_ENTRY_HEADER_LEN <= (int) rec_len + left) && in salvage_directory()
748 (void) ext2fs_set_rec_len(fs, (int) rec_len + left, dirent); in salvage_directory()
756 if (prev && rec_len && (rec_len % 4) == 0 && in salvage_directory()
757 (*offset + rec_len <= block_len)) { in salvage_directory()
759 prev_rec_len += rec_len; in salvage_directory()
761 *offset += rec_len; in salvage_directory()
776 rec_len = block_len - *offset; in salvage_directory()
777 (void) ext2fs_set_rec_len(fs, rec_len, dirent); in salvage_directory()
784 #define NEXT_DIRENT(d) ((void *)((char *)(d) + (d)->rec_len))
794 while (d->rec_len && !(d->rec_len & 0x3) && NEXT_DIRENT(d) <= top) in insert_dirent_tail()
802 d->rec_len = (char *)top - (char *)d; in insert_dirent_tail()
914 unsigned int rec_len; in check_dir_block() local
1086 (void) ext2fs_get_rec_len(fs, dirent, &rec_len); in check_dir_block()
1107 (rec_len == fs->blocksize) && in check_dir_block()
1169 rec_len = EXT2_DIR_REC_LEN(1); in check_dir_block()
1171 (void) ext2fs_get_rec_len(fs, dirent, &rec_len); in check_dir_block()
1174 if ((offset + rec_len > max_block_size) || in check_dir_block()
1175 (rec_len < 12) || in check_dir_block()
1176 ((rec_len % 4) != 0) || in check_dir_block()
1177 (((unsigned) ext2fs_dirent_name_len(dirent) + EXT2_DIR_ENTRY_HEADER_LEN) > rec_len)) { in check_dir_block()
1200 if (rec_len < EXT2_DIR_ENTRY_HEADER_LEN || rec_len % 4) { in check_dir_block()
1214 dirent, &rec_len); in check_dir_block()
1216 ((char *)dirent) + offset + rec_len, in check_dir_block()
1217 max_block_size - offset - rec_len, in check_dir_block()
1231 dirent->rec_len = EXT2_DIR_REC_LEN(1); in check_dir_block()
1239 dirent->rec_len = EXT2_DIR_REC_LEN(2); in check_dir_block()
1489 (void) ext2fs_get_rec_len(fs, dirent, &rec_len); in check_dir_block()
1491 offset += rec_len; in check_dir_block()
1525 cd->pctx.num = rec_len + offset - max_block_size; in check_dir_block()
1527 dirent->rec_len = cd->pctx.num; in check_dir_block()