Fix lazy typo

This commit is contained in:
Andrew Gaul 2019-03-09 17:45:10 +09:00
parent 0d43d070cc
commit 1e86cc643d
2 changed files with 23 additions and 23 deletions

View File

@ -1829,7 +1829,7 @@ S3fsCurl::S3fsCurl(bool ahbe) :
bodydata(NULL), headdata(NULL), LastResponseCode(-1), postdata(NULL), postdata_remaining(0), is_use_ahbe(ahbe), bodydata(NULL), headdata(NULL), LastResponseCode(-1), postdata(NULL), postdata_remaining(0), is_use_ahbe(ahbe),
retry_count(0), b_infile(NULL), b_postdata(NULL), b_postdata_remaining(0), b_partdata_startpos(0), b_partdata_size(0), retry_count(0), b_infile(NULL), b_postdata(NULL), b_postdata_remaining(0), b_partdata_startpos(0), b_partdata_size(0),
b_ssekey_pos(-1), b_ssevalue(""), b_ssetype(SSE_DISABLE), op(""), query_string(""), b_ssekey_pos(-1), b_ssevalue(""), b_ssetype(SSE_DISABLE), op(""), query_string(""),
sem(NULL), completed_tids_lock(NULL), completed_tids(NULL), fpRazySetup(NULL) sem(NULL), completed_tids_lock(NULL), completed_tids(NULL), fpLazySetup(NULL)
{ {
} }
@ -1904,7 +1904,7 @@ bool S3fsCurl::CreateCurlHandle(bool only_pool, bool remake)
return false; return false;
}else{ }else{
// [NOTE] // [NOTE]
// urther initialization processing is left to razy processing to be executed later. // urther initialization processing is left to lazy processing to be executed later.
// (Currently we do not use only_pool=true, but this code is remained for the future) // (Currently we do not use only_pool=true, but this code is remained for the future)
return true; return true;
} }
@ -1979,7 +1979,7 @@ bool S3fsCurl::ClearInternalData()
b_partdata_size = 0; b_partdata_size = 0;
partdata.clear(); partdata.clear();
fpRazySetup = NULL; fpLazySetup = NULL;
S3FS_MALLOCTRIM(0); S3FS_MALLOCTRIM(0);
@ -2872,8 +2872,8 @@ bool S3fsCurl::PreHeadRequest(const char* tpath, const char* bpath, const char*
type = REQTYPE_HEAD; type = REQTYPE_HEAD;
insertAuthHeaders(); insertAuthHeaders();
// set razy function // set lazy function
fpRazySetup = PreHeadRequestSetCurlOpts; fpLazySetup = PreHeadRequestSetCurlOpts;
return true; return true;
} }
@ -2885,7 +2885,7 @@ int S3fsCurl::HeadRequest(const char* tpath, headers_t& meta)
S3FS_PRN_INFO3("[tpath=%s]", SAFESTRPTR(tpath)); S3FS_PRN_INFO3("[tpath=%s]", SAFESTRPTR(tpath));
// At first, try to get without SSE-C headers // At first, try to get without SSE-C headers
if(!PreHeadRequest(tpath) || !fpRazySetup || !fpRazySetup(this) || 0 != (result = RequestPerform())){ if(!PreHeadRequest(tpath) || !fpLazySetup || !fpLazySetup(this) || 0 != (result = RequestPerform())){
// If has SSE-C keys, try to get with all SSE-C keys. // If has SSE-C keys, try to get with all SSE-C keys.
for(int pos = 0; static_cast<size_t>(pos) < S3fsCurl::sseckeys.size(); pos++){ for(int pos = 0; static_cast<size_t>(pos) < S3fsCurl::sseckeys.size(); pos++){
if(!DestroyCurlHandle()){ if(!DestroyCurlHandle()){
@ -2894,8 +2894,8 @@ int S3fsCurl::HeadRequest(const char* tpath, headers_t& meta)
if(!PreHeadRequest(tpath, NULL, NULL, pos)){ if(!PreHeadRequest(tpath, NULL, NULL, pos)){
break; break;
} }
if(!fpRazySetup || !fpRazySetup(this)){ if(!fpLazySetup || !fpLazySetup(this)){
S3FS_PRN_ERR("Failed to razy setup in single head request."); S3FS_PRN_ERR("Failed to lazy setup in single head request.");
break; break;
} }
if(0 == (result = RequestPerform())){ if(0 == (result = RequestPerform())){
@ -3196,8 +3196,8 @@ int S3fsCurl::PreGetObjectRequest(const char* tpath, int fd, off_t start, ssize_
type = REQTYPE_GET; type = REQTYPE_GET;
insertAuthHeaders(); insertAuthHeaders();
// set razy function // set lazy function
fpRazySetup = PreGetObjectRequestSetCurlOpts; fpLazySetup = PreGetObjectRequestSetCurlOpts;
// set info for callback func. // set info for callback func.
// (use only fd, startpos and size, other member is not used.) // (use only fd, startpos and size, other member is not used.)
@ -3232,8 +3232,8 @@ int S3fsCurl::GetObjectRequest(const char* tpath, int fd, off_t start, ssize_t s
if(0 != (result = PreGetObjectRequest(tpath, fd, start, size, ssetype, ssevalue))){ if(0 != (result = PreGetObjectRequest(tpath, fd, start, size, ssetype, ssevalue))){
return result; return result;
} }
if(!fpRazySetup || !fpRazySetup(this)){ if(!fpLazySetup || !fpLazySetup(this)){
S3FS_PRN_ERR("Failed to razy setup in single get object request."); S3FS_PRN_ERR("Failed to lazy setup in single get object request.");
return -1; return -1;
} }
@ -3654,8 +3654,8 @@ int S3fsCurl::UploadMultipartPostSetup(const char* tpath, int part_num, const st
type = REQTYPE_UPLOADMULTIPOST; type = REQTYPE_UPLOADMULTIPOST;
insertAuthHeaders(); insertAuthHeaders();
// set razy function // set lazy function
fpRazySetup = UploadMultipartPostSetCurlOpts; fpLazySetup = UploadMultipartPostSetCurlOpts;
return 0; return 0;
} }
@ -3725,8 +3725,8 @@ int S3fsCurl::CopyMultipartPostSetup(const char* from, const char* to, int part_
type = REQTYPE_COPYMULTIPOST; type = REQTYPE_COPYMULTIPOST;
insertAuthHeaders(); insertAuthHeaders();
// set razy function // set lazy function
fpRazySetup = CopyMultipartPostSetCurlOpts; fpLazySetup = CopyMultipartPostSetCurlOpts;
// request // request
S3FS_PRN_INFO3("copying... [from=%s][to=%s][part=%d]", from, to, part_num); S3FS_PRN_INFO3("copying... [from=%s][to=%s][part=%d]", from, to, part_num);
@ -4269,9 +4269,9 @@ void* S3fsMultiCurl::RequestPerformWrapper(void* arg)
{ {
S3fsCurl* s3fscurl= static_cast<S3fsCurl*>(arg); S3fsCurl* s3fscurl= static_cast<S3fsCurl*>(arg);
void* result = NULL; void* result = NULL;
if(s3fscurl && s3fscurl->fpRazySetup){ if(s3fscurl && s3fscurl->fpLazySetup){
if(!s3fscurl->fpRazySetup(s3fscurl)){ if(!s3fscurl->fpLazySetup(s3fscurl)){
S3FS_PRN_ERR("Failed to razy setup, then respond EIO."); S3FS_PRN_ERR("Failed to lazy setup, then respond EIO.");
result = (void*)(intptr_t)(-EIO); result = (void*)(intptr_t)(-EIO);
} }
} }

View File

@ -155,8 +155,8 @@ private:
//---------------------------------------------- //----------------------------------------------
class S3fsCurl; class S3fsCurl;
// Prototype function for razy setup options for curl handle // Prototype function for lazy setup options for curl handle
typedef bool (*s3fscurl_razy_setup)(S3fsCurl* s3fscurl); typedef bool (*s3fscurl_lazy_setup)(S3fsCurl* s3fscurl);
typedef std::map<std::string, std::string> iamcredmap_t; typedef std::map<std::string, std::string> iamcredmap_t;
typedef std::map<std::string, std::string> sseckeymap_t; typedef std::map<std::string, std::string> sseckeymap_t;
@ -285,7 +285,7 @@ class S3fsCurl
Semaphore *sem; Semaphore *sem;
pthread_mutex_t *completed_tids_lock; pthread_mutex_t *completed_tids_lock;
std::vector<pthread_t> *completed_tids; std::vector<pthread_t> *completed_tids;
s3fscurl_razy_setup fpRazySetup; // curl options for razy setting function s3fscurl_lazy_setup fpLazySetup; // curl options for lazy setting function
public: public:
// constructor/destructor // constructor/destructor
@ -318,7 +318,7 @@ class S3fsCurl
static S3fsCurl* CopyMultipartPostRetryCallback(S3fsCurl* s3fscurl); static S3fsCurl* CopyMultipartPostRetryCallback(S3fsCurl* s3fscurl);
static S3fsCurl* ParallelGetObjectRetryCallback(S3fsCurl* s3fscurl); static S3fsCurl* ParallelGetObjectRetryCallback(S3fsCurl* s3fscurl);
// razy functions for set curl options // lazy functions for set curl options
static bool UploadMultipartPostSetCurlOpts(S3fsCurl* s3fscurl); static bool UploadMultipartPostSetCurlOpts(S3fsCurl* s3fscurl);
static bool CopyMultipartPostSetCurlOpts(S3fsCurl* s3fscurl); static bool CopyMultipartPostSetCurlOpts(S3fsCurl* s3fscurl);
static bool PreGetObjectRequestSetCurlOpts(S3fsCurl* s3fscurl); static bool PreGetObjectRequestSetCurlOpts(S3fsCurl* s3fscurl);