Stores the free space in the content file.

This avoids the need to access data and parity disks in
the status command.
Also removed some data disk access, in list, dup and similar
commands that don't need to scan the disks.
This commit is contained in:
Andrea Mazzoleni 2014-11-09 19:14:29 +01:00
parent 8ee1131bed
commit 7e9a5e6a6d
12 changed files with 519 additions and 128 deletions

View file

@ -237,6 +237,7 @@ void config(char* conf, size_t conf_size, const char* argv0)
#define OPT_TEST_FORCE_SCAN_WINFIND 279
#define OPT_TEST_IMPORT_CONTENT 280
#define OPT_TEST_FORCE_PROGRESS 281
#define OPT_TEST_SKIP_DISK_ACCESS 282
#if HAVE_GETOPT_LONG
struct option long_options[] = {
@ -341,6 +342,9 @@ struct option long_options[] = {
/* Force immediate progress state update */
{ "test-force-progress", 0, 0, OPT_TEST_FORCE_PROGRESS },
/* Skip the disk access */
{ "test-skip-disk-access", 0, 0, OPT_TEST_SKIP_DISK_ACCESS },
{ 0, 0, 0, 0 }
};
#endif
@ -604,6 +608,9 @@ int main(int argc, char* argv[])
case OPT_TEST_SKIP_PARITY_ACCESS :
opt.skip_parity_access = 1;
break;
case OPT_TEST_SKIP_DISK_ACCESS :
opt.skip_disk_access = 1;
break;
case OPT_TEST_FORCE_MURMUR3 :
opt.force_murmur3 = 1;
break;
@ -828,6 +835,17 @@ int main(int argc, char* argv[])
}
}
switch (operation) {
case OPERATION_LIST :
case OPERATION_DUP :
case OPERATION_STATUS :
case OPERATION_REWRITE :
case OPERATION_REHASH :
/* avoid to check and access data disks if not needed */
opt.skip_disk_access = 1;
break;
}
switch (operation) {
case OPERATION_DIFF :
case OPERATION_LIST :
@ -835,6 +853,7 @@ int main(int argc, char* argv[])
case OPERATION_POOL :
case OPERATION_STATUS :
case OPERATION_REWRITE :
case OPERATION_REHASH :
case OPERATION_NANO :
/* avoid to check and access parity disks if not needed */
opt.skip_parity_access = 1;