Lines Matching refs:blocksize
133 static int check_block(int fd, void *buf, void *cbuf, int blocksize) in check_block() argument
136 int count = blocksize, ret; in check_block()
150 ret = memcmp(buf, cbuf, blocksize); in check_block()
151 seek_relative(fd, -blocksize); in check_block()
155 static void generic_write(int fd, void *buf, int blocksize, blk64_t block) in generic_write() argument
160 if (!blocksize) in generic_write()
165 err = ext2fs_get_arrayzero(1, blocksize, &buf); in generic_write()
175 seek_relative(fd, blocksize); in generic_write()
178 count = write(fd, buf, blocksize); in generic_write()
179 if (count != blocksize) { in generic_write()
231 write_header(fd, NULL, sizeof(struct ext2_image_hdr), fs->blocksize); in write_image_file()
272 hdr.fs_blocksize = fs->blocksize; in write_image_file()
284 write_header(fd, &hdr, sizeof(struct ext2_image_hdr), fs->blocksize); in write_image_file()
457 static int check_zero_block(char *buf, int blocksize) in check_zero_block() argument
460 int left = blocksize; in check_zero_block()
483 end = buf + fs->blocksize; in scramble_dir_block()
491 rec_len = fs->blocksize; in scramble_dir_block()
570 retval = ext2fs_get_mem(fs->blocksize, &buf); in output_meta_data_blocks()
575 retval = ext2fs_get_memzero(fs->blocksize, &zero_buf); in output_meta_data_blocks()
592 distance = (dest_offset - source_offset) / fs->blocksize; in output_meta_data_blocks()
600 seek_set(fd, (start * fs->blocksize) + dest_offset); in output_meta_data_blocks()
610 if (blk < (source_offset - dest_offset) / fs->blocksize) in output_meta_data_blocks()
643 fs->blocksize, in output_meta_data_blocks()
660 check_zero_block(buf, fs->blocksize)) in output_meta_data_blocks()
665 if (check_block(fd, buf, check_buf, fs->blocksize)) { in output_meta_data_blocks()
666 seek_relative(fd, fs->blocksize); in output_meta_data_blocks()
669 generic_write(fd, buf, fs->blocksize, blk); in output_meta_data_blocks()
675 fs->blocksize, blk); in output_meta_data_blocks()
678 sparse += fs->blocksize; in output_meta_data_blocks()
712 calc_rate(total_written, fs->blocksize, duration)); in output_meta_data_blocks()
719 fs->blocksize * ext2fs_blocks_count(fs->super) + dest_offset); in output_meta_data_blocks()
868 int cluster_bits = get_bits_from_size(fs->blocksize); in initialize_qcow2_image()
877 image->cluster_size = fs->blocksize; in initialize_qcow2_image()
1164 retval = ext2fs_get_mem(fs->blocksize, &buf); in output_qcow2_meta_data_blocks()
1182 if (check_zero_block(buf, fs->blocksize)) in output_qcow2_meta_data_blocks()
1205 generic_write(fd, buf, fs->blocksize, blk); in output_qcow2_meta_data_blocks()
1281 retval = ext2fs_get_mem(fs->blocksize * 3, &block_buf); in write_raw_image_file()
1633 retval = ext2fs_get_mem(fs->blocksize, &check_buf); in main()