Browse Source

policy_cache.hpp

getattr-cache
Antonio SJ Musumeci 9 months ago
parent
commit
5c09585801
  1. 14
      src/policy_cache.hpp

14
src/policy_cache.hpp

@ -18,32 +18,24 @@
#pragma once #pragma once
#include "policy.hpp"
#include "strvec.hpp"
#include "nonstd/optional.hpp"
#include <cstdint> #include <cstdint>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
#include <pthread.h>
class PolicyCache class PolicyCache
{ {
public: public:
PolicyCache(void);
PolicyCache();
public: public:
insert
void erase(const char *fusepath); void erase(const char *fusepath);
void cleanup(const int prob = 1); void cleanup(const int prob = 1);
void clear(void); void clear(void);
public:
int operator()(const Policy::Search &policy,
const Branches &branches,
const char *fusepath,
StrVec *paths);
private: private:
unsigned _max_size; unsigned _max_size;
std::unordered_map<std::string,std::string> _cache; std::unordered_map<std::string,std::string> _cache;

Loading…
Cancel
Save