Home | History | Annotate | Download | only in misc

Lines Matching refs:info

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