Motr  M0
Stobcache

Functions

 M0_TL_DESCR_DEFINE (stob_cache, "cached stobs", static, struct m0_stob, so_cache_linkage, so_cache_magic, M0_STOB_CACHE_MAGIC, M0_STOB_CACHE_HEAD_MAGIC)
 
 M0_TL_DEFINE (stob_cache, static, struct m0_stob)
 
M0_INTERNAL int m0_stob_cache_init (struct m0_stob_cache *cache, uint64_t idle_size, m0_stob_cache_eviction_cb_t eviction_cb)
 
M0_INTERNAL void m0_stob_cache_fini (struct m0_stob_cache *cache)
 
M0_INTERNAL bool m0_stob_cache__invariant (const struct m0_stob_cache *cache)
 
static void stob_cache_evict (struct m0_stob_cache *cache, struct m0_stob *stob)
 
static void stob_cache_idle_del (struct m0_stob_cache *cache, struct m0_stob *stob)
 
static void stob_cache_idle_moveto (struct m0_stob_cache *cache, struct m0_stob *stob)
 
M0_INTERNAL void m0_stob_cache_add (struct m0_stob_cache *cache, struct m0_stob *stob)
 
M0_INTERNAL void m0_stob_cache_idle (struct m0_stob_cache *cache, struct m0_stob *stob)
 
M0_INTERNAL struct m0_stobm0_stob_cache_lookup (struct m0_stob_cache *cache, const struct m0_fid *stob_fid)
 
M0_INTERNAL void m0_stob_cache_purge (struct m0_stob_cache *cache, int nr)
 
M0_INTERNAL void m0_stob_cache_lock (struct m0_stob_cache *cache)
 
M0_INTERNAL void m0_stob_cache_unlock (struct m0_stob_cache *cache)
 
M0_INTERNAL bool m0_stob_cache_is_locked (const struct m0_stob_cache *cache)
 
M0_INTERNAL bool m0_stob_cache_is_not_locked (const struct m0_stob_cache *cache)
 
M0_INTERNAL void m0_stob_cache__print (struct m0_stob_cache *cache)
 

Detailed Description

Function Documentation

◆ m0_stob_cache__invariant()

M0_INTERNAL bool m0_stob_cache__invariant ( const struct m0_stob_cache cache)

Stob cache invariant.

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 81 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache__print()

M0_INTERNAL void m0_stob_cache__print ( struct m0_stob_cache cache)

Definition at line 205 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_add()

M0_INTERNAL void m0_stob_cache_add ( struct m0_stob_cache cache,
struct m0_stob stob 
)

Adds stob to the stob cache. Stob should be deleted from the stob cache using m0_stob_cache_idle().

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 120 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_fini()

M0_INTERNAL void m0_stob_cache_fini ( struct m0_stob_cache cache)

Definition at line 61 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_idle()

M0_INTERNAL void m0_stob_cache_idle ( struct m0_stob_cache cache,
struct m0_stob stob 
)

Deletes item from the stob cache.

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 129 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_init()

M0_INTERNAL int m0_stob_cache_init ( struct m0_stob_cache cache,
uint64_t  idle_size,
m0_stob_cache_eviction_cb_t  eviction_cb 
)

Initialises stob cache.

Parameters
cachestob cache
idle_sizeidle list maximum size

Definition at line 42 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_is_locked()

M0_INTERNAL bool m0_stob_cache_is_locked ( const struct m0_stob_cache cache)

Definition at line 195 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_is_not_locked()

M0_INTERNAL bool m0_stob_cache_is_not_locked ( const struct m0_stob_cache cache)

Definition at line 200 of file cache.c.

Here is the call graph for this function:

◆ m0_stob_cache_lock()

M0_INTERNAL void m0_stob_cache_lock ( struct m0_stob_cache cache)

Definition at line 185 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_lookup()

M0_INTERNAL struct m0_stob* m0_stob_cache_lookup ( struct m0_stob_cache cache,
const struct m0_fid stob_fid 
)

Finds item in the stob cache. Stob found should be deleted from the stob cache using m0_stob_cache_idle().

Precondition
m0_stob_cache_is_locked(cache)
Postcondition
m0_stob_cache_is_locked(cache)

Definition at line 137 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_purge()

M0_INTERNAL void m0_stob_cache_purge ( struct m0_stob_cache cache,
int  nr 
)

Purges at most nr items from the idle stob cache.

Precondition
m0_stob_cache_is_not_locked(cache)
Postcondition
m0_stob_cache_is_not_locked(cache)

Definition at line 165 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_stob_cache_unlock()

M0_INTERNAL void m0_stob_cache_unlock ( struct m0_stob_cache cache)

Definition at line 190 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ M0_TL_DEFINE()

M0_TL_DEFINE ( stob_cache  ,
static  ,
struct m0_stob   
)

◆ M0_TL_DESCR_DEFINE()

M0_TL_DESCR_DEFINE ( stob_cache  ,
"cached stobs"  ,
static  ,
struct m0_stob  ,
so_cache_linkage  ,
so_cache_magic  ,
M0_STOB_CACHE_MAGIC  ,
M0_STOB_CACHE_HEAD_MAGIC   
)

◆ stob_cache_evict()

static void stob_cache_evict ( struct m0_stob_cache cache,
struct m0_stob stob 
)
static

Definition at line 90 of file cache.c.

Here is the caller graph for this function:

◆ stob_cache_idle_del()

static void stob_cache_idle_del ( struct m0_stob_cache cache,
struct m0_stob stob 
)
static

Definition at line 97 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stob_cache_idle_moveto()

static void stob_cache_idle_moveto ( struct m0_stob_cache cache,
struct m0_stob stob 
)
static

Definition at line 106 of file cache.c.

Here is the call graph for this function:
Here is the caller graph for this function: