diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2024-07-24 18:54:07 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2024-07-24 18:54:07 +0000 |
commit | 8c9b0194063411882d3bbcec80d5e5c861d37544 (patch) | |
tree | 92d6ed8a8d5e8b35958bd45ebc3aa45b5105db9a /src/include | |
parent | 8d5a23bf7fe6bda50bab13f12725f3b7c8976d29 (diff) | |
download | shibari-8c9b0194063411882d3bbcec80d5e5c861d37544.tar.xz |
Add stuff to shibari-cache
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/shibari/dcache.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/include/shibari/dcache.h b/src/include/shibari/dcache.h index 6e0d0ab..50fc44d 100644 --- a/src/include/shibari/dcache.h +++ b/src/include/shibari/dcache.h @@ -35,20 +35,21 @@ struct dcache_s avltree by_key ; avltree by_entry ; avltree by_expire ; + uint64_t max ; uint64_t size ; uint64_t motion ; } ; -#define DCACHE_ZERO { .storage = GENSETDYN_ZERO, .by_key = AVLTREE_ZERO, .by_entry = AVLTREE_ZERO, .by_expire = AVLTREE_ZERO, .size = 0, .motion = 0 } +#define DCACHE_ZERO { .storage = GENSETDYN_ZERO, .by_key = AVLTREE_ZERO, .by_entry = AVLTREE_ZERO, .by_expire = AVLTREE_ZERO, .max = 0, .size = 0, .motion = 0 } extern void dcache_init (dcache_t *, uint64_t) ; extern dcache_node_t *dcache_search (dcache_t *, char const *, uint16_t) ; -extern int dcache_add (dcache_t *, uint64_t, char const *, uint16_t, char const *, uint16_t, tain const *, tain const *) ; -#define dcache_add_g(d, max, key, keylen, data, datalen, expire) dcache_add(d, max, key, keylen, data, datalen, (expire), &STAMP) +extern int dcache_add (dcache_t *, char const *, uint16_t, char const *, uint16_t, tain const *, tain const *) ; +#define dcache_add_g(d, key, keylen, data, datalen, expire) dcache_add(d, key, keylen, data, datalen, (expire), &STAMP) extern void dcache_clean_expired (dcache_t *, tain const *) ; #define dcache_clean_expired_g(d) dcache_clean_expired((d), &STAMP) extern void dcache_free (dcache_t *) ; extern int dcache_save (dcache_t const *, char const *) ; -extern int dcache_load (dcache_t *, uint64_t, char const *) ; +extern int dcache_load (dcache_t *, char const *) ; #endif |