Motr  M0
refs.c File Reference
#include "lib/refs.h"
Include dependency graph for refs.c:

Go to the source code of this file.

Functions

void m0_ref_init (struct m0_ref *ref, int init_num, void(*release)(struct m0_ref *ref))
 
M0_INTERNAL void m0_ref_get (struct m0_ref *ref)
 
M0_INTERNAL void m0_ref_put (struct m0_ref *ref)
 
M0_INTERNAL int64_t m0_ref_read (const struct m0_ref *ref)
 

Function Documentation

◆ m0_ref_get()

M0_INTERNAL void m0_ref_get ( struct m0_ref ref)

take one reference to the object

Parameters
refpointer to m0_ref object
Returns
none

Definition at line 32 of file refs.c.

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

◆ m0_ref_init()

void m0_ref_init ( struct m0_ref ref,
int  init_num,
void(*)(struct m0_ref *ref)  release 
)

constructor for init reference counted protection

Parameters
refpointer to m0_ref object
init_numinitial references on object
releasedestructor function for the object

Definition at line 24 of file refs.c.

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

◆ m0_ref_put()

M0_INTERNAL void m0_ref_put ( struct m0_ref ref)

Release one reference from the object. If function will release last reference, destructor will called.

Parameters
refpointer to m0_ref object
Returns
none

Definition at line 38 of file refs.c.

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

◆ m0_ref_read()

M0_INTERNAL int64_t m0_ref_read ( const struct m0_ref ref)

Read the current value of the reference count from the m0_ref object

Parameters
refpointer to m0_ref object
Returns
current value of the reference count

Definition at line 44 of file refs.c.

Here is the call graph for this function: