From 2154e898bcb27294a594322efc972cbef5fde50c Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 27 Jun 2021 11:22:33 +0900 Subject: [PATCH] Fix typos (#1700) --- src/curl.cpp | 2 +- src/curl.h | 2 +- src/fdcache.cpp | 2 +- src/fdcache.h | 2 +- src/fdcache_auto.cpp | 4 ++-- src/fdcache_auto.h | 6 +++--- src/fdcache_entity.cpp | 4 ++-- src/fdcache_page.cpp | 4 ++-- src/s3fs.cpp | 30 +++++++++++++++--------------- src/s3fs_xml.cpp | 2 +- src/s3fs_xml.h | 2 +- src/string_util.cpp | 2 +- src/string_util.h | 2 +- test/integration-test-common.sh | 2 +- test/integration-test-main.sh | 2 +- 15 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/curl.cpp b/src/curl.cpp index ea171928a..50c378946 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -393,7 +393,7 @@ bool S3fsCurl::InitMimeType(const std::string& strFile) if(0 == stat(DEFAULT_MIME_FILE, &st)){ MimeFile = DEFAULT_MIME_FILE; }else if(compare_sysname("Darwin")){ - // for macos, search another default file. + // for macOS, search another default file. if(0 == stat(SPECIAL_DARWIN_MIME_FILE, &st)){ MimeFile = SPECIAL_DARWIN_MIME_FILE; }else{ diff --git a/src/curl.h b/src/curl.h index 0b841a74c..bc899850e 100644 --- a/src/curl.h +++ b/src/curl.h @@ -400,7 +400,7 @@ class S3fsCurl CURL* GetCurlHandle() const { return hCurl; } std::string GetPath() const { return path; } std::string GetBasePath() const { return base_path; } - std::string GetSpacialSavedPath() const { return saved_path; } + std::string GetSpecialSavedPath() const { return saved_path; } std::string GetUrl() const { return url; } std::string GetOp() const { return op; } headers_t* GetResponseHeaders() { return &responseHeaders; } diff --git a/src/fdcache.cpp b/src/fdcache.cpp index 07a2f8785..a4a06a338 100644 --- a/src/fdcache.cpp +++ b/src/fdcache.cpp @@ -605,7 +605,7 @@ FdEntity* FdManager::GetExistFdEntity(const char* path, int existfd) return NULL; } -FdEntity* FdManager::OpenExistFdEntiy(const char* path, int& fd, int flags) +FdEntity* FdManager::OpenExistFdEntity(const char* path, int& fd, int flags) { S3FS_PRN_DBG("[path=%s][flags=0x%x]", SAFESTRPTR(path), flags); diff --git a/src/fdcache.h b/src/fdcache.h index a5adbd1a6..cedb18d64 100644 --- a/src/fdcache.h +++ b/src/fdcache.h @@ -84,7 +84,7 @@ class FdManager FdEntity* GetFdEntity(const char* path, int& existfd, bool newfd = true, bool lock_already_held = false); FdEntity* Open(int& fd, const char* path, headers_t* pmeta = NULL, off_t size = -1, time_t time = -1, int flags = O_RDONLY, bool force_tmpfile = false, bool is_create = true, bool no_fd_lock_wait = false); FdEntity* GetExistFdEntity(const char* path, int existfd = -1); - FdEntity* OpenExistFdEntiy(const char* path, int& fd, int flags = O_RDONLY); + FdEntity* OpenExistFdEntity(const char* path, int& fd, int flags = O_RDONLY); void Rename(const std::string &from, const std::string &to); bool Close(FdEntity* ent, int fd); bool ChangeEntityToTempPath(FdEntity* ent, const char* path); diff --git a/src/fdcache_auto.cpp b/src/fdcache_auto.cpp index 333ad2340..d6645b72c 100644 --- a/src/fdcache_auto.cpp +++ b/src/fdcache_auto.cpp @@ -123,11 +123,11 @@ FdEntity* AutoFdEntity::GetExistFdEntity(const char* path, int existfd) return ent; } -FdEntity* AutoFdEntity::OpenExistFdEntiy(const char* path, int flags) +FdEntity* AutoFdEntity::OpenExistFdEntity(const char* path, int flags) { Close(); - if(NULL == (pFdEntity = FdManager::get()->OpenExistFdEntiy(path, pseudo_fd, flags))){ + if(NULL == (pFdEntity = FdManager::get()->OpenExistFdEntity(path, pseudo_fd, flags))){ return NULL; } return pFdEntity; diff --git a/src/fdcache_auto.h b/src/fdcache_auto.h index 4531c0bee..788a8f854 100644 --- a/src/fdcache_auto.h +++ b/src/fdcache_auto.h @@ -26,9 +26,9 @@ //------------------------------------------------ // class AutoFdEntity //------------------------------------------------ -// A class that opens fdentiry and closes it automatically. +// A class that opens fdentry and closes it automatically. // This class object is used to prevent inconsistencies in -// the number of references in fdentiry. +// the number of references in fdentry. // The methods are wrappers to the method of the FdManager class. // class AutoFdEntity @@ -52,7 +52,7 @@ class AutoFdEntity FdEntity* Open(const char* path, headers_t* pmeta = NULL, off_t size = -1, time_t time = -1, int flags = O_RDONLY, bool force_tmpfile = false, bool is_create = true, bool no_fd_lock_wait = false); FdEntity* GetExistFdEntity(const char* path, int existfd = -1); - FdEntity* OpenExistFdEntiy(const char* path, int flags = O_RDONLY); + FdEntity* OpenExistFdEntity(const char* path, int flags = O_RDONLY); }; #endif // S3FS_FDCACHE_AUTO_H_ diff --git a/src/fdcache_entity.cpp b/src/fdcache_entity.cpp index 6fbec90c4..715f09460 100644 --- a/src/fdcache_entity.cpp +++ b/src/fdcache_entity.cpp @@ -1063,7 +1063,7 @@ int FdEntity::NoCacheLoadAndPost(PseudoFdInfo* pseudo_obj, off_t start, off_t si S3FS_PRN_INFO3("[path=%s][physical_fd=%d][offset=%lld][size=%lld]", path.c_str(), physical_fd, static_cast(start), static_cast(size)); if(!pseudo_obj){ - S3FS_PRN_ERR("Pseudo obejct is NULL."); + S3FS_PRN_ERR("Pseudo object is NULL."); return -EIO; } @@ -1488,7 +1488,7 @@ int FdEntity::RowFlush(int fd, const char* tpath, bool force_sync) // So the file has already been removed, skip error. S3FS_PRN_ERR("failed to truncate file(physical_fd=%d) to zero, but continue...", physical_fd); } - // put pading headers + // put pending headers if(0 != (result = UploadPendingMeta())){ return result; } diff --git a/src/fdcache_page.cpp b/src/fdcache_page.cpp index 015fdca4f..c1a84f8fa 100644 --- a/src/fdcache_page.cpp +++ b/src/fdcache_page.cpp @@ -101,7 +101,7 @@ static fdpage_list_t raw_compress_fdpage_list(const fdpage_list_t& pages, bool i tmppage = fdpage(iter->offset, iter->bytes, (ignore_load ? default_load : iter->loaded), (ignore_modify ? default_modify : iter->modified)); } } - // add lastest area + // add last area if(!is_first){ raw_add_compress_fdpage_list(compressed_pages, tmppage, ignore_load, ignore_modify, default_load, default_modify); } @@ -673,7 +673,7 @@ bool PageList::GetPageListsForMultipartUpload(fdpage_list_t& dlpages, fdpage_lis } } } - // lastest area + // last area if(0 < prev_page.bytes){ mixupload_pages.push_back(prev_page); } diff --git a/src/s3fs.cpp b/src/s3fs.cpp index 161640d45..0e84438e4 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -406,7 +406,7 @@ static int get_object_attribute(const char* path, struct stat* pstbuf, headers_t // not registered in the Stats cache. // Therefore, even if the file has a permission error, it // should be registered in the Stats cache. However, if - // the response without modifiying is registered in the + // the response without modifying is registered in the // cache, the file permission will be 0644(umask dependent) // because the meta header does not exist. // Thus, set the mode of 0000 here in the meta header so @@ -786,7 +786,7 @@ static int s3fs_getattr(const char* _path, struct stat* stbuf) if(stbuf){ AutoFdEntity autoent; FdEntity* ent; - if(NULL != (ent = autoent.OpenExistFdEntiy(path))){ + if(NULL != (ent = autoent.OpenExistFdEntity(path))){ struct stat tmpstbuf; if(ent->GetStats(tmpstbuf)){ stbuf->st_size = tmpstbuf.st_size; @@ -1266,7 +1266,7 @@ static int rename_object(const char* from, const char* to, bool update_ctime) // update time AutoFdEntity autoent; FdEntity* ent; - if(NULL == (ent = autoent.OpenExistFdEntiy(from))){ + if(NULL == (ent = autoent.OpenExistFdEntity(from))){ // no opened fd if(FdManager::IsCacheDir()){ // create cache file if be needed @@ -1585,7 +1585,7 @@ static int s3fs_rename(const char* _from, const char* _to) { // scope for AutoFdEntity AutoFdEntity autoent; FdEntity* ent; - if(NULL != (ent = autoent.OpenExistFdEntiy(from, O_RDWR))){ + if(NULL != (ent = autoent.OpenExistFdEntity(from, O_RDWR))){ if(0 != (result = ent->Flush(autoent.GetPseudoFd(), true))){ S3FS_PRN_ERR("could not upload file(%s): result=%d", to, result); return result; @@ -1685,7 +1685,7 @@ static int s3fs_chmod(const char* _path, mode_t mode) AutoFdEntity autoent; FdEntity* ent; bool need_put_header = true; - if(NULL != (ent = autoent.OpenExistFdEntiy(path))){ + if(NULL != (ent = autoent.OpenExistFdEntity(path))){ if(ent->MergeOrgMeta(updatemeta)){ // meta is changed, but now uploading. // then the meta is pending and accumulated to be put after the upload is complete. @@ -1862,7 +1862,7 @@ static int s3fs_chown(const char* _path, uid_t uid, gid_t gid) AutoFdEntity autoent; FdEntity* ent; bool need_put_header = true; - if(NULL != (ent = autoent.OpenExistFdEntiy(path))){ + if(NULL != (ent = autoent.OpenExistFdEntity(path))){ if(ent->MergeOrgMeta(updatemeta)){ // meta is changed, but now uploading. // then the meta is pending and accumulated to be put after the upload is complete. @@ -2044,7 +2044,7 @@ static int s3fs_utimens(const char* _path, const struct timespec ts[2]) FdEntity* ent; bool need_put_header = true; bool keep_mtime = false; - if(NULL != (ent = autoent.OpenExistFdEntiy(path))){ + if(NULL != (ent = autoent.OpenExistFdEntity(path))){ if(ent->MergeOrgMeta(updatemeta)){ // meta is changed, but now uploading. // then the meta is pending and accumulated to be put after the upload is complete. @@ -2462,7 +2462,7 @@ static int s3fs_release(const char* _path, struct fuse_file_info* fi) // At first, we remove stats cache. // Because fuse does not wait for response from "release" function. :-( // And fuse runs next command before this function returns. - // Thus we call deleting stats function ASSAP. + // Thus we call deleting stats function ASAP. // if((fi->flags & O_RDWR) || (fi->flags & O_WRONLY)){ StatCache::getStatCacheData()->DelStat(path); @@ -2472,7 +2472,7 @@ static int s3fs_release(const char* _path, struct fuse_file_info* fi) AutoFdEntity autoent; // [NOTE] - // The pseudo fd stored in fi->fh is attached to AutoFdEntiry so that it can be + // The pseudo fd stored in fi->fh is attached to AutoFdEntry so that it can be // destroyed here. // if(!autoent.Attach(path, static_cast(fi->fh))){ @@ -2513,7 +2513,7 @@ static bool multi_head_callback(S3fsCurl* s3fscurl) if(!s3fscurl){ return false; } - std::string saved_path = s3fscurl->GetSpacialSavedPath(); + std::string saved_path = s3fscurl->GetSpecialSavedPath(); if(!StatCache::getStatCacheData()->AddStat(saved_path, *(s3fscurl->GetResponseHeaders()))){ S3FS_PRN_ERR("failed adding stat cache [path=%s]", saved_path.c_str()); return false; @@ -2534,7 +2534,7 @@ static S3fsCurl* multi_head_retry_callback(S3fsCurl* s3fscurl) ssec_key_pos = (ssec_key_pos == static_cast(-1) ? 0 : ssec_key_pos + 1); if(0 == S3fsCurl::GetSseKeyCount() || S3fsCurl::GetSseKeyCount() <= ssec_key_pos){ if(s3fscurl->IsOverMultipartRetryCount()){ - S3FS_PRN_ERR("Over retry count(%d) limit(%s).", s3fscurl->GetMultipartRetryCount(), s3fscurl->GetSpacialSavedPath().c_str()); + S3FS_PRN_ERR("Over retry count(%d) limit(%s).", s3fscurl->GetMultipartRetryCount(), s3fscurl->GetSpecialSavedPath().c_str()); return NULL; } ssec_key_pos = -1; @@ -2544,7 +2544,7 @@ static S3fsCurl* multi_head_retry_callback(S3fsCurl* s3fscurl) S3fsCurl* newcurl = new S3fsCurl(s3fscurl->IsUseAhbe()); std::string path = s3fscurl->GetPath(); std::string base_path = s3fscurl->GetBasePath(); - std::string saved_path = s3fscurl->GetSpacialSavedPath(); + std::string saved_path = s3fscurl->GetSpecialSavedPath(); if(!newcurl->PreHeadRequest(path, base_path, saved_path, ssec_key_pos)){ S3FS_PRN_ERR("Could not duplicate curl object(%s).", saved_path.c_str()); @@ -2753,7 +2753,7 @@ static int list_bucket(const char* path, S3ObjList& head, const char* delimiter, } if(true == (truncated = is_truncated(doc))){ xmlChar* tmpch; - if(NULL != (tmpch = get_next_contination_token(doc))){ + if(NULL != (tmpch = get_next_continuation_token(doc))){ next_continuation_token = (char*)tmpch; xmlFree(tmpch); }else if(NULL != (tmpch = get_next_marker(doc))){ @@ -3045,7 +3045,7 @@ static int s3fs_setxattr(const char* path, const char* name, const char* value, AutoFdEntity autoent; FdEntity* ent; bool need_put_header = true; - if(NULL != (ent = autoent.OpenExistFdEntiy(path))){ + if(NULL != (ent = autoent.OpenExistFdEntity(path))){ // get xattr and make new xattr std::string strxattr; if(ent->GetXattr(strxattr)){ @@ -3332,7 +3332,7 @@ static int s3fs_removexattr(const char* path, const char* name) AutoFdEntity autoent; FdEntity* ent; bool need_put_header = true; - if(NULL != (ent = autoent.OpenExistFdEntiy(path))){ + if(NULL != (ent = autoent.OpenExistFdEntity(path))){ if(ent->MergeOrgMeta(updatemeta)){ // meta is changed, but now uploading. // then the meta is pending and accumulated to be put after the upload is complete. diff --git a/src/s3fs_xml.cpp b/src/s3fs_xml.cpp index 3daa029b7..1705827a6 100644 --- a/src/s3fs_xml.cpp +++ b/src/s3fs_xml.cpp @@ -109,7 +109,7 @@ static xmlChar* get_prefix(xmlDocPtr doc) return get_base_exp(doc, "Prefix"); } -xmlChar* get_next_contination_token(xmlDocPtr doc) +xmlChar* get_next_continuation_token(xmlDocPtr doc) { return get_base_exp(doc, "NextContinuationToken"); } diff --git a/src/s3fs_xml.h b/src/s3fs_xml.h index 7b2f8c6cf..626f9c3bf 100644 --- a/src/s3fs_xml.h +++ b/src/s3fs_xml.h @@ -36,7 +36,7 @@ bool is_truncated(xmlDocPtr doc); int append_objects_from_xml_ex(const char* path, xmlDocPtr doc, xmlXPathContextPtr ctx, const char* ex_contents, const char* ex_key, const char* ex_etag, int isCPrefix, S3ObjList& head); int append_objects_from_xml(const char* path, xmlDocPtr doc, S3ObjList& head); -xmlChar* get_next_contination_token(xmlDocPtr doc); +xmlChar* get_next_continuation_token(xmlDocPtr doc); xmlChar* get_next_marker(xmlDocPtr doc); bool get_incomp_mpu_list(xmlDocPtr doc, incomp_mpu_list_t& list); diff --git a/src/string_util.cpp b/src/string_util.cpp index 43f0737b9..ff08290c2 100644 --- a/src/string_util.cpp +++ b/src/string_util.cpp @@ -33,7 +33,7 @@ #include "string_util.h" //------------------------------------------------------------------- -// Gloval variables +// Global variables //------------------------------------------------------------------- const std::string SPACES = " \t\r\n"; diff --git a/src/string_util.h b/src/string_util.h index 4df51fb37..8975a13f0 100644 --- a/src/string_util.h +++ b/src/string_util.h @@ -25,7 +25,7 @@ // A collection of string utilities for manipulating URLs and HTTP responses. // //------------------------------------------------------------------- -// Gloval variables +// Global variables //------------------------------------------------------------------- extern const std::string SPACES; diff --git a/test/integration-test-common.sh b/test/integration-test-common.sh index 0c0129f25..823682059 100644 --- a/test/integration-test-common.sh +++ b/test/integration-test-common.sh @@ -138,7 +138,7 @@ function start_s3proxy { if [ -n "${S3PROXY_BINARY}" ] then if [ ! -e "${S3PROXY_BINARY}" ]; then - wget "https://github.com/andrewgaul/s3proxy/releases/download/s3proxy-${S3PROXY_VERSION}/s3proxy" \ + wget "https://github.com/gaul/s3proxy/releases/download/s3proxy-${S3PROXY_VERSION}/s3proxy" \ --quiet -O "${S3PROXY_BINARY}" chmod +x "${S3PROXY_BINARY}" fi diff --git a/test/integration-test-main.sh b/test/integration-test-main.sh index f640e1aa0..d6fa13fc1 100755 --- a/test/integration-test-main.sh +++ b/test/integration-test-main.sh @@ -1009,7 +1009,7 @@ function test_update_directory_time() { fi # - # mv -> update ctime, not update atime/mtime for taget directory + # mv -> update ctime, not update atime/mtime for target directory # not update any for sub-directory and a file # TIME_TEST_DIR=timetestdir