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

@ -16,9 +16,9 @@ SnapRAID HISTORY
files in case a silent error is found during the hash verification
check.
* In the configuration file 'data' is now a synonymous of 'disk'.
* Adds the 'nano' command intended to arbitrarely set all the zero
* Adds the 'touch' command intended to arbitrarely set all the zero
subsecond timestamps. This improves the SnapRAID capabilities to
identify files. The 'status' command recommend to run 'nano' if
identify files. The 'status' command recommends to run 'touch' if
required.
9.3 2016/01

View file

@ -34,7 +34,7 @@ snapraid_SOURCES = \
cmdline/pool.c \
cmdline/parity.c \
cmdline/handle.c \
cmdline/nano.c \
cmdline/touch.c \
cmdline/device.c \
cmdline/fnmatch.c \
cmdline/selftest.c \
@ -388,7 +388,7 @@ endif
$(MSG) Nano
touch -t 200102011234.56 bench/disk1/a/a*
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) sync
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) nano
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) -c $(CONF) touch
$(MSG) Check the --gen-conf command
$(TESTENV) ./snapraid$(EXEEXT) $(CHECKFLAGS) --gen-conf bench/content
$(MSG) Filter

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);
}
}
}

View file

@ -54,7 +54,7 @@ snapraid [\-c, \-\-conf CONFIG]
.PD 0
.PP
.PD
|up|down|pool|devices|nano|rehash
|up|down|pool|devices|touch|rehash
.PD 0
.PP
.PD
@ -913,7 +913,7 @@ array, but in some more complex configurations, you may have multiple
low level devices used by a single disk in the array.
.PP
Nothing is modified.
.SS nano
.SS touch
Sets arbitrarely the sub\-second timestamp of all the files
that have it at zero.
.PP

View file

@ -15,7 +15,7 @@ Synopsis
: [-L, --error-limit NUMBER]
: [-v, --verbose] [-q, --quiet]
: status|smart|up|down|diff|sync|scrub|fix|check|list|dup
: |up|down|pool|devices|nano|rehash
: |up|down|pool|devices|touch|rehash
:snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
@ -630,7 +630,7 @@ Commands
Nothing is modified.
nano
touch
Sets arbitrarely the sub-second timestamp of all the files
that have it at zero.

View file

@ -19,7 +19,7 @@ snapraid [-c, --conf CONFIG]
[-L, --error-limit NUMBER]
[-v, --verbose] [-q, --quiet]
status|smart|up|down|diff|sync|scrub|fix|check|list|dup
|up|down|pool|devices|nano|rehash
|up|down|pool|devices|touch|rehash
snapraid [-V, --version] [-H, --help] [-C, --gen-conf CONTENT]
@ -684,8 +684,8 @@ low level devices used by a single disk in the array.
Nothing is modified.
5.16 nano
---------
5.16 touch
----------
Sets arbitrarely the sub-second timestamp of all the files
that have it at zero.