From d48bf97685954e64944b7e3388e972e3730506e3 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 20 Mar 2011 10:49:29 +0100 Subject: [PATCH] Uses IEC binary prexies KiB, MiB, etc. --- check.c | 2 +- snapraid.d | 6 +++--- snapraid.html | 6 +++--- snapraid.txt | 6 +++--- state.c | 6 +++--- sync.c | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/check.c b/check.c index 12787fb0..2482f839 100644 --- a/check.c +++ b/check.c @@ -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

-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
 

diff --git a/snapraid.txt b/snapraid.txt index 62b06a80..4e40b4f0 100644 --- a/snapraid.txt +++ b/snapraid.txt @@ -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: diff --git a/state.c b/state.c index e011d089..bdd37580 100644 --- a/state.c +++ b/state.c @@ -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) { diff --git a/sync.c b/sync.c index a3e11ca8..e8e43306 100644 --- a/sync.c +++ b/sync.c @@ -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