From 5249f9cb044ee8666fa7df1afa3c6549bbc46666 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sat, 2 Jan 2016 16:52:20 +0100 Subject: [PATCH] Fix various typos in comments --- cmdline/check.c | 10 +++++----- cmdline/device.c | 4 ++-- cmdline/elem.c | 2 +- cmdline/elem.h | 24 ++++++++++++------------ cmdline/mingw.c | 10 +++++----- cmdline/mingw.h | 2 +- cmdline/nano.c | 2 +- cmdline/parity.c | 6 +++--- cmdline/parity.h | 4 ++-- cmdline/portable.h | 8 ++++---- cmdline/scan.c | 18 +++++++++--------- cmdline/scrub.c | 2 +- cmdline/snapraid.c | 32 ++++++++++++++++---------------- cmdline/state.c | 38 +++++++++++++++++++------------------- cmdline/state.h | 12 ++++++------ cmdline/stream.h | 4 ++-- cmdline/support.c | 2 +- cmdline/support.h | 6 +++--- cmdline/unix.c | 8 ++++---- cmdline/unix.h | 2 +- 20 files changed, 98 insertions(+), 98 deletions(-) diff --git a/cmdline/check.c b/cmdline/check.c index a97b54d8..55a35eb5 100644 --- a/cmdline/check.c +++ b/cmdline/check.c @@ -398,7 +398,7 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign ret = repair_step(state, rehash, pos, diskmax, failed, failed_map, n, buffer, buffer_recov, buffer_zero); if (ret == 0) { /* reprocess the CHG blocks, for which we don't have a hash to check */ - /* if they were BAD we have to use some euristics to ensure that we have recovered */ + /* if they were BAD we have to use some heuristics to ensure that we have recovered */ /* the state after the sync. If unsure, we assume the worst case */ for (j = 0; j < failed_count; ++j) { @@ -518,7 +518,7 @@ static int repair(struct snapraid_state* state, int rehash, unsigned pos, unsign /* this applies to REP blocks because we are going to recover the old state */ /* and the REP hash represent the new one */ /* it also applies to CHG and DELETE blocks because we want to have */ - /* a succesful recovering only if a BLK one is matching */ + /* a successful recovering only if a BLK one is matching */ failed[j].is_outofdate = 1; } else if (failed[j].is_bad) { /* If the block is bad we don't know its content, and we try to recover it */ @@ -598,7 +598,7 @@ static int file_post(struct snapraid_state* state, int fix, unsigned i, struct s unsigned j; int ret; - /* if we are processing only bad blocks, we don't have to do any postprocessing */ + /* if we are processing only bad blocks, we don't have to do any post-processing */ /* as we don't have any guarantee to process the last block of the fixed files */ if (state->opt.badonly) return 0; @@ -990,7 +990,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna /* if we are only hashing, we can skip excluded files and don't even read them */ if (state->opt.auditonly && file_flag_has(file, FILE_IS_EXCLUDED)) { /* use an empty block */ - /* in true, this is unnecessary, becase we are not checking any parity */ + /* in true, this is unnecessary, because we are not checking any parity */ /* but we keep it for completeness */ memset(buffer[j], 0, state->block_size); continue; @@ -1071,7 +1071,7 @@ static int state_check_process(struct snapraid_state* state, int fix, struct sna if (handle[j].st.st_size != file->size || handle[j].st.st_mtime != file->mtime_sec || STAT_NSEC(&handle[j].st) != file->mtime_nsec - /* don't check the inode to support filesystem without persistent inodes */ + /* don't check the inode to support file-system without persistent inodes */ ) { /* report that the file is not synced */ file_flag_set(file, FILE_IS_UNSYNCED); diff --git a/cmdline/device.c b/cmdline/device.c index fedabbcb..d2b27f76 100644 --- a/cmdline/device.c +++ b/cmdline/device.c @@ -38,7 +38,7 @@ * they really fail, not counting as a failure. * * The following tables are computed using the data from 2014-02-14 to 2014-12-31 - * becasue it's the period when more SMART attributes were gathered. + * because it's the period when more SMART attributes were gathered. * * In this period there are 47322 disk seen, with 1988 removed because failed, * and with 4121 removed because predicted to fail. @@ -587,7 +587,7 @@ static double raid_prob_of_one_or_more_failures(double array_failure_rate, doubl raid_failure_rate = 1.0 / MTTDL; /* probability of at least one RAID failure */ - /* note that is almost equal at the probabilty of */ + /* note that is almost equal at the probability of */ /* the first failure. */ return poisson_prob_n_or_more_failures(raid_failure_rate, 1); } diff --git a/cmdline/elem.c b/cmdline/elem.c index f9ee9be9..2f8caf61 100644 --- a/cmdline/elem.c +++ b/cmdline/elem.c @@ -1112,7 +1112,7 @@ static int chunk_file_inside_compare(const void* void_a, const void* void_b) } /** - * Seach the chunk at the specified file position. + * Search the chunk at the specified file position. * The search is optimized for sequential accesses. * \return If not found return 0 */ diff --git a/cmdline/elem.h b/cmdline/elem.h index 4e9d71c6..9264ba9b 100644 --- a/cmdline/elem.h +++ b/cmdline/elem.h @@ -111,7 +111,7 @@ struct snapraid_filter { * data used to compute the parity, because the sync process was interrupted at an unknown point, * and the parity may or may not be updated. * - * For this reson we clear all such hashes when reading the state from an incomplete sync before + * For this reason we clear all such hashes when reading the state from an incomplete sync before * starting a new sync, because sync is affected by such hashes, as sync updates the parity, only * if the new data read for CHG blocks has a mismatching hash. * Clearing is done setting the ::clear_past_hash flag before reading the state. @@ -125,7 +125,7 @@ struct snapraid_filter { * This happens when a new block overwrite a just removed block, or an empty space. * * Note that when the file copy heuristic is enabled, the REP blocks may be set - * using this euristic, meaning that the hash may be wrong. + * using this heuristic, meaning that the hash may be wrong. * * For this reason, when the ::force_nocopy flag is enabled in sync, we convert all the REP blocks * to CHG, invalidating the stored hash. @@ -228,7 +228,7 @@ struct snapraid_block { /** * If the file is without inode. - * It could happen in filesystem where inodes are not persistent, + * It could happen in file-system where inodes are not persistent, * or when restoring a full disk with "fix". * In such cases we have to clear any stored duplicate inode. * After the scan process completes, no file should have this flag set. @@ -240,7 +240,7 @@ struct snapraid_block { * This happens when a file is deleted from the array, * but it's keep inside the parity until the next sync. * - * During the filesystem check we needs this information, + * During the file-system check we needs this information, * because deleted files may be present only partially. */ #define FILE_IS_DELETED 0x400 @@ -310,7 +310,7 @@ struct snapraid_dir { * A chunk represents a fragment of a file mapped into the parity. */ struct snapraid_chunk { - struct snapraid_file* file; /* File containing this chunk. */ + struct snapraid_file* file; /**< File containing this chunk. */ block_off_t parity_pos; /**< Parity position. */ block_off_t file_pos; /**< Position in the file. */ block_off_t count; /**< Number of sequential blocks in the file and parity. */ @@ -334,18 +334,18 @@ struct snapraid_disk { /** * First free searching block. - * Note that it doesn't necessarely point at the first free block, + * Note that it doesn't necessarily point at the first free block, * but it just tell you that no free block is present before this position. */ block_off_t first_free_block; - int has_volatile_inodes; /**< If the underline filesystem has not persistent inodes. */ + int has_volatile_inodes; /**< If the underline file-system has not persistent inodes. */ int has_unreliable_physical; /**< If the physical offset of files has duplicates. */ - int has_different_uuid; /**< If the disk has a different UUID, meaning that it is not the same filesystem. */ + int has_different_uuid; /**< If the disk has a different UUID, meaning that it is not the same file-system. */ int has_unsupported_uuid; /**< If the disk doesn't report UUID, meaning it's not supported. */ int had_empty_uuid; /**< If the disk had an empty UUID, meaning that it's a new disk. */ int mapping_idx; /**< Index in the mapping vector. Used only as buffer when writing the content file. */ - int skip_access; /**< If the disk is unaccessible and it should be skipped. */ + int skip_access; /**< If the disk is inaccessible and it should be skipped. */ /** * Mapping of chunks in the parity. @@ -409,7 +409,7 @@ struct snapraid_parity { uint64_t device; /**< Device identifier of the parity. */ block_off_t total_blocks; /**< Number of total blocks. */ block_off_t free_blocks; /**< Number of free blocks at the last sync. */ - int skip_access; /**< If the disk is unaccessible and it should be skipped. */ + int skip_access; /**< If the disk is inaccessible and it should be skipped. */ int is_excluded; /**< If the parity is excluded by disk filter. */ /** @@ -889,7 +889,7 @@ block_off_t disk_size(struct snapraid_disk* disk); int disk_is_empty(struct snapraid_disk* disk, block_off_t blockmax); /** - * Check the filesystem for errors. + * Check the file-system for errors. * Return 0 if it's OK. */ int fs_check(struct snapraid_disk* disk); @@ -977,7 +977,7 @@ void map_free(struct snapraid_map* map); /** * Mask used to store additional information in the info bits. * - * These bits reduce the granurality of the time in the memory representation. + * These bits reduce the granularity of the time in the memory representation. */ #define INFO_MASK 0x7 diff --git a/cmdline/mingw.c b/cmdline/mingw.c index 00c285e2..98db7915 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -121,7 +121,7 @@ static BOOLEAN (WINAPI* ptr_CreateSymbolicLinkW)(LPWSTR, LPWSTR, DWORD); /** * Direct access to RtlGenRandom(). - * This function is accessible only with LoadLibrary() and it's availble from Windows XP. + * This function is accessible only with LoadLibrary() and it's available from Windows XP. */ static BOOLEAN (WINAPI* ptr_RtlGenRandom)(PVOID, ULONG); @@ -185,7 +185,7 @@ void os_init(int opt) is_scan_winfind = opt != 0; - /* initialize the thread local storage for strerror(), using free() as desctructor */ + /* initialize the thread local storage for strerror(), using free() as destructor */ if (pthread_key_create(&last_error, free) != 0) { log_fatal("Error calling pthread_key_create().\n"); exit(EXIT_FAILURE); @@ -1452,7 +1452,7 @@ int windows_symlink(const char* existing, const char* file) return 0; } -/* Adds missing defition in MingW winnt.h */ +/* Adds missing definitions in MingW winnt.h */ #ifndef FSCTL_GET_REPARSE_POINT #define FSCTL_GET_REPARSE_POINT 0x000900a8 #endif @@ -1905,7 +1905,7 @@ static int devresolve(const char* mount, char* file, size_t file_size, char* wfi return -1; } - /* remove the final slash, otherwise CreateFile() opens the filesystem */ + /* remove the final slash, otherwise CreateFile() opens the file-system */ /* and not the volume */ i = 0; while (volume_guid[i] != 0) @@ -2178,7 +2178,7 @@ retry: * * Sometimes the "type" autodetection is wrong, and the command fails at identification * stage, returning with error 2, or even with error 0, and with no info at all. - * We detect this conditon checking the PowerOnHours, Size and RotationRate attributes. + * We detect this condition checking the PowerOnHours, Size and RotationRate attributes. * * In such conditions we retry using the "sat" type, that often allows to proceed. * diff --git a/cmdline/mingw.h b/cmdline/mingw.h index c33b49fb..21f309e1 100644 --- a/cmdline/mingw.h +++ b/cmdline/mingw.h @@ -137,7 +137,7 @@ struct windows_stat { uint32_t st_dev; int st_hidden; const char* st_desc; - int st_sync; /**< If the information are in sync with the filesystem. */ + int st_sync; /**< If the information are in sync with the file-system. */ }; /** diff --git a/cmdline/nano.c b/cmdline/nano.c index 6a45c529..a26164a6 100644 --- a/cmdline/nano.c +++ b/cmdline/nano.c @@ -118,7 +118,7 @@ void state_nano(struct snapraid_state* state) /* set the same nanosecond value in the content file */ /* note that if the seconds value is already matching */ - /* the file won't be synched because the content file will */ + /* the file won't be synced because the content file will */ /* contain the new updated timestamp */ file->mtime_nsec = STAT_NSEC(&st); diff --git a/cmdline/parity.c b/cmdline/parity.c index cab58ccc..f62a3f41 100644 --- a/cmdline/parity.c +++ b/cmdline/parity.c @@ -219,7 +219,7 @@ int parity_chsize(struct snapraid_parity_handle* parity, data_off_t size, data_o call = "fallocate"; if (!skip_fallocate) { /* allocate real space using the specific Linux fallocate() operation. */ - /* If the underline filesystem doesn't support it, this operation fails, */ + /* If the underline file-system doesn't support it, this operation fails, */ /* instead posix_fallocate() fallbacks to write the whole file. */ ret = fallocate(parity->f, 0, 0, size); @@ -351,7 +351,7 @@ int parity_open(struct snapraid_parity_handle* parity, const char* path, int mod /* LCOV_EXCL_STOP */ } - /* get the size of the exising data */ + /* get the size of the existing data */ parity->valid_size = parity->st.st_size; #if HAVE_POSIX_FADVISE @@ -411,7 +411,7 @@ int parity_close(struct snapraid_parity_handle* parity) /* This is a serious error, as it may be the result of a failed write */ /* identified at later time. */ - /* In a normal filesystem (not NFS) it should never happen */ + /* In a normal file-system (not NFS) it should never happen */ log_fatal("Error closing parity file '%s'. %s.\n", parity->path, strerror(errno)); return -1; /* LCOV_EXCL_STOP */ diff --git a/cmdline/parity.h b/cmdline/parity.h index dbc3cc64..066ff3d7 100644 --- a/cmdline/parity.h +++ b/cmdline/parity.h @@ -43,7 +43,7 @@ block_off_t parity_allocated_size(struct snapraid_state* state); * This includes only parity blocks used for files, not counting * potential invalid parity at the end. * - * If the array is fully synched there is no difference between + * If the array is fully synced there is no difference between * parity_allocate_size() and parity_used_size(). * But if the sync is interrupted, the parity_used_size() returns * the position of the latest BLK block, ignoring CHG, REL and DELETED ones, @@ -56,7 +56,7 @@ block_off_t parity_used_size(struct snapraid_state* state); * * This is the same logic used in "status" to detect an incomplete "sync", * that ignores invalid block, if they are not used by a file in any disk. - * This means that DELETED blocks won't necessarely imply an invalid parity. + * This means that DELETED blocks won't necessarily imply an invalid parity. */ int parity_is_invalid(struct snapraid_state* state); diff --git a/cmdline/portable.h b/cmdline/portable.h index feb41e55..2e37eeba 100644 --- a/cmdline/portable.h +++ b/cmdline/portable.h @@ -294,7 +294,7 @@ int devuuid(uint64_t device, char* uuid, size_t size); #define FILEPHY_UNREAD_OFFSET 0 /** - * Special value returned when the filesystem doesn't report any offset for unknown reason. + * Special value returned when the file-system doesn't report any offset for unknown reason. */ #define FILEPHY_UNREPORTED_OFFSET 1 @@ -311,13 +311,13 @@ int devuuid(uint64_t device, char* uuid, size_t size); /** * Get the physcal address of the specified file. - * This is expected to be just a hint and not necessarely correct or unique. + * This is expected to be just a hint and not necessarily correct or unique. * Return 0 on success. */ int filephy(const char* path, uint64_t size, uint64_t* physical); /** - * Check if the underline filesystem support persistent inodes. + * Check if the underline file-system support persistent inodes. * Return -1 on error, 0 on success. */ int fsinfo(const char* path, int* has_persistent_inode, uint64_t* total_space, uint64_t* free_space); @@ -341,7 +341,7 @@ uint64_t tick_ms(void); void os_init(int opt); /** - * Deintialize the system. + * Deinitialize the system. */ void os_done(void); diff --git a/cmdline/scan.c b/cmdline/scan.c index 43da04de..e25b0ea1 100644 --- a/cmdline/scan.c +++ b/cmdline/scan.c @@ -232,7 +232,7 @@ static void scan_file_allocate(struct snapraid_scan* scan, struct snapraid_file* /* - Sync aborted after, updating the parity to the new state, */ /* but without saving the content file representing this new state. */ /* - Another file is added again (exactly here) */ - /* with the hash of DELETED block not represeting the real parity state */ + /* with the hash of DELETED block not representing the real parity state */ hash_invalid_set(block->hash); } } @@ -304,7 +304,7 @@ static void scan_file_deallocate(struct snapraid_scan* scan, struct snapraid_fil /* but without saving the content file representing this new state. */ /* - File is now deleted after the aborted sync */ /* - Sync again, deleting the blocks (exactly here) */ - /* with the hash of CHG block not represeting the real parity state */ + /* with the hash of CHG block not representing the real parity state */ hash_invalid_set(block->hash); } break; @@ -606,7 +606,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub, * If the disk has persistent inodes and UUID, try a search on the past inodes, * to detect moved files. * - * For persistent inodes we mean inodes that keep their values when the filesystem + * For persistent inodes we mean inodes that keep their values when the file-system * is unmounted and remounted. This don't always happen. * * Cases found are: @@ -620,10 +620,10 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub, * file recognition. * * For persistent UUID we mean that it has the same UUID as before. - * Otherwise, if the UUID is changed, likely it's a new recreated filesystem, + * Otherwise, if the UUID is changed, likely it's a new recreated file-system, * and then the inode have no meaning. * - * Note that to disable the search by past inode, we do this implicitely + * Note that to disable the search by past inode, we do this implicitly * removing all the past inode before searching for files. * This ensures that no file is found with a past inode, but at the same time, * it allows to find new files with the same inode, to identify them as hardlinks. @@ -716,7 +716,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub, /* here the file matches the inode, but not the other info */ /* if could be a modified file with the same name, */ /* or a restored/copied file that get assigned a previously used inode, */ - /* or a filesystem with not persistent inodes */ + /* or a file-system with not persistent inodes */ /* for sure it cannot be already present */ if (file_flag_has(file, FILE_IS_PRESENT)) { @@ -728,7 +728,7 @@ static void scan_file(struct snapraid_scan* scan, int is_diff, const char* sub, /* assume a previously used inode, it's the worst case */ /* and we handle it removing the duplicate stored inode. */ - /* If the file is found by name (not necessarely in this function call), */ + /* If the file is found by name (not necessarily in this function call), */ /* it will have the inode restored, otherwise, it will get removed */ /* remove from the inode set */ @@ -1435,7 +1435,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff) ret = fsinfo(disk->dir, &has_persistent_inode, 0, 0); if (ret < 0) { /* LCOV_EXCL_START */ - log_fatal("Error accessing disk '%s' to get filesystem info. %s.\n", disk->dir, strerror(errno)); + log_fatal("Error accessing disk '%s' to get file-system info. %s.\n", disk->dir, strerror(errno)); exit(EXIT_FAILURE); /* LCOV_EXCL_STOP */ } @@ -1811,7 +1811,7 @@ static int state_diffscan(struct snapraid_state* state, int is_diff) tommy_list_foreach(&scanlist, (tommy_foreach_func*)free); - /* check the filesystem on all disks */ + /* check the file-system on all disks */ state_fscheck(state, "after scan"); if (is_diff) { diff --git a/cmdline/scrub.c b/cmdline/scrub.c index 83be0a34..3e9073a7 100644 --- a/cmdline/scrub.c +++ b/cmdline/scrub.c @@ -290,7 +290,7 @@ static int state_scrub_process(struct snapraid_state* state, struct snapraid_par if (handle[j].st.st_size != file->size || handle[j].st.st_mtime != file->mtime_sec || STAT_NSEC(&handle[j].st) != file->mtime_nsec - /* don't check the inode to support filesystem without persistent inodes */ + /* don't check the inode to support file-system without persistent inodes */ ) { /* report that the block and the file are not synced */ block_is_unsynced = 1; diff --git a/cmdline/snapraid.c b/cmdline/snapraid.c index 7ef48888..041b2934 100644 --- a/cmdline/snapraid.c +++ b/cmdline/snapraid.c @@ -41,13 +41,13 @@ void usage(void) printf("\n"); printf("Commands:\n"); printf(" status Print the status of the array\n"); - printf(" diff Show the changes that needs to be syncronized\n"); - printf(" sync Syncronize the state of the array\n"); + printf(" diff Show the changes that needs to be synchronized\n"); + printf(" sync Synchronize the state of the array\n"); printf(" scrub Scrub the array\n"); printf(" list List the array content\n"); printf(" dup Find duplicate files\n"); - printf(" up Spinup the array\n"); - printf(" down Spindown the array\n"); + printf(" up Spin-up the array\n"); + printf(" down Spin-down the array\n"); printf(" smart SMART attributes of the array\n"); printf(" pool Create or update the virtual view of the array\n"); printf(" check Check the array\n"); @@ -64,11 +64,11 @@ void usage(void) printf(" " SWITCH_GETOPT_LONG("-i, --import DIR ", "-i") " Import deleted files\n"); printf(" " SWITCH_GETOPT_LONG("-l, --log FILE ", "-l") " Log file. Default none\n"); printf(" " SWITCH_GETOPT_LONG("-a, --audit-only ", "-a") " Check only file data and not parity\n"); - printf(" " SWITCH_GETOPT_LONG("-h, --pre-hash ", "-h") " Pre hash all the new data\n"); - printf(" " SWITCH_GETOPT_LONG("-Z, --force-zero ", "-Z") " Force synching of files that get zero size\n"); - printf(" " SWITCH_GETOPT_LONG("-E, --force-empty ", "-E") " Force synching of disks that get empty\n"); + printf(" " SWITCH_GETOPT_LONG("-h, --pre-hash ", "-h") " Pre-hash all the new data\n"); + printf(" " SWITCH_GETOPT_LONG("-Z, --force-zero ", "-Z") " Force syncing of files that get zero size\n"); + printf(" " SWITCH_GETOPT_LONG("-E, --force-empty ", "-E") " Force syncing of disks that get empty\n"); printf(" " SWITCH_GETOPT_LONG("-U, --force-uuid ", "-U") " Force commands on disks with uuid changed\n"); - printf(" " SWITCH_GETOPT_LONG("-D, --force-device ", "-D") " Force commands with unaccessible/shared disks\n"); + printf(" " SWITCH_GETOPT_LONG("-D, --force-device ", "-D") " Force commands with inaccessible/shared disks\n"); printf(" " SWITCH_GETOPT_LONG("-N, --force-nocopy ", "-N") " Force commands disabling the copy detection\n"); printf(" " SWITCH_GETOPT_LONG("-F, --force-full ", "-F") " Force commands requiring a full sync\n"); printf(" " SWITCH_GETOPT_LONG("-v, --verbose ", "-v") " Verbose\n"); @@ -927,7 +927,7 @@ int main(int argc, char* argv[]) } /* errors must be always fixed on all disks */ - /* becasue we don't keep the information on what disk is the error */ + /* because we don't keep the information on what disk is the error */ if (filter_error != 0 && !tommy_list_empty(&filterlist_disk)) { /* LCOV_EXCL_START */ log_fatal("You cannot use -e, --filter-error and -d, --filter-disk at the same time\n"); @@ -1068,7 +1068,7 @@ int main(int argc, char* argv[]) /* in the next state read ensures to clear all the past hashes in case */ /* we are reading from an incomplete sync */ - /* The undeterminated hash are only for CHG/DELETED blocks for which we don't */ + /* The indeterminate hash are only for CHG/DELETED blocks for which we don't */ /* know if the previous interrupted sync was able to update or not the parity. */ /* The sync process instead needs to trust this information because it's used */ /* to avoid to recompute the parity if all the input are equals as before. */ @@ -1083,15 +1083,15 @@ int main(int argc, char* argv[]) /* - Sync aborted after updating the parity to the new state, */ /* but without saving the content file representing this new BLK state. */ /* - File is now deleted after the aborted sync */ - /* - Sync again, deleting the blocks overt the CHG ones */ - /* with the hash of CHG blocks not represeting the real parity state */ + /* - Sync again, deleting the blocks over the CHG ones */ + /* with the hash of CHG blocks not representing the real parity state */ /* An example for DELETED blocks is: */ /* - One file is deleted creating DELETED blocks */ /* - Sync aborted after, updating the parity to the new state, */ /* but without saving the content file representing this new EMPTY state. */ /* - Another file is added again over the DELETE ones */ - /* with the hash of DELETED blocks not represeting the real parity state */ + /* with the hash of DELETED blocks not representing the real parity state */ state.clear_past_hash = 1; state_read(&state); @@ -1137,9 +1137,9 @@ int main(int argc, char* argv[]) /* waits some time to ensure that any concurrent modification done at the files, */ /* using the same mtime read by the scan process, will be read by sync. */ /* Note that any later modification done, potentially not read by sync, will have */ - /* a different mtime, and it will be syncronized at the next sync. */ - /* The worst case is the FAT filesystem with a two seconds resolution for mtime. */ - /* If you don't use FAT, the wait is not needed, because most filesystems have now */ + /* a different mtime, and it will be synchronized at the next sync. */ + /* The worst case is the FAT file-system with a two seconds resolution for mtime. */ + /* If you don't use FAT, the wait is not needed, because most file-systems have now */ /* at least microseconds resolution, but better to be safe. */ if (!opt.skip_self) sleep(2); diff --git a/cmdline/state.c b/cmdline/state.c index eec04cf8..a140d122 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -36,7 +36,7 @@ * being potentially slower. * * For upcoming SnapRAID version it's planned to add a mutex protection - * at the filesystem structure, slowing down multiple data access, + * at the file-system structure, slowing down multiple data access, * so we disable it. * * Multi thread for verify is instead always generally faster, @@ -255,7 +255,7 @@ static void state_config_check(struct snapraid_state* state, const char* path, t if (disk->device == 0) { /* LCOV_EXCL_START */ log_fatal("Disk '%s' has a zero serial number.\n", disk->dir); - log_fatal("This is not necessarely wrong, but for using SnapRAID\n"); + log_fatal("This is not necessarily wrong, but for using SnapRAID\n"); log_fatal("it's better to change the serial number of the disk.\n"); log_fatal("Try using the 'VolumeID' tool by 'Mark Russinovich'.\n"); exit(EXIT_FAILURE); @@ -337,7 +337,7 @@ static void state_config_check(struct snapraid_state* state, const char* path, t if (state->parity[l].device == 0) { /* LCOV_EXCL_START */ log_fatal("Disk '%s' has a zero serial number.\n", state->parity[l].path); - log_fatal("This is not necessarely wrong, but for using SnapRAID\n"); + log_fatal("This is not necessarily wrong, but for using SnapRAID\n"); log_fatal("it's better to change the serial number of the disk.\n"); log_fatal("Try using the 'VolumeID' tool by 'Mark Russinovich'.\n"); exit(EXIT_FAILURE); @@ -395,7 +395,7 @@ static void state_config_check(struct snapraid_state* state, const char* path, t if (state->pool[0] != 0 && state->pool_device == 0) { /* LCOV_EXCL_START */ log_fatal("Disk '%s' has a zero serial number.\n", state->pool); - log_fatal("This is not necessarely wrong, but for using SnapRAID\n"); + log_fatal("This is not necessarily wrong, but for using SnapRAID\n"); log_fatal("it's better to change the serial number of the disk.\n"); log_fatal("Try using the 'VolumeID' tool by 'Mark Russinovich'.\n"); exit(EXIT_FAILURE); @@ -645,7 +645,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co /* use a fake device, and mark the disk to be skipped */ dev = 0; skip_access = 1; - log_fatal("DANGER! Skipping unaccessible parity disk '%s'...\n", tag); + log_fatal("DANGER! Skipping inaccessible parity disk '%s'...\n", tag); } else { /* LCOV_EXCL_START */ log_fatal("Error accessing 'parity' dir '%s' specification in '%s' at line %u\n", device, path, line); @@ -784,7 +784,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co if (state->opt.skip_content_access) { /* use a fake device */ dev = 0; - log_fatal("WARNING! Skipping unaccessible content file '%s'...\n", buffer); + log_fatal("WARNING! Skipping inaccessible content file '%s'...\n", buffer); } else { /* LCOV_EXCL_START */ log_fatal("Error accessing 'content' dir '%s' specification in '%s' at line %u\n", device, path, line); @@ -883,7 +883,7 @@ void state_config(struct snapraid_state* state, const char* path, const char* co dev = 0; *uuid = 0; skip_access = 1; - log_fatal("DANGER! Skipping unaccessible data disk '%s'...\n", buffer); + log_fatal("DANGER! Skipping inaccessible data disk '%s'...\n", buffer); } else { /* LCOV_EXCL_START */ log_fatal("Error accessing 'disk' '%s' specification in '%s' at line %u\n", dir, device, line); @@ -1207,7 +1207,7 @@ static struct snapraid_disk* find_disk_by_uuid(struct snapraid_state* state, con tommy_node* i; struct snapraid_disk* found = 0; - /* special test case to find the first macthing UUID */ + /* special test case to find the first matching UUID */ /* when testing UUID are all equal or not supported */ /* and we should handle this case specifically */ if (state->opt.match_first_uuid) @@ -1462,7 +1462,7 @@ void state_refresh(struct snapraid_state* state) ret = fsinfo(disk->dir, 0, &total_space, &free_space); if (ret != 0) { /* LCOV_EXCL_START */ - log_fatal("Error accessing disk '%s' to get filesystem info. %s.\n", disk->dir, strerror(errno)); + log_fatal("Error accessing disk '%s' to get file-system info. %s.\n", disk->dir, strerror(errno)); exit(EXIT_FAILURE); /* LCOV_EXCL_STOP */ } @@ -1485,7 +1485,7 @@ void state_refresh(struct snapraid_state* state) ret = fsinfo(state->parity[l].path, 0, &total_space, &free_space); if (ret != 0) { /* LCOV_EXCL_START */ - log_fatal("Error accessing file '%s' to get filesystem info. %s.\n", state->parity[l].path, strerror(errno)); + log_fatal("Error accessing file '%s' to get file-system info. %s.\n", state->parity[l].path, strerror(errno)); exit(EXIT_FAILURE); /* LCOV_EXCL_STOP */ } @@ -2029,7 +2029,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S } } else { /* extra info are accepted for backward compatibility */ - /* they are discarged at the first write */ + /* they are discarded at the first write */ } /* go to next block */ @@ -2075,7 +2075,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S /* LCOV_EXCL_STOP */ } - /* get the subcommand */ + /* get the sub-command */ c = sgetc(f); switch (c) { @@ -2108,7 +2108,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S /* LCOV_EXCL_STOP */ } - /* if we are clearing undeterminated hashes */ + /* if we are clearing indeterminate hashes */ if (state->clear_past_hash) { /* set the hash value to INVALID */ hash_invalid_set(block->hash); @@ -2315,7 +2315,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S /* LCOV_EXCL_STOP */ } } else if (c == 'C') { - /* get the subcommand */ + /* get the sub-command */ c = sgetc(f); switch (c) { @@ -2563,7 +2563,7 @@ static void state_read_content(struct snapraid_state* state, const char* path, S /* LCOV_EXCL_STOP */ } - /* check the filesystem on all disks */ + /* check the file-system on all disks */ state_fscheck(state, "after read"); /* check that the stored parity size matches the loaded state */ @@ -3061,7 +3061,7 @@ static void state_write_content(struct snapraid_state* state, uint32_t* out_crc) /* blocks of all array */ blockmax = parity_allocated_size(state); - /* check the filesystem on all disks */ + /* check the file-system on all disks */ state_fscheck(state, "before write"); /* clear the info for unused blocks */ @@ -3363,7 +3363,7 @@ void state_read(struct snapraid_state* state) f = sopen_read(path); if (f != 0) { - /* if openend stop the search */ + /* if opened stop the search */ break; } else { /* if it's real error of an existing file, abort */ @@ -4069,13 +4069,13 @@ void state_fscheck(struct snapraid_state* state, const char* ope) { tommy_node* i; - /* check the filesystem on all disks */ + /* check the file-system on all disks */ for (i = state->disklist; i != 0; i = i->next) { struct snapraid_disk* disk = i->data; if (fs_check(disk) != 0) { /* LCOV_EXCL_START */ - log_fatal("Internal inconsistency in filesystem for disk '%s' %s\n", disk->name, ope); + log_fatal("Internal inconsistency in file-system for disk '%s' %s\n", disk->name, ope); os_abort(); /* LCOV_EXCL_STOP */ } diff --git a/cmdline/state.h b/cmdline/state.h index f86c90bf..f00f89e5 100644 --- a/cmdline/state.h +++ b/cmdline/state.h @@ -74,11 +74,11 @@ struct snapraid_option { int syncedonly; /**< In fix, fixes only files that are synced. */ int prehash; /**< Enables the prehash mode for sync. */ unsigned io_error_limit; /**< Max number of input/output errors before aborting. */ - 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 force_zero; /**< Forced dangerous operations of syncing files now with zero size. */ + int force_empty; /**< Forced dangerous operations of syncing disks now empty. */ + int force_uuid; /**< Forced dangerous operations of syncing disks with uuid changed. */ int force_device; /**< Forced dangerous operations of using disks with save device id. */ - int force_nocopy; /**< Force dangerous operations of synching files without using copy detection. */ + int force_nocopy; /**< Force dangerous operations of syncing files without using copy detection. */ int force_full; /**< Force a full sync when using an old content file. */ int expect_unrecoverable; /**< Expect presence of unrecoverable error in checking or fixing. */ int expect_recoverable; /**< Expect presence of recoverable error in checking. */ @@ -313,7 +313,7 @@ void state_progress_end(struct snapraid_state* state, block_off_t countpos, bloc int state_progress(struct snapraid_state* state, block_off_t blockpos, block_off_t countpos, block_off_t countmax, data_off_t countsize); /** - * Stop temporarely the progress. + * Stop temporarily the progress. */ void state_progress_stop(struct snapraid_state* state); @@ -384,7 +384,7 @@ static inline void state_usage_parity(struct snapraid_state* state, unsigned lev void state_usage_print(struct snapraid_state* state); /** - * Check the filesystem on all disks. + * Check the file-system on all disks. * On error it aborts. */ void state_fscheck(struct snapraid_state* state, const char* ope); diff --git a/cmdline/stream.h b/cmdline/stream.h index 8c8d0465..35b941f6 100644 --- a/cmdline/stream.h +++ b/cmdline/stream.h @@ -32,8 +32,8 @@ unsigned STREAM_SIZE; #define STREAM_STATE_READ 0 /**< The stream is in a normal state of read. */ #define STREAM_STATE_WRITE 1 /**< The stream is in a normal state of write. */ -#define STREAM_STATE_ERROR -1 /**< An error was encoutered. */ -#define STREAM_STATE_EOF 2 /**< The end of file was encoutered. */ +#define STREAM_STATE_ERROR -1 /**< An error was encountered. */ +#define STREAM_STATE_EOF 2 /**< The end of file was encountered. */ struct stream_handle { int f; /**< Handle of the file. */ diff --git a/cmdline/support.c b/cmdline/support.c index 06d8edb2..cc783c56 100644 --- a/cmdline/support.c +++ b/cmdline/support.c @@ -487,7 +487,7 @@ int pathcmp(const char* a, const char* b) } /****************************************************************************/ -/* filesystem */ +/* file-system */ int mkancestor(const char* file) { diff --git a/cmdline/support.h b/cmdline/support.h index bae27543..c15210c0 100644 --- a/cmdline/support.h +++ b/cmdline/support.h @@ -114,7 +114,7 @@ void msg_status(const char* format, ...) __attribute__((format(attribute_printf, * Potentially a lot of messages are possible. They can still be on the screen, * as losing them we don't lose information. * - * These messages never go in the log file, becauae there is always a corresponding log_tag(). + * These messages never go in the log file, because there is always a corresponding log_tag(). */ void msg_info(const char* format, ...) __attribute__((format(attribute_printf, 1, 2))); @@ -225,12 +225,12 @@ void pathcut(char* dst); /** * Compare two paths. - * In Windows it's case insentive and assumes \ equal at /. + * In Windows it's case insensitive and assumes \ equal at /. */ int pathcmp(const char* a, const char* b); /****************************************************************************/ -/* filesystem */ +/* file-system */ /** * Create all the ancestor directories if missing. diff --git a/cmdline/unix.c b/cmdline/unix.c index 8731f8b3..409c53a5 100644 --- a/cmdline/unix.c +++ b/cmdline/unix.c @@ -78,7 +78,7 @@ static blkid_cache cache = 0; /** * Get the UUID using the /dev/disk/by-uuid/ links. * It doesn't require root permission, and the uuid are always updated. - * It doesn't work with Btrfs filesystems that don't export the main UUID + * It doesn't work with Btrfs file-systems that don't export the main UUID * in /dev/disk/by-uuid/. */ #if HAVE_FSTATAT @@ -128,7 +128,7 @@ static int devuuid_dev(uint64_t device, char* uuid, size_t uuid_size) /** * Get the UUID using liblkid. * It uses a cache to work without root permission, resultin in UUID - * not necessarely recent. + * not necessarily recent. * We could call blkid_probe_all() to refresh the UUID, but it would * require root permission to read the superblocks, and to have * all the disks spinning. @@ -221,7 +221,7 @@ int filephy(const char* path, uint64_t size, uint64_t* physical) /* if the offset is unknown, we don't have an offset to report */ *physical = FILEPHY_WITHOUT_OFFSET; } else if (offset == 0) { - /* 0 is the general fallback for filesystems when */ + /* 0 is the general fallback for file-systems when */ /* they don't have an offset to report */ *physical = FILEPHY_WITHOUT_OFFSET; } else { @@ -265,7 +265,7 @@ int filephy(const char* path, uint64_t size, uint64_t* physical) /* if it really improves performance. */ /* In this way we keep them in the directory traversal order */ /* that at least keeps files in the same directory together. */ - /* Note also that in newer filesystem with snapshot, like ZFS, */ + /* Note also that in newer file-system with snapshot, like ZFS, */ /* the inode doesn't represent even less the disk position, because files */ /* are not overwritten in place, but rewritten in another location */ /* of the disk. */ diff --git a/cmdline/unix.h b/cmdline/unix.h index 5c1f494b..c4c6a749 100644 --- a/cmdline/unix.h +++ b/cmdline/unix.h @@ -43,7 +43,7 @@ #endif /** - * Open a file with the O_NOATIME flag to avoid to update the acces time. + * Open a file with the O_NOATIME flag to avoid to update the access time. */ int open_noatime(const char* file, int flags);