mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-09 07:59:52 +00:00
Fixed insufficient upload size for mix multipart upload
This commit is contained in:
parent
2b4619842d
commit
f26a0aa71d
@ -336,8 +336,10 @@ void PageList::Clear()
|
||||
bool PageList::Init(off_t size, bool is_loaded, bool is_modified)
|
||||
{
|
||||
Clear();
|
||||
if(0 < size){
|
||||
fdpage page(0, size, is_loaded, is_modified);
|
||||
pages.push_back(page);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -391,7 +393,7 @@ bool PageList::Parse(off_t new_pos)
|
||||
// nothing to do
|
||||
return true;
|
||||
}else if(iter->offset < new_pos && new_pos < iter->next()){
|
||||
fdpage page(iter->offset, new_pos - iter->offset, iter->loaded, false);
|
||||
fdpage page(iter->offset, new_pos - iter->offset, iter->loaded, iter->modified);
|
||||
iter->bytes -= (new_pos - iter->offset);
|
||||
iter->offset = new_pos;
|
||||
pages.insert(iter, page);
|
||||
@ -1732,7 +1734,7 @@ bool FdEntity::SetAllStatus(bool is_loaded)
|
||||
return true;
|
||||
}
|
||||
|
||||
int FdEntity::Load(off_t start, off_t size, bool lock_already_held)
|
||||
int FdEntity::Load(off_t start, off_t size, bool lock_already_held, bool is_modified_flag)
|
||||
{
|
||||
AutoLock auto_lock(&fdent_lock, lock_already_held ? AutoLock::ALREADY_LOCKED : AutoLock::NONE);
|
||||
|
||||
@ -1777,7 +1779,7 @@ int FdEntity::Load(off_t start, off_t size, bool lock_already_held)
|
||||
break;
|
||||
}
|
||||
// Set loaded flag
|
||||
pagelist.SetPageLoadedStatus(iter->offset, iter->bytes, PageList::PAGE_LOADED);
|
||||
pagelist.SetPageLoadedStatus(iter->offset, iter->bytes, (is_modified_flag ? PageList::PAGE_LOAD_MODIFIED : PageList::PAGE_LOADED));
|
||||
}
|
||||
PageList::FreeList(unloaded_list);
|
||||
}
|
||||
@ -2113,7 +2115,7 @@ int FdEntity::RowFlush(const char* tpath, bool force_sync)
|
||||
return -1;
|
||||
}
|
||||
for(fdpage_list_t::const_iterator iter = dlpages.begin(); iter != dlpages.end(); ++iter){
|
||||
if(0 != (result = Load(iter->offset, iter->bytes, true))){
|
||||
if(0 != (result = Load(iter->offset, iter->bytes, /*lock_already_held=*/ true, /*is_modified_flag=*/ true))){ // set loaded and modified flag
|
||||
S3FS_PRN_ERR("failed to get parts(start=%lld, size=%lld) before uploading.", static_cast<long long int>(iter->offset), static_cast<long long int>(iter->bytes));
|
||||
return result;
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ class FdEntity
|
||||
bool SetGId(gid_t gid);
|
||||
bool SetContentType(const char* path);
|
||||
|
||||
int Load(off_t start = 0, off_t size = 0, bool lock_already_held = false); // size=0 means loading to end
|
||||
int Load(off_t start = 0, off_t size = 0, bool lock_already_held = false, bool is_modified_flag = false); // size=0 means loading to end
|
||||
int NoCacheLoadAndPost(off_t start = 0, off_t size = 0); // size=0 means loading to end
|
||||
int NoCachePreMultipartPost(void);
|
||||
int NoCacheMultipartPost(int tgfd, off_t start, off_t size);
|
||||
|
Loading…
Reference in New Issue
Block a user