Home | History | Annotate | Download | only in misc

Lines Matching defs:fs

90 static void write_image_file(ext2_filsys fs, int fd)
96 write_header(fd, NULL, fs->blocksize);
100 retval = ext2fs_image_super_write(fs, fd, 0);
107 retval = ext2fs_image_inode_write(fs, fd,
115 retval = ext2fs_image_bitmap_write(fs, fd, 0);
122 retval = ext2fs_image_bitmap_write(fs, fd, IMAGER_FLAG_INODEMAP);
133 hdr.fs_blocksize = fs->blocksize;
142 memcpy(hdr.fs_uuid, fs->super->s_uuid, sizeof(hdr.fs_uuid));
145 write_header(fd, &hdr, fs->blocksize);
168 static errcode_t meta_get_blocks(ext2_filsys fs EXT2FS_ATTR((unused)),
182 static errcode_t meta_check_directory(ext2_filsys fs EXT2FS_ATTR((unused)),
193 static errcode_t meta_read_inode(ext2_filsys fs EXT2FS_ATTR((unused)),
203 static void use_inode_shortcuts(ext2_filsys fs, int bool)
206 fs->get_blocks = meta_get_blocks;
207 fs->check_directory = meta_check_directory;
208 fs->read_inode = meta_read_inode;
211 fs->get_blocks = 0;
212 fs->check_directory = 0;
213 fs->read_inode = 0;
217 static int process_dir_block(ext2_filsys fs EXT2FS_ATTR((unused)),
234 static int process_file_block(ext2_filsys fs EXT2FS_ATTR((unused)),
247 static void mark_table_blocks(ext2_filsys fs)
252 first_block = fs->super->s_first_data_block;
261 for (j = 0; j < fs->desc_blocks; j++) {
263 ext2fs_descriptor_block_loc(fs, first_block, j));
266 for (i = 0; i < fs->group_desc_count; i++) {
270 if (fs->group_desc[i].bg_inode_table) {
271 for (j = 0, b = fs->group_desc[i].bg_inode_table;
272 j < (unsigned) fs->inode_blocks_per_group;
280 if (fs->group_desc[i].bg_block_bitmap) {
282 fs->group_desc[i].bg_block_bitmap);
288 if (fs->group_desc[i].bg_inode_bitmap) {
290 fs->group_desc[i].bg_inode_bitmap);
344 static void scramble_dir_block(ext2_filsys fs, blk_t blk, char *buf)
351 end = buf + fs->blocksize;
359 rec_len = fs->blocksize;
371 (void) ext2fs_set_rec_len(fs, rec_len,
406 static void output_meta_data_blocks(ext2_filsys fs, int fd)
413 buf = malloc(fs->blocksize);
418 zero_buf = malloc(fs->blocksize);
423 memset(zero_buf, 0, fs->blocksize);
424 for (blk = 0; blk < fs->super->s_blocks_count; blk++) {
425 if ((blk >= fs->super->s_first_data_block) &&
427 retval = io_channel_read_blk(fs->io, blk, 1, buf);
434 scramble_dir_block(fs, blk, buf);
435 if ((fd != 1) && check_zero_block(buf, fs->blocksize))
437 write_block(fd, buf, sparse, fs->blocksize, blk);
443 fs->blocksize, blk);
446 sparse += fs->blocksize;
459 static void write_raw_image_file(ext2_filsys fs, int fd, int scramble_flag)
468 retval = ext2fs_allocate_block_bitmap(fs, "in-use block map",
476 retval = ext2fs_allocate_block_bitmap(fs, "scramble block map",
485 mark_table_blocks(fs);
487 retval = ext2fs_open_inode_scan(fs, 0, &scan);
493 block_buf = malloc(fs->blocksize * 3);
499 use_inode_shortcuts(fs, 1);
527 ino == fs->super->s_journal_inum) {
528 retval = ext2fs_block_iterate2(fs, ino,
542 retval = ext2fs_block_iterate2(fs,
553 use_inode_shortcuts(fs, 0);
554 output_meta_data_blocks(fs, fd);
561 ext2_filsys fs;
581 io_ptr, &fs);
588 retval = ext2fs_read_bitmaps (fs);
610 image_io = fs->io;
612 ext2fs_rewrite_to_io(fs, io);
614 if (lseek(fd, fs->image_header->offset_inode, SEEK_SET) < 0) {
619 retval = ext2fs_image_inode_read(fs, fd, 0);
625 ext2fs_close (fs);
633 ext2_filsys fs;
677 unix_io_manager, &fs);
701 write_raw_image_file(fs, fd, scramble_flag);
703 write_image_file(fs, fd);
705 ext2fs_close (fs);