mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 02:49:02 -04:00
Some variables renaming and relocation.
This commit is contained in:
parent
1ddb24da46
commit
d93f2f0595
4 changed files with 6 additions and 6 deletions
2
scan.c
2
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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
4
state.c
4
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);
|
||||
|
|
|
|||
2
state.h
2
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. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue