Revision b4832a42 xseg/xtypes/xcache.h
b/xseg/xtypes/xcache.h | ||
---|---|---|
19 | 19 |
#define NoEntry (xcache_handler)Noneidx |
20 | 20 |
|
21 | 21 |
/* |
22 |
* Called with out cache lock held: |
|
23 |
* |
|
22 | 24 |
* on_init: called on cache entry initialization. |
23 |
* Should return negative on error to abort cache entry initialization. |
|
25 |
* Should return negative on error to abort cache entry |
|
26 |
* initialization. |
|
27 |
* |
|
24 | 28 |
* on_put: called when the last reference to the cache entry is put |
25 | 29 |
* |
30 |
* on_evict: called when a cache entry is evicted. It is called with the old |
|
31 |
* cache entry that gets evicted and the new cache entry that |
|
32 |
* trigger the eviction as arguments. |
|
33 |
* Return value interpretation: |
|
34 |
* < 0 : Failure. |
|
35 |
* = 0 : Success. Finished with the old cache entry. |
|
36 |
* > 0 : Success. Pending actions on the old cache entry. |
|
37 |
* |
|
26 | 38 |
* on_node_init: called on initial node preparation. |
27 | 39 |
* Must return NULL on error, to abort cache initialization. |
28 | 40 |
*/ |
29 | 41 |
struct xcache_ops { |
30 | 42 |
int (*on_init)(void *cache_data, void *user_data); |
43 |
int (*on_evict)(void *cache_data, void *evicted_user_data, void *user_data); |
|
31 | 44 |
void (*on_put)(void *cache_data, void *user_data); |
32 | 45 |
void *(*on_node_init)(void *cache_data); |
33 | 46 |
}; |
Also available in: Unified diff