• Home
  • Raw
  • Download

Lines Matching refs:edi

36 extern void free_empty_dirblock(empty_dir_info edi);
37 extern void add_empty_dirblock(empty_dir_info edi,
39 extern void process_empty_dirblock(e2fsck_t ctx, empty_dir_info edi);
44 empty_dir_info edi; in init_empty_dir() local
47 edi = malloc(sizeof(struct empty_dir_info_struct)); in init_empty_dir()
48 if (!edi) in init_empty_dir()
51 memset(edi, 0, sizeof(struct empty_dir_info_struct)); in init_empty_dir()
53 retval = ext2fs_init_dblist(ctx->fs, &edi->empty_dblist); in init_empty_dir()
58 &edi->empty_dir_blocks); in init_empty_dir()
63 &edi->dir_map); in init_empty_dir()
67 return (edi); in init_empty_dir()
70 free_empty_dirblock(edi); in init_empty_dir()
74 void free_empty_dirblock(empty_dir_info edi) in free_empty_dirblock() argument
76 if (!edi) in free_empty_dirblock()
78 if (edi->empty_dblist) in free_empty_dirblock()
79 ext2fs_free_dblist(edi->empty_dblist); in free_empty_dirblock()
80 if (edi->empty_dir_blocks) in free_empty_dirblock()
81 ext2fs_free_block_bitmap(edi->empty_dir_blocks); in free_empty_dirblock()
82 if (edi->dir_map) in free_empty_dirblock()
83 ext2fs_free_inode_bitmap(edi->dir_map); in free_empty_dirblock()
85 memset(edi, 0, sizeof(struct empty_dir_info_struct)); in free_empty_dirblock()
86 free(edi); in free_empty_dirblock()
89 void add_empty_dirblock(empty_dir_info edi, in add_empty_dirblock() argument
92 if (!edi || !db) in add_empty_dirblock()
101 ext2fs_mark_block_bitmap2(edi->empty_dir_blocks, db->blk); in add_empty_dirblock()
102 if (ext2fs_test_inode_bitmap(edi->dir_map, db->ino)) in add_empty_dirblock()
104 ext2fs_mark_inode_bitmap(edi->dir_map, db->ino); in add_empty_dirblock()
106 ext2fs_add_dir_block2(edi->empty_dblist, db->ino, in add_empty_dirblock()
123 empty_dir_info edi = (empty_dir_info) priv_data; in empty_pass1() local
131 retval = ext2fs_bmap2(fs, edi->ino, &edi->inode, in empty_pass1()
132 edi->block_buf, 0, edi->logblk, 0, in empty_pass1()
138 edi->logblk++; in empty_pass1()
139 } while (ext2fs_test_block_bitmap2(edi->empty_dir_blocks, new_block)); in empty_pass1()
144 edi->freed_blocks++; in empty_pass1()
155 empty_dir_info edi = (empty_dir_info) priv_data; in fix_directory() local
157 edi->logblk = 0; in fix_directory()
158 edi->freed_blocks = 0; in fix_directory()
159 edi->ino = db->ino; in fix_directory()
161 retval = ext2fs_read_inode(fs, db->ino, &edi->inode); in fix_directory()
165 retval = ext2fs_block_iterate3(fs, db->ino, 0, edi->block_buf, in fix_directory()
166 empty_pass1, edi); in fix_directory()
170 if (edi->freed_blocks) { in fix_directory()
171 edi->inode.i_size -= edi->freed_blocks * fs->blocksize; in fix_directory()
172 ext2fs_iblk_add_blocks(fs, &edi->inode, edi->freed_blocks); in fix_directory()
173 retval = ext2fs_write_inode(fs, db->ino, &edi->inode); in fix_directory()
180 void process_empty_dirblock(e2fsck_t ctx, empty_dir_info edi) in process_empty_dirblock() argument
182 if (!edi) in process_empty_dirblock()
185 edi->block_buf = malloc(ctx->fs->blocksize * 3); in process_empty_dirblock()
187 if (edi->block_buf) { in process_empty_dirblock()
188 (void) ext2fs_dblist_iterate2(edi->empty_dblist, in process_empty_dirblock()
189 fix_directory, &edi); in process_empty_dirblock()
191 free(edi->block_buf); in process_empty_dirblock()
192 free_empty_dirblock(edi); in process_empty_dirblock()