Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #1700

Merged
merged 1 commit into from
Jun 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/curl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion src/curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion src/fdcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/fdcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/fdcache_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/fdcache_auto.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_
Expand Down
4 changes: 2 additions & 2 deletions src/fdcache_entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<long long int>(start), static_cast<long long int>(size));

if(!pseudo_obj){
S3FS_PRN_ERR("Pseudo obejct is NULL.");
S3FS_PRN_ERR("Pseudo object is NULL.");
return -EIO;
}

Expand Down Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions src/fdcache_page.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down
30 changes: 15 additions & 15 deletions src/s3fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -780,7 +780,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;
Expand Down Expand Up @@ -1260,7 +1260,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
Expand Down Expand Up @@ -1579,7 +1579,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;
Expand Down Expand Up @@ -1679,7 +1679,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.
Expand Down Expand Up @@ -1856,7 +1856,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.
Expand Down Expand Up @@ -2038,7 +2038,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.
Expand Down Expand Up @@ -2456,7 +2456,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);
Expand All @@ -2466,7 +2466,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<int>(fi->fh))){
Expand Down Expand Up @@ -2507,7 +2507,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;
Expand All @@ -2528,7 +2528,7 @@ static S3fsCurl* multi_head_retry_callback(S3fsCurl* s3fscurl)
ssec_key_pos = (ssec_key_pos == static_cast<size_t>(-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;
Expand All @@ -2538,7 +2538,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());
Expand Down Expand Up @@ -2747,7 +2747,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))){
Expand Down Expand Up @@ -3039,7 +3039,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)){
Expand Down Expand Up @@ -3326,7 +3326,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.
Expand Down
2 changes: 1 addition & 1 deletion src/s3fs_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
2 changes: 1 addition & 1 deletion src/s3fs_xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/string_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "string_util.h"

//-------------------------------------------------------------------
// Gloval variables
// Global variables
//-------------------------------------------------------------------
const std::string SPACES = " \t\r\n";

Expand Down
2 changes: 1 addition & 1 deletion src/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
// A collection of string utilities for manipulating URLs and HTTP responses.
//
//-------------------------------------------------------------------
// Gloval variables
// Global variables
//-------------------------------------------------------------------
extern const std::string SPACES;

Expand Down
2 changes: 1 addition & 1 deletion test/integration-test-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/integration-test-main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,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
Expand Down