Browse Source

fuse_getattr.cpp

getattr-cache
Antonio SJ Musumeci 9 months ago
parent
commit
eaaee359c3
  1. 10
      src/fuse_getattr.cpp

10
src/fuse_getattr.cpp

@ -140,6 +140,8 @@ namespace l
StrVec basepaths; StrVec basepaths;
thread_local static std::unordered_map<std::string,std::string> cache; thread_local static std::unordered_map<std::string,std::string> cache;
for(int c = 0; c < 2; c++)
{
auto i = cache.find(fusepath_); auto i = cache.find(fusepath_);
if(i == cache.end()) if(i == cache.end())
{ {
@ -154,12 +156,16 @@ namespace l
fullpath = fs::path::make(i->second,fusepath_); fullpath = fs::path::make(i->second,fusepath_);
rv = l::getattr(fullpath,followsymlinks_,st_); rv = l::getattr(fullpath,followsymlinks_,st_);
if(rv == -1)
if((rv == -1) && (errno == ENOENT))
{ {
cache.erase(fusepath_); cache.erase(fusepath_);
return -errno;
continue;
}
} }
if(rv == -1)
return -errno;
if(symlinkify_ && symlinkify::can_be_symlink(*st_,symlinkify_timeout_)) if(symlinkify_ && symlinkify::can_be_symlink(*st_,symlinkify_timeout_))
symlinkify::convert(fullpath,st_); symlinkify::convert(fullpath,st_);

Loading…
Cancel
Save