Home | History | Annotate | Download | only in misc

Lines Matching refs:fs

53 static void init_chunk_info(ext2_filsys fs, struct chunk_info *info)
57 info->blocksize_bits = ul_log2((unsigned long)fs->blocksize);
95 static void scan_block_bitmap(ext2_filsys fs, struct chunk_info *info)
97 unsigned long long blocks_count = ext2fs_blocks_count(fs->super);
122 blk = fs->super->s_first_data_block;
125 used = ext2fs_fast_test_block_bitmap2(fs->block_map,
126 chunk_start_blk >> fs->cluster_ratio_bits);
145 static errcode_t get_chunk_info(ext2_filsys fs, struct chunk_info *info,
154 scan_block_bitmap(fs, info);
157 ext2fs_blocks_count(fs->super), fs->super->s_free_blocks_count,
158 (double)fs->super->s_free_blocks_count * 100 /
159 ext2fs_blocks_count(fs->super));
164 total_chunks = (ext2fs_blocks_count(fs->super) +
174 unsigned int scale = fs->blocksize >> 10;
202 fs->super->s_free_blocks_count);
215 static void close_device(char *device_name, ext2_filsys fs)
217 int retval = ext2fs_close(fs);
223 static void collect_info(ext2_filsys fs, struct chunk_info *chunk_info, FILE *f)
227 fprintf(f, "Device: %s\n", fs->device_name);
228 fprintf(f, "Blocksize: %u bytes\n", fs->blocksize);
230 retval = ext2fs_read_block_bitmap(fs);
232 com_err(fs->device_name, retval, "while reading block bitmap");
233 close_device(fs->device_name, fs);
237 init_chunk_info(fs, chunk_info);
239 retval = get_chunk_info(fs, chunk_info, f);
241 com_err(fs->device_name, retval, "while collecting chunk info");
242 close_device(fs->device_name, fs);
248 static void open_device(char *device_name, ext2_filsys *fs)
253 retval = ext2fs_open(device_name, flag, 0, 0, unix_io_manager, fs);
258 (*fs)->default_bitmap_type = EXT2FS_BMAP64_RBTREE;
271 ext2_filsys fs = NULL;
319 open_device(device_name, &fs);
321 fs = current_fs;
324 if (chunk_info.chunkbytes && (chunk_info.chunkbytes < fs->blocksize)) {
329 collect_info(fs, &chunk_info, stdout);
331 close_device(device_name, fs);