Resolves issue #156

s3fs_readdir() now looks at stat_cache


git-svn-id: http://s3fs.googlecode.com/svn/trunk@312 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
mooredan@suncup.net 2011-02-11 03:52:31 +00:00
parent c8d5b35f8f
commit 2c0456680e
2 changed files with 14 additions and 2 deletions

View File

@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(s3fs, 1.38)
AC_INIT(s3fs, 1.39)
AC_CANONICAL_SYSTEM

View File

@ -3276,7 +3276,19 @@ static int s3fs_readdir(
}
}
if (Key.size() > 0) {
bool in_stat_cache = false;
pthread_mutex_lock(&stat_cache_lock);
stat_cache_t::iterator iter = stat_cache.find("/" + Key);
if(iter != stat_cache.end()) {
// in stat cache, skip http request
if(filler(buf, mybasename(Key).c_str(), 0, 0))
break;
in_stat_cache = true;
}
pthread_mutex_unlock(&stat_cache_lock);
if (Key.size() > 0 && !in_stat_cache) {
if (filler(buf, mybasename(Key).c_str(), 0, 0)) {
break;
}