Rename the 'nano' command to 'touch'

This commit is contained in:
Andrea Mazzoleni 2016-01-18 19:38:42 +01:00
parent 3e30cfc3f2
commit 9d3773a2d4
10 changed files with 25 additions and 25 deletions

View file

@ -625,7 +625,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub,
* Cases found are:
* - Linux FUSE with exFAT driver from https://code.google.com/p/exfat/.
* Inodes are reassigned at every mount restarting from 1 and incrementing.
* As worse, the exFAT support in FUSE doesn't use subsecond precision in timestamps
* As worse, the exFAT support in FUSE doesn't use sub-second precision in timestamps
* making inode collision more easy (exFAT by design supports 10ms precision).
* - Linux VFAT kernel (3.2) driver. Inodes are fully reassigned at every mount.
*

View file

@ -432,7 +432,7 @@ void signal_init(void)
#define OPERATION_STATUS 10
#define OPERATION_REWRITE 11
#define OPERATION_READ 12
#define OPERATION_NANO 13
#define OPERATION_TOUCH 13
#define OPERATION_SPINUP 14
#define OPERATION_SPINDOWN 15
#define OPERATION_DEVICES 16
@ -828,8 +828,8 @@ int main(int argc, char* argv[])
operation = OPERATION_REWRITE;
} else if (strcmp(argv[optind], "test-read") == 0) {
operation = OPERATION_READ;
} else if (strcmp(argv[optind], "nano") == 0) {
operation = OPERATION_NANO;
} else if (strcmp(argv[optind], "touch") == 0) {
operation = OPERATION_TOUCH;
} else if (strcmp(argv[optind], "up") == 0) {
operation = OPERATION_SPINUP;
} else if (strcmp(argv[optind], "down") == 0) {
@ -993,7 +993,7 @@ int main(int argc, char* argv[])
case OPERATION_REWRITE :
case OPERATION_READ :
case OPERATION_REHASH :
case OPERATION_NANO :
case OPERATION_TOUCH :
case OPERATION_SPINUP : /* we want to do it in different threads to avoid blocking */
/* avoid to check and access parity disks if not needed */
opt.skip_parity_access = 1;
@ -1013,7 +1013,7 @@ int main(int argc, char* argv[])
case OPERATION_LIST :
case OPERATION_DUP :
case OPERATION_POOL :
case OPERATION_NANO :
case OPERATION_TOUCH :
case OPERATION_SPINUP :
case OPERATION_SPINDOWN :
case OPERATION_DEVICES :
@ -1223,10 +1223,10 @@ int main(int argc, char* argv[])
state_read(&state);
memory();
} else if (operation == OPERATION_NANO) {
} else if (operation == OPERATION_TOUCH) {
state_read(&state);
state_nano(&state);
state_touch(&state);
/* intercept signals while operating */
signal_init();

View file

@ -223,7 +223,7 @@ void state_scan(struct snapraid_state* state);
/**
* Set the nanosecond timestamp of all files that have a zero value.
*/
void state_nano(struct snapraid_state* state);
void state_touch(struct snapraid_state* state);
/**
* Devices operations.

View file

@ -473,7 +473,7 @@ int state_status(struct snapraid_state* state)
if (file_zerosubsecond) {
printf("You have %u files with zero sub-second timestamp.\n", file_zerosubsecond);
printf("Run the 'nano' command to set it to a not zero value.\n");
printf("Run the 'touch' command to set it to a not zero value.\n");
} else {
printf("No file has a zero sub-second timestamp.\n");
}

View file

@ -22,11 +22,11 @@
#include "state.h"
#include "handle.h"
void state_nano(struct snapraid_state* state)
void state_touch(struct snapraid_state* state)
{
tommy_node* i;
msg_progress("Setting nanosecond timestamps...\n");
msg_progress("Setting sub-second timestamps...\n");
/* for all disks */
for (i = state->disklist; i != 0; i = i->next) {
@ -125,8 +125,8 @@ void state_nano(struct snapraid_state* state)
/* state changed, we need to update it */
state->need_write = 1;
log_tag("nano:%s:%s\n", disk->name, esc(file->sub));
msg_info("nano %s%s\n", disk->dir, file->sub);
log_tag("touch:%s:%s: %" PRIu64 ".%d\n", disk->name, esc(file->sub), (uint64_t)st.st_mtime, (int)STAT_NSEC(&st));
msg_info("touch %s%s\n", disk->dir, file->sub);
}
}
}