From d93f2f05952d3572c3c2756fbf20af38a172921c Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 29 Jun 2013 18:15:24 +0200 Subject: [PATCH] Some variables renaming and relocation. --- scan.c | 2 +- snapraid.c | 4 ++-- state.c | 4 ++-- state.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scan.c b/scan.c index 5af11387..333b29f5 100644 --- a/scan.c +++ b/scan.c @@ -274,7 +274,7 @@ static void scan_file(struct snapraid_scan* scan, struct snapraid_state* state, { struct snapraid_file* file; - if (state->opt.find_by_name) { + if (state->opt.force_by_name) { /* check if the file path already exists */ file = tommy_hashdyn_search(&disk->pathset, file_path_compare, sub, file_path_hash(sub)); } else { diff --git a/snapraid.c b/snapraid.c index 70ab277b..7071c95b 100644 --- a/snapraid.c +++ b/snapraid.c @@ -286,7 +286,7 @@ int main(int argc, char* argv[]) opt.force_uuid = 1; break; case 'N' : - opt.find_by_name = 1; + opt.force_by_name = 1; break; case 'a' : audit_only = 1; @@ -404,7 +404,7 @@ int main(int argc, char* argv[]) case OPERATION_DIFF : break; default: - if (opt.find_by_name) { + if (opt.force_by_name) { fprintf(stderr, "You cannot use -N, --find-by-name with the '%s' command\n", command); exit(EXIT_FAILURE); } diff --git a/state.c b/state.c index 8edba7a8..e5ea6201 100644 --- a/state.c +++ b/state.c @@ -37,6 +37,7 @@ void state_init(struct snapraid_state* state) state->pool_device = 0; state->lockfile[0] = 0; state->level = 1; /* default is the lowest protection */ + state->loaded_blockmax = 0; tommy_list_init(&state->disklist); tommy_list_init(&state->maplist); @@ -45,7 +46,6 @@ void state_init(struct snapraid_state* state) tommy_list_init(&state->importlist); tommy_hashdyn_init(&state->importset); tommy_arrayof_init(&state->infoarr, sizeof(snapraid_info)); - state->loaded_blockmax = 0; } void state_done(struct snapraid_state* state) @@ -1151,7 +1151,7 @@ void state_read(struct snapraid_state* state) hash = oathash32(hash, v_mtime_nsec); /* ignore nanoseconds if asked to find by name */ - if (state->opt.find_by_name) + if (state->opt.force_by_name) v_mtime_nsec = FILE_MTIME_NSEC_INVALID; c = sgetc(f); diff --git a/state.h b/state.h index 389675e5..afd366b1 100644 --- a/state.h +++ b/state.h @@ -41,7 +41,7 @@ struct snapraid_option { int force_zero; /**< Forced dangerous operations of synching files now with zero size. */ int force_empty; /**< Forced dangerous operations of synching disks now empty. */ int force_uuid; /**< Forced dangerous operations of synching disks with uuid changed. */ - int find_by_name; /**< Forced dangerous operations of synching a rewritten disk. */ + int force_by_name; /**< Forced dangerous operations of synching a rewritten disk. */ int expect_unrecoverable; /**< Expect presence of unrecoverable error in checking or fixing. */ int expect_recoverable; /**< Expect presence of recoverable error in checking. */ int skip_device; /**< Skip devices matching checks. */