Strictly speaking, WvPam is not a stream. So move wvpam.cc to utils.
[wvapps.git] / funfs / cachefsicache.h
blob6c8ff52b9c54293f46ae97045b557824325e9101
1 #ifndef __CACHEFSCACHE_H
2 #define __CACHEFSCACHE_H
4 #include "wvmrucache.h"
5 #include "cachefsinode.h"
7 #include <uniconf.h>
10 #define INODE_MRU_CACHE 5000
12 class ICache : protected WvMruCache<WvString, INode>
14 typedef WvMruCache<WvString, INode> MyMRU;
15 friend class INode;
16 public:
17 ICache(UniConf &_cfg) : MyMRU(INODE_MRU_CACHE), cfg(_cfg) {};
19 bool create_inode(WvStringParm path, unsigned char mode)
20 { return maybe_get_inode(path, mode); }
21 bool maybe_get_attr(WvString path, struct fuse_attr *attr);
22 bool maybe_get_link(WvString path, char *buf, size_t size);
23 bool maybe_get_children(WvString path, WvFuseDirCb &cb);
25 void set_attr(WvStringParm path, struct fuse_attr *attr);
26 void set_link(WvStringParm path, char *buf);
27 void set_children(WvStringParm path);
29 protected:
30 INode *maybe_get_inode(WvStringParm path, unsigned char mode = 0);
31 unsigned char maybe_get_mode(WvString path);
33 UniConf cfg;
36 #endif