7 #ifndef CVMFS_LRU_MD_H_
8 #define CVMFS_LRU_MD_H_
10 #ifndef __STDC_FORMAT_MACROS
11 #define __STDC_FORMAT_MACROS
31 return (uint32_t) *(
reinterpret_cast<const uint32_t *
>(key.
digest) + 1);
35 return MurmurHash2(&inode,
sizeof(inode), 0x07387a4f);
45 LruCache<fuse_ino_t, catalog::DirectoryEntry>(
47 perf::StatisticsTemplate(
"inode_cache", statistics))
60 bool update_lru =
true)
65 inode, result ?
"hit" :
"miss");
80 perf::StatisticsTemplate(
"path_cache", statistics))
93 bool update_lru =
true)
98 inode, found ?
"hit" :
"miss");
110 public LruCache<shash::Md5, catalog::DirectoryEntry>
114 LruCache<shash::Md5, catalog::DirectoryEntry>(
115 cache_size, shash::Md5(shash::AsciiPtr(
"!")),
hasher_md5,
116 perf::StatisticsTemplate(
"md5_path_cache", statistics))
137 bool update_lru =
true)
142 hash.
ToString().c_str(), result ?
"hit" :
"miss");
163 #endif // CVMFS_LRU_MD_H_
bool InsertNegative(const shash::Md5 &hash)
bool Forget(const shash::Md5 &hash)
bool Insert(const fuse_ino_t &inode, const catalog::DirectoryEntry &dirent)
std::string ToString(const bool with_suffix=false) const
virtual bool Insert(const Key &key, const Value &value)
bool Lookup(const shash::Md5 &hash, catalog::DirectoryEntry *dirent, bool update_lru=true)
bool Lookup(const fuse_ino_t &inode, catalog::DirectoryEntry *dirent, bool update_lru=true)
static uint32_t hasher_md5(const shash::Md5 &key)
unsigned char digest[digest_size_]
bool Lookup(const fuse_ino_t &inode, PathString *path, bool update_lru=true)
perf::Counter * n_insert_negative
catalog::DirectoryEntry dirent_negative_
void Inc(class Counter *counter)
static uint32_t hasher_inode(const fuse_ino_t &inode)
Md5PathCache(unsigned int cache_size, perf::Statistics *statistics)
virtual bool Lookup(const Key &key, Value *value, bool update_lru=true)
virtual bool Forget(const Key &key)
PathCache(unsigned int cache_size, perf::Statistics *statistics)
bool Insert(const fuse_ino_t &inode, const PathString &path)
InodeCache(unsigned int cache_size, perf::Statistics *statistics)
const char * c_str() const
bool Insert(const shash::Md5 &hash, const catalog::DirectoryEntry &dirent)
uint32_t MurmurHash2(const void *key, int len, uint32_t seed)
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)