• Home
  • Raw
  • Download

Lines Matching refs:outdir

337 static errcode_t alloc_size_dir(ext2_filsys fs, struct out_dir *outdir,  in alloc_size_dir()  argument
342 if (outdir->max) { in alloc_size_dir()
343 retval = ext2fs_resize_array(fs->blocksize, outdir->max, blocks, in alloc_size_dir()
344 &outdir->buf); in alloc_size_dir()
348 outdir->max, blocks, in alloc_size_dir()
349 &outdir->hashes); in alloc_size_dir()
353 retval = ext2fs_get_array(fs->blocksize, blocks, &outdir->buf); in alloc_size_dir()
357 &outdir->hashes); in alloc_size_dir()
360 outdir->num = 0; in alloc_size_dir()
362 outdir->max = blocks; in alloc_size_dir()
366 static void free_out_dir(struct out_dir *outdir) in free_out_dir() argument
368 free(outdir->buf); in free_out_dir()
369 free(outdir->hashes); in free_out_dir()
370 outdir->max = 0; in free_out_dir()
371 outdir->num =0; in free_out_dir()
374 static errcode_t get_next_block(ext2_filsys fs, struct out_dir *outdir, in get_next_block() argument
379 if (outdir->num >= outdir->max) { in get_next_block()
380 int increment = outdir->max / 10; in get_next_block()
384 retval = alloc_size_dir(fs, outdir, outdir->max + increment); in get_next_block()
388 *ret = outdir->buf + (size_t)outdir->num++ * fs->blocksize; in get_next_block()
538 struct out_dir *outdir) in copy_dir_entries() argument
565 outdir->max = 0; in copy_dir_entries()
566 retval = alloc_size_dir(fs, outdir, in copy_dir_entries()
570 outdir->num = fd->compress ? 0 : 1; in copy_dir_entries()
572 outdir->hashes[0] = 0; in copy_dir_entries()
574 if ((retval = get_next_block(fs, outdir, &block_start))) in copy_dir_entries()
602 if ((retval = get_next_block(fs, outdir, in copy_dir_entries()
611 outdir->hashes[outdir->num-1] = ent->hash | 1; in copy_dir_entries()
613 outdir->hashes[outdir->num-1] = ent->hash; in copy_dir_entries()
731 struct out_dir *outdir, int i, in alloc_blocks() argument
740 *prev_ent = (struct ext2_dx_entry *) (outdir->buf + *prev_offset); in alloc_blocks()
741 (*prev_ent)->block = ext2fs_cpu_to_le32(outdir->num); in alloc_blocks()
745 ext2fs_cpu_to_le32(outdir->hashes[i]); in alloc_blocks()
747 retval = get_next_block(fs, outdir, &block_start); in alloc_blocks()
752 *prev_ent = (struct ext2_dx_entry *) (outdir->buf + *prev_offset); in alloc_blocks()
757 *next_offset = ((char *) *next_ent - outdir->buf); in alloc_blocks()
771 struct out_dir *outdir, in calculate_tree() argument
783 root_info = set_root_node(fs, outdir->buf, ino, parent, inode); in calculate_tree()
784 root_offset = limit_offset = ((char *) root_info - outdir->buf) + in calculate_tree()
786 root_limit = (struct ext2_dx_countlimit *) (outdir->buf + limit_offset); in calculate_tree()
788 nblks = outdir->num; in calculate_tree()
793 root = (struct ext2_dx_entry *) (outdir->buf + root_offset); in calculate_tree()
798 ext2fs_cpu_to_le32(outdir->hashes[i]); in calculate_tree()
812 NULL, outdir, i, &c1, in calculate_tree()
820 ext2fs_cpu_to_le32(outdir->hashes[i]); in calculate_tree()
838 &int_offset, outdir, i, in calculate_tree()
844 int delta1 = (char *)int_limit - outdir->buf; in calculate_tree()
845 int delta2 = (char *)root - outdir->buf; in calculate_tree()
849 NULL, outdir, i, &c2, in calculate_tree()
856 (outdir->buf + delta1); in calculate_tree()
858 (outdir->buf + delta2); in calculate_tree()
863 ext2fs_cpu_to_le32(outdir->hashes[i]); in calculate_tree()
874 root_limit = (struct ext2_dx_countlimit *) (outdir->buf + limit_offset); in calculate_tree()
882 struct out_dir *outdir; member
911 if (blockcnt < wd->outdir->num) in write_dir_block()
912 dir = wd->outdir->buf + (blockcnt * fs->blocksize); in write_dir_block()
919 wd->outdir->num++; in write_dir_block()
941 struct out_dir *outdir, in write_directory() argument
948 retval = e2fsck_expand_directory(ctx, ino, -1, outdir->num); in write_directory()
952 wd.outdir = outdir; in write_directory()
972 ino, outdir->num, outdir->num * fs->blocksize); in write_directory()
974 retval = ext2fs_inode_size_set(fs, inode, (ext2_off64_t)outdir->num * in write_directory()
980 return ext2fs_punch(fs, ino, inode, NULL, outdir->num, ~0ULL); in write_directory()
992 struct out_dir outdir = { 0, 0, 0, 0 }; in e2fsck_rehash_dir() local
1082 retval = copy_dir_entries(ctx, &fd, &outdir); in e2fsck_rehash_dir()
1090 retval = calculate_tree(fs, &outdir, ino, fd.parent, fd.inode); in e2fsck_rehash_dir()
1095 retval = write_directory(ctx, fs, &outdir, ino, &inode, fd.compress); in e2fsck_rehash_dir()
1107 free_out_dir(&outdir); in e2fsck_rehash_dir()