so long stat_cache

git-svn-id: http://s3fs.googlecode.com/svn/trunk@65 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
rrizun 2008-02-18 21:39:12 +00:00
parent 24ba1bb356
commit 43279cbdaa

View File

@ -200,11 +200,6 @@ static string AWSSecretAccessKey;
static const string host = "http://s3.amazonaws.com";
static mode_t root_mode = 0;
// key=path
typedef map<string, struct stat> stat_cache_t;
static stat_cache_t stat_cache;
static pthread_mutex_t stat_cache_lock;
static const char hexAlphabet[] = "0123456789ABCDEF";
/**
@ -513,16 +508,6 @@ s3fs_getattr(const char *path, struct stat *stbuf) {
return 0;
}
{
auto_lock lock(stat_cache_lock);
stat_cache_t::iterator iter = stat_cache.find(path);
if (iter != stat_cache.end()) {
*stbuf = (*iter).second;
stat_cache.erase(path);
return 0;
}
}
string resource = urlEncode("/"+bucket + path);
string url = host + resource;
@ -945,7 +930,6 @@ s3fs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset,
static void*
s3fs_init(struct fuse_conn_info *conn) {
printf("init\n");
pthread_mutex_init(&stat_cache_lock, NULL);
pthread_mutex_init(&curl_handles_lock, NULL);
pthread_mutex_init(&s3fs_descriptors_lock, NULL);
return 0;
@ -954,7 +938,6 @@ s3fs_init(struct fuse_conn_info *conn) {
static void
s3fs_destroy(void*) {
printf("destroy\n");
pthread_mutex_destroy(&stat_cache_lock);
pthread_mutex_destroy(&curl_handles_lock);
pthread_mutex_destroy(&s3fs_descriptors_lock);
}