1 #ifndef __CACHEFSCACHE_H
2 #define __CACHEFSCACHE_H
4 #include "wvmrucache.h"
5 #include "cachefsinode.h"
10 #define INODE_MRU_CACHE 5000
12 class ICache
: protected WvMruCache
<WvString
, INode
>
14 typedef WvMruCache
<WvString
, INode
> MyMRU
;
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
);
30 INode
*maybe_get_inode(WvStringParm path
, unsigned char mode
= 0);
31 unsigned char maybe_get_mode(WvString path
);