• Home
  • Raw
  • Download

Lines Matching refs:fd

87 	struct fill_dir_struct	*fd = (struct fill_dir_struct *) priv_data;  in fill_dir_block()  local
98 if (offset + fs->blocksize > fd->inode->i_size) { in fill_dir_block()
99 fd->err = EXT2_ET_DIR_CORRUPTED; in fill_dir_block()
102 dir = (fd->buf+offset); in fill_dir_block()
108 fd->err = ext2fs_read_dir_block(fs, *block_nr, dir); in fill_dir_block()
109 if (fd->err) in fill_dir_block()
125 fd->err = EXT2_ET_DIR_CORRUPTED; in fill_dir_block()
131 if (!fd->compress && ((dirent->name_len&0xFF) == 1) && in fill_dir_block()
134 if (!fd->compress && ((dirent->name_len&0xFF) == 2) && in fill_dir_block()
136 fd->parent = dirent->inode; in fill_dir_block()
139 if (fd->num_array >= fd->max_array) { in fill_dir_block()
140 new_array = realloc(fd->harray, in fill_dir_block()
141 sizeof(struct hash_entry) * (fd->max_array+500)); in fill_dir_block()
143 fd->err = ENOMEM; in fill_dir_block()
146 fd->harray = new_array; in fill_dir_block()
147 fd->max_array += 500; in fill_dir_block()
149 ent = fd->harray + fd->num_array++; in fill_dir_block()
151 fd->dir_size += EXT2_DIR_REC_LEN(dirent->name_len & 0xFF); in fill_dir_block()
153 if (fd->compress) in fill_dir_block()
156 fd->err = ext2fs_dirhash(hash_alg, dirent->name, in fill_dir_block()
160 if (fd->err) in fill_dir_block()
332 struct fill_dir_struct *fd) in duplicate_search_and_fix() argument
350 for (i=1; i < fd->num_array; i++) { in duplicate_search_and_fix()
351 ent = fd->harray + i; in duplicate_search_and_fix()
370 for (j=0; j < fd->num_array; j++) { in duplicate_search_and_fix()
373 (fd->harray[j].dir->name_len & 0xFF)) || in duplicate_search_and_fix()
374 (strncmp(new_name, fd->harray[j].dir->name, in duplicate_search_and_fix()
398 struct fill_dir_struct *fd, in copy_dir_entries() argument
422 (fd->dir_size / fs->blocksize) + 2); in copy_dir_entries()
425 outdir->num = fd->compress ? 0 : 1; in copy_dir_entries()
434 slack = fd->compress ? 12 : in copy_dir_entries()
438 for (i=0; i < fd->num_array; i++) { in copy_dir_entries()
439 ent = fd->harray + i; in copy_dir_entries()
708 struct fill_dir_struct fd; in e2fsck_rehash_dir() local
717 fd.harray = 0; in e2fsck_rehash_dir()
722 fd.max_array = inode.i_size / 32; in e2fsck_rehash_dir()
723 fd.num_array = 0; in e2fsck_rehash_dir()
724 fd.harray = malloc(fd.max_array * sizeof(struct hash_entry)); in e2fsck_rehash_dir()
725 if (!fd.harray) in e2fsck_rehash_dir()
728 fd.ctx = ctx; in e2fsck_rehash_dir()
729 fd.buf = dir_buf; in e2fsck_rehash_dir()
730 fd.inode = &inode; in e2fsck_rehash_dir()
731 fd.err = 0; in e2fsck_rehash_dir()
732 fd.dir_size = 0; in e2fsck_rehash_dir()
733 fd.compress = 0; in e2fsck_rehash_dir()
736 fd.compress = 1; in e2fsck_rehash_dir()
737 fd.parent = 0; in e2fsck_rehash_dir()
742 fill_dir_block, &fd); in e2fsck_rehash_dir()
743 if (fd.err) { in e2fsck_rehash_dir()
744 retval = fd.err; in e2fsck_rehash_dir()
752 if (!fd.compress && (fd.dir_size < (fs->blocksize - 24))) { in e2fsck_rehash_dir()
753 fd.compress = 1; in e2fsck_rehash_dir()
754 fd.dir_size = 0; in e2fsck_rehash_dir()
755 fd.num_array = 0; in e2fsck_rehash_dir()
761 fd.num_array, fd.dir_size, ino); in e2fsck_rehash_dir()
766 if (fd.compress) in e2fsck_rehash_dir()
767 qsort(fd.harray+2, fd.num_array-2, sizeof(struct hash_entry), in e2fsck_rehash_dir()
770 qsort(fd.harray, fd.num_array, sizeof(struct hash_entry), in e2fsck_rehash_dir()
776 if (duplicate_search_and_fix(ctx, fs, ino, &fd)) in e2fsck_rehash_dir()
785 if (fd.compress) in e2fsck_rehash_dir()
786 qsort(fd.harray+2, fd.num_array-2, in e2fsck_rehash_dir()
793 retval = copy_dir_entries(ctx, &fd, &outdir); in e2fsck_rehash_dir()
799 if (!fd.compress) { in e2fsck_rehash_dir()
801 retval = calculate_tree(fs, &outdir, ino, fd.parent); in e2fsck_rehash_dir()
806 retval = write_directory(ctx, fs, &outdir, ino, fd.compress); in e2fsck_rehash_dir()
812 free(fd.harray); in e2fsck_rehash_dir()