From a35cdc73b75dbe43e794dac969e8f23814138c06 Mon Sep 17 00:00:00 2001 From: "ggtakec@gmail.com" Date: Sat, 30 Mar 2013 14:03:06 +0000 Subject: [PATCH] Summary of Changes(1.64 -> 1.65) 1) Fixed a bug(r397) After deleting directory object, s3fs could not make directory which was same name. It was a bug about cache logic for compatibility other S3 client. 2) Cleaned up source codes(r396) No changes for logic, only changes layout of functions and valiables between a file to a file. Adds s3fs_util.cpp/s3fs_util.h/common.h git-svn-id: http://s3fs.googlecode.com/svn/trunk@397 df820570-a93a-0410-bd06-b72b767a4274 --- configure.ac | 2 +- src/cache.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index b5758fa..14141d6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(s3fs, 1.64) +AC_INIT(s3fs, 1.65) AC_CANONICAL_SYSTEM diff --git a/src/cache.cpp b/src/cache.cpp index acb2e25..6b55da9 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -124,6 +125,15 @@ void delete_stat_cache_entry(const char *path) if(iter != stat_cache.end()){ stat_cache.erase(iter); } + if(0 < strlen(path) && '/' != path[strlen(path) - 1]){ + // If there is "path/" cache, delete it. + string strpath = path; + strpath += "/"; + iter = stat_cache.find(strpath.c_str()); + if(iter != stat_cache.end()){ + stat_cache.erase(iter); + } + } pthread_mutex_unlock(&stat_cache_lock); }