Lines Matching refs:fs
51 void init_chunk_info(ext2_filsys fs, struct chunk_info *info)
55 info->blocksize_bits = ul_log2((unsigned long)fs->blocksize);
92 void scan_block_bitmap(ext2_filsys fs, struct chunk_info *info)
94 unsigned long long blocks_count = fs->super->s_blocks_count;
119 blk = fs->super->s_first_data_block;
122 used = ext2fs_fast_test_block_bitmap(fs->block_map,
142 errcode_t get_chunk_info(ext2_filsys fs, struct chunk_info *info)
150 scan_block_bitmap(fs, info);
153 fs->super->s_blocks_count, fs->super->s_free_blocks_count,
154 (double)fs->super->s_free_blocks_count * 100 /
155 fs->super->s_blocks_count);
160 total_chunks = (fs->super->s_blocks_count +
170 info->min = (info->min * fs->blocksize) >> 10;
171 info->max = (info->max * fs->blocksize) >> 10;
173 fs->blocksize) >> 10;
197 fs->super->s_free_blocks_count);
210 void close_device(char *device_name, ext2_filsys fs)
212 int retval = ext2fs_close(fs);
218 void collect_info(ext2_filsys fs, struct chunk_info *chunk_info)
222 printf("Device: %s\n", fs->device_name);
223 printf("Blocksize: %u bytes\n", fs->blocksize);
225 retval = ext2fs_read_block_bitmap(fs);
227 com_err(fs->device_name, retval, "while reading block bitmap");
228 close_device(fs->device_name, fs);
232 init_chunk_info(fs, chunk_info);
234 retval = get_chunk_info(fs, chunk_info);
236 com_err(fs->device_name, retval, "while collecting chunk info");
237 close_device(fs->device_name, fs);
242 void open_device(char *device_name, ext2_filsys *fs)
247 retval = ext2fs_open(device_name, flag, 0, 0, unix_io_manager, fs);
258 ext2_filsys fs = NULL;
299 open_device(device_name, &fs);
301 if (chunk_info.chunkbytes && (chunk_info.chunkbytes < fs->blocksize)) {
306 collect_info(fs, &chunk_info);
307 close_device(device_name, fs);