This commit is contained in:
Andrew Gaul 2021-06-27 11:22:33 +09:00 committed by GitHub
parent f9e80f995d
commit 2154e898bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 34 additions and 34 deletions

View File

@ -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{

View File

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

View File

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

View File

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

View File

@ -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;

View File

@ -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_

View File

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

View File

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

View File

@ -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<int>(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<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;
@ -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.

View File

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

View File

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

View File

@ -33,7 +33,7 @@
#include "string_util.h"
//-------------------------------------------------------------------
// Gloval variables
// Global variables
//-------------------------------------------------------------------
const std::string SPACES = " \t\r\n";

View File

@ -25,7 +25,7 @@
// A collection of string utilities for manipulating URLs and HTTP responses.
//
//-------------------------------------------------------------------
// Gloval variables
// Global variables
//-------------------------------------------------------------------
extern const std::string SPACES;

View File

@ -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

View File

@ -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