mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-11 00:21:45 +00:00
Merge remote-tracking branch 'upstream/issue#435'
This commit is contained in:
commit
90eda81624
@ -1963,7 +1963,22 @@ FdEntity* FdManager::Open(const char* path, headers_t* pmeta, ssize_t size, time
|
|||||||
}
|
}
|
||||||
AutoLock auto_lock(&FdManager::fd_manager_lock);
|
AutoLock auto_lock(&FdManager::fd_manager_lock);
|
||||||
|
|
||||||
|
// search in mapping by key(path)
|
||||||
fdent_map_t::iterator iter = fent.find(string(path));
|
fdent_map_t::iterator iter = fent.find(string(path));
|
||||||
|
|
||||||
|
if(fent.end() == iter && !force_tmpfile && !FdManager::IsCacheDir()){
|
||||||
|
// If the cache directory is not specified, s3fs opens a temporary file
|
||||||
|
// when the file is opened.
|
||||||
|
// Then if it could not find a entity in map for the file, s3fs should
|
||||||
|
// search a entity in all which opened the temporary file.
|
||||||
|
//
|
||||||
|
for(iter = fent.begin(); iter != fent.end(); ++iter){
|
||||||
|
if((*iter).second && (*iter).second->IsOpen()){
|
||||||
|
break; // found opened fd in mapping
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FdEntity* ent;
|
FdEntity* ent;
|
||||||
if(fent.end() != iter){
|
if(fent.end() != iter){
|
||||||
// found
|
// found
|
||||||
|
Loading…
Reference in New Issue
Block a user