mirror of
https://github.com/trapexit/mergerfs.git
synced 2025-03-15 02:35:12 +08:00
remove stat'ing of files in readdir. closes #3
This commit is contained in:
parent
bbc4b594fe
commit
4c7095ccf6
@ -69,25 +69,11 @@ _readdir(const vector<string> &srcmounts,
|
|||||||
for(struct dirent *de = ::readdir(dh); de != NULL; de = ::readdir(dh))
|
for(struct dirent *de = ::readdir(dh); de != NULL; de = ::readdir(dh))
|
||||||
{
|
{
|
||||||
string d_name(de->d_name);
|
string d_name(de->d_name);
|
||||||
pair<set<string>::iterator,bool> ret;
|
|
||||||
|
|
||||||
ret = found.insert(d_name);
|
if(found.insert(d_name).second == false)
|
||||||
if(ret.second == false)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
{
|
filler(buf,de->d_name,NULL,NO_OFFSET);
|
||||||
struct stat st;
|
|
||||||
string path;
|
|
||||||
|
|
||||||
path = fs::make_path(basepath,d_name);
|
|
||||||
if(::lstat(path.c_str(),&st) == -1)
|
|
||||||
{
|
|
||||||
found.erase(ret.first);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
filler(buf,de->d_name,&st,NO_OFFSET);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
::closedir(dh);
|
::closedir(dh);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user