Uses IEC binary prexies KiB, MiB, etc.

This commit is contained in:
Andrea Mazzoleni 2011-03-20 10:49:29 +01:00
parent e80009334b
commit d48bf97685
6 changed files with 14 additions and 14 deletions

View file

@ -277,7 +277,7 @@ static int state_check_process(struct snapraid_state* state, int fix, int parity
}
}
printf("%u%% completed, %u MB processed\n", i * 100 / blockmax, (unsigned)(count_size / (1024*1024)));
printf("%u%% completed, %u MiB processed\n", i * 100 / blockmax, (unsigned)(count_size / (1024*1024)));
bail:
for(j=0;j<diskmax;++j) {

View file

@ -165,10 +165,10 @@ Configuration
size in bytes of your disk array, and BS is the block size
in bytes.
For example with 6 disk of 2 TB and a block size of 256 kB you
have:
For example with 6 disk of 2 TiB and a block size of 256 KiB
(1 KiB = 1024 Bytes) you have:
:memory = (6 * 2 * 2^40) * 24 / (256 * 2^10) = 1.1 GB
:memory = (6 * 2 * 2^40) * 24 / (256 * 2^10) = 1.1 GiB
An example of a typical configuration is:

View file

@ -246,13 +246,13 @@ in bytes.
</table>
<p>
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td width="5%"></td><td width="95%">
For example with 6 disk of 2 TB and a block size of 256 kB you
have:
For example with 6 disk of 2 TiB and a block size of 256 KiB
(1 KiB = 1024 Bytes) you have:
</td></tr></table>
<p>
<table width="100%" border="0" cellspacing="0" cellpadding="2"><tr><td width="5%"></td><td width="95%">
<pre>
memory = (6 * 2 * 2^40) * 24 / (256 * 2^10) = 1.1 GB
memory = (6 * 2 * 2^40) * 24 / (256 * 2^10) = 1.1 GiB
</pre>
</td></tr></table>
<p>

View file

@ -181,10 +181,10 @@ it should contains the following options:
size in bytes of your disk array, and BS is the block size
in bytes.
For example with 6 disk of 2 TB and a block size of 256 kB you
have:
For example with 6 disk of 2 TiB and a block size of 256 KiB
(1 KiB = 1024 Bytes) you have:
memory = (6 * 2 * 2^40) * 24 / (256 * 2^10) = 1.1 GB
memory = (6 * 2 * 2^40) * 24 / (256 * 2^10) = 1.1 GiB
An example of a typical configuration is:

View file

@ -32,7 +32,7 @@ void state_init(struct snapraid_state* state)
state->force_zero = 0;
state->force_empty = 0;
state->need_write = 0;
state->block_size = 256 * 1024; /* default 256 kB */
state->block_size = 256 * 1024; /* default 256 KiB */
state->content[0] = 0;
state->parity[0] = 0;
tommy_array_init(&state->diskarr);
@ -491,10 +491,10 @@ int state_progress(time_t* start, time_t* last, block_off_t blockpos, block_off_
if (*last != now) {
time_t delta = now - *start;
printf("%u%%, %u MB", blockpos * 100 / blockmax, (unsigned)(count_size / (1024*1024)));
printf("%u%%, %u MiB", blockpos * 100 / blockmax, (unsigned)(count_size / (1024*1024)));
if (delta != 0) {
printf(", %u MB/s", (unsigned)(count_size / (1024*1024) / delta));
printf(", %u MiB/s", (unsigned)(count_size / (1024*1024) / delta));
}
if (delta > 5 && count_block > 0) {

2
sync.c
View file

@ -192,7 +192,7 @@ static int state_sync_process(struct snapraid_state* state, int parity_f, block_
}
}
printf("%u%% completed, %u MB processed\n", i * 100 / blockmax, (unsigned)(count_size / (1024*1024)));
printf("%u%% completed, %u MiB processed\n", i * 100 / blockmax, (unsigned)(count_size / (1024*1024)));
bail:
for(j=0;j<diskmax;++j) {