Lines Matching full:info

53 static void init_chunk_info(ext2_filsys fs, struct chunk_info *info)  in init_chunk_info()  argument
57 info->blocksize_bits = ul_log2((unsigned long)fs->blocksize); in init_chunk_info()
58 if (info->chunkbytes) { in init_chunk_info()
59 info->chunkbits = ul_log2(info->chunkbytes); in init_chunk_info()
60 info->blks_in_chunk = info->chunkbytes >> info->blocksize_bits; in init_chunk_info()
62 info->chunkbits = ul_log2(DEFAULT_CHUNKSIZE); in init_chunk_info()
63 info->blks_in_chunk = DEFAULT_CHUNKSIZE >> info->blocksize_bits; in init_chunk_info()
66 info->min = ~0UL; in init_chunk_info()
67 info->max = info->avg = 0; in init_chunk_info()
68 info->real_free_chunks = 0; in init_chunk_info()
71 info->histogram.fc_chunks[i] = 0; in init_chunk_info()
72 info->histogram.fc_blocks[i] = 0; in init_chunk_info()
76 static void update_chunk_stats(struct chunk_info *info, in update_chunk_stats() argument
84 info->histogram.fc_chunks[idx]++; in update_chunk_stats()
85 info->histogram.fc_blocks[idx] += chunk_size; in update_chunk_stats()
87 if (chunk_size > info->max) in update_chunk_stats()
88 info->max = chunk_size; in update_chunk_stats()
89 if (chunk_size < info->min) in update_chunk_stats()
90 info->min = chunk_size; in update_chunk_stats()
91 info->avg += chunk_size; in update_chunk_stats()
92 info->real_free_chunks++; in update_chunk_stats()
95 static void scan_block_bitmap(ext2_filsys fs, struct chunk_info *info) in scan_block_bitmap() argument
98 unsigned long long chunks = (blocks_count + info->blks_in_chunk) >> in scan_block_bitmap()
99 (info->chunkbits - info->blocksize_bits); in scan_block_bitmap()
110 if (chunk_start_blk + info->blks_in_chunk > blocks_count) in scan_block_bitmap()
113 num_blks = info->blks_in_chunk; in scan_block_bitmap()
133 update_chunk_stats(info, last_chunk_size); in scan_block_bitmap()
138 if (chunk_free == info->blks_in_chunk) in scan_block_bitmap()
139 info->free_chunks++; in scan_block_bitmap()
142 update_chunk_stats(info, last_chunk_size); in scan_block_bitmap()
145 static errcode_t get_chunk_info(ext2_filsys fs, struct chunk_info *info, in get_chunk_info() argument
154 scan_block_bitmap(fs, info); in get_chunk_info()
161 if (info->chunkbytes) { in get_chunk_info()
163 info->chunkbytes, info->blks_in_chunk); in get_chunk_info()
165 info->blks_in_chunk) >> in get_chunk_info()
166 (info->chunkbits - info->blocksize_bits); in get_chunk_info()
168 total_chunks, info->free_chunks, in get_chunk_info()
169 (double)info->free_chunks * 100 / total_chunks); in get_chunk_info()
173 if (info->real_free_chunks) { in get_chunk_info()
175 info->min = info->min * scale; in get_chunk_info()
176 info->max = info->max * scale; in get_chunk_info()
177 info->avg = info->avg / info->real_free_chunks * scale; in get_chunk_info()
179 info->min = 0; in get_chunk_info()
183 "Avg. free extent: %lu KB\n", info->min, info->max, info->avg); in get_chunk_info()
184 fprintf(f, "Num. free extent: %lu\n", info->real_free_chunks); in get_chunk_info()
190 end = 1 << (i + info->blocksize_bits - units); in get_chunk_info()
191 if (info->histogram.fc_chunks[i] != 0) { in get_chunk_info()
199 info->histogram.fc_chunks[i], in get_chunk_info()
200 info->histogram.fc_blocks[i], in get_chunk_info()
201 (double)info->histogram.fc_blocks[i] * 100 / in get_chunk_info()
241 com_err(fs->device_name, retval, "while collecting chunk info"); in collect_info()