Motr  M0
null.c File Reference
#include "stob/null.h"
#include "lib/errno.h"
#include "lib/memory.h"
#include "lib/tlist.h"
#include "lib/mutex.h"
#include "lib/misc.h"
#include "lib/string.h"
#include "fid/fid.h"
#include "stob/type.h"
#include "stob/domain.h"
#include "stob/stob.h"
#include "lib/trace.h"
Include dependency graph for null.c:

Go to the source code of this file.

Data Structures

struct  stob_null
 
struct  stob_null_domain
 
struct  stob_null_lists
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_STOB
 

Enumerations

enum  { STOB_TYPE_NULL = 0xFF }
 

Functions

 M0_TL_DESCR_DEFINE (stob_null_stobs, "list of null stobs in the domain", static, struct stob_null, sn_link, sn_magic, M0_STOB_NULL_MAGIC, M0_STOB_NULL_HEAD_MAGIC)
 
 M0_TL_DEFINE (stob_null_stobs, static, struct stob_null)
 
 M0_TL_DESCR_DEFINE (stob_null_domains, "list of null stob domains", static, struct stob_null_domain, snd_link, snd_magic, M0_STOB_DOM_NULL_MAGIC, M0_STOB_DOM_NULL_HEAD_MAGIC)
 
 M0_TL_DEFINE (stob_null_domains, static, struct stob_null_domain)
 
static void stob_null_type_register (struct m0_stob_type *type)
 
static void stob_null_type_deregister (struct m0_stob_type *type)
 
static struct stob_null_domainstob_null_domain_find (struct stob_null_lists *snl, const char *path, bool take_lock)
 
static int stob_null_domain_add (struct stob_null_domain *snd, struct stob_null_lists *snl)
 
static void stob_null_domain_del (struct stob_null_domain *snd, struct stob_null_lists *snl)
 
static struct stob_null_domainstob_null_domain_container (struct m0_stob_domain *dom)
 
static int stob_null_domain_cfg_init_parse (const char *str_cfg_init, void **cfg_init)
 
static void stob_null_domain_cfg_init_free (void *cfg_init)
 
static int stob_null_domain_cfg_create_parse (const char *str_cfg_create, void **cfg_create)
 
static void stob_null_domain_cfg_create_free (void *cfg_create)
 
static int stob_null_domain_init (struct m0_stob_type *type, const char *location_data, void *cfg_init, struct m0_stob_domain **out)
 
static void stob_null_domain_fini (struct m0_stob_domain *dom)
 
static int stob_null_domain_create (struct m0_stob_type *type, const char *location_data, uint64_t dom_key, void *cfg_create)
 
static int stob_null_domain_destroy (struct m0_stob_type *type, const char *location_data)
 
static struct m0_stobstob_null_alloc (struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
 
static void stob_null_free (struct m0_stob_domain *dom, struct m0_stob *stob)
 
static int stob_null_cfg_parse (const char *str_cfg_create, void **cfg_create)
 
static void stob_null_cfg_free (void *cfg_create)
 
static struct stob_nullstob_null_find (struct stob_null_domain *snd, const struct m0_fid *stob_fid, bool take_lock)
 
static int stob_null_add (struct stob_null *sn, struct stob_null_domain *snd)
 
static void stob_null_del (struct stob_null *sn, struct stob_null_domain *snd)
 
static int stob_null_init (struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
 
static void stob_null_fini (struct m0_stob *stob)
 
static void stob_null_create_credit (struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
 
static int stob_null_create (struct m0_stob *stob, struct m0_stob_domain *dom, struct m0_dtx *dtx, const struct m0_fid *stob_fid, void *cfg)
 
static void stob_null_destroy_credit (struct m0_stob *stob, struct m0_be_tx_credit *accum)
 
static int stob_null_destroy (struct m0_stob *stob, struct m0_dtx *dtx)
 
static int stob_null_punch (struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
 
static uint32_t stob_null_block_shift (struct m0_stob *stob)
 

Variables

const struct m0_stob_type m0_stob_null_type
 
static struct m0_stob_type_ops stob_null_type_ops
 
static struct m0_stob_domain_ops stob_null_domain_ops
 
static struct m0_stob_ops stob_null_ops
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_STOB

Definition at line 38 of file null.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Null stob doesn't have persistent storage so we want to keep track of all created domains/stobs in RAM.

Enumerator
STOB_TYPE_NULL 

Definition at line 46 of file null.c.

Function Documentation

◆ M0_TL_DEFINE() [1/2]

M0_TL_DEFINE ( stob_null_stobs  ,
static  ,
struct stob_null   
)

◆ M0_TL_DEFINE() [2/2]

M0_TL_DEFINE ( stob_null_domains  ,
static  ,
struct stob_null_domain   
)

◆ M0_TL_DESCR_DEFINE() [1/2]

M0_TL_DESCR_DEFINE ( stob_null_stobs  ,
"list of null stobs in the domain ,
static  ,
struct stob_null  ,
sn_link  ,
sn_magic  ,
M0_STOB_NULL_MAGIC  ,
M0_STOB_NULL_HEAD_MAGIC   
)

◆ M0_TL_DESCR_DEFINE() [2/2]

M0_TL_DESCR_DEFINE ( stob_null_domains  ,
"list of null stob domains"  ,
static  ,
struct stob_null_domain  ,
snd_link  ,
snd_magic  ,
M0_STOB_DOM_NULL_MAGIC  ,
M0_STOB_DOM_NULL_HEAD_MAGIC   
)

◆ stob_null_add()

static int stob_null_add ( struct stob_null sn,
struct stob_null_domain snd 
)
static

Definition at line 301 of file null.c.

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

◆ stob_null_alloc()

static struct m0_stob* stob_null_alloc ( struct m0_stob_domain dom,
const struct m0_fid stob_fid 
)
static

Definition at line 264 of file null.c.

Here is the call graph for this function:

◆ stob_null_block_shift()

static uint32_t stob_null_block_shift ( struct m0_stob stob)
static

Definition at line 393 of file null.c.

◆ stob_null_cfg_free()

static void stob_null_cfg_free ( void *  cfg_create)
static

Definition at line 282 of file null.c.

◆ stob_null_cfg_parse()

static int stob_null_cfg_parse ( const char *  str_cfg_create,
void **  cfg_create 
)
static

Definition at line 276 of file null.c.

◆ stob_null_create()

static int stob_null_create ( struct m0_stob stob,
struct m0_stob_domain dom,
struct m0_dtx dtx,
const struct m0_fid stob_fid,
void *  cfg 
)
static

Definition at line 347 of file null.c.

Here is the call graph for this function:

◆ stob_null_create_credit()

static void stob_null_create_credit ( struct m0_stob_domain dom,
struct m0_be_tx_credit accum 
)
static

Definition at line 342 of file null.c.

◆ stob_null_del()

static void stob_null_del ( struct stob_null sn,
struct stob_null_domain snd 
)
static

Definition at line 315 of file null.c.

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

◆ stob_null_destroy()

static int stob_null_destroy ( struct m0_stob stob,
struct m0_dtx dtx 
)
static

Definition at line 377 of file null.c.

Here is the call graph for this function:

◆ stob_null_destroy_credit()

static void stob_null_destroy_credit ( struct m0_stob stob,
struct m0_be_tx_credit accum 
)
static

Definition at line 372 of file null.c.

◆ stob_null_domain_add()

static int stob_null_domain_add ( struct stob_null_domain snd,
struct stob_null_lists snl 
)
static

Definition at line 130 of file null.c.

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

◆ stob_null_domain_cfg_create_free()

static void stob_null_domain_cfg_create_free ( void *  cfg_create)
static

Definition at line 175 of file null.c.

◆ stob_null_domain_cfg_create_parse()

static int stob_null_domain_cfg_create_parse ( const char *  str_cfg_create,
void **  cfg_create 
)
static

Definition at line 169 of file null.c.

◆ stob_null_domain_cfg_init_free()

static void stob_null_domain_cfg_init_free ( void *  cfg_init)
static

Definition at line 165 of file null.c.

◆ stob_null_domain_cfg_init_parse()

static int stob_null_domain_cfg_init_parse ( const char *  str_cfg_init,
void **  cfg_init 
)
static

Definition at line 159 of file null.c.

◆ stob_null_domain_container()

static struct stob_null_domain* stob_null_domain_container ( struct m0_stob_domain dom)
static

Definition at line 154 of file null.c.

Here is the caller graph for this function:

◆ stob_null_domain_create()

static int stob_null_domain_create ( struct m0_stob_type type,
const char *  location_data,
uint64_t  dom_key,
void *  cfg_create 
)
static

Definition at line 210 of file null.c.

Here is the call graph for this function:

◆ stob_null_domain_del()

static void stob_null_domain_del ( struct stob_null_domain snd,
struct stob_null_lists snl 
)
static

Definition at line 145 of file null.c.

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

◆ stob_null_domain_destroy()

static int stob_null_domain_destroy ( struct m0_stob_type type,
const char *  location_data 
)
static

Definition at line 247 of file null.c.

Here is the call graph for this function:

◆ stob_null_domain_find()

static struct stob_null_domain* stob_null_domain_find ( struct stob_null_lists snl,
const char *  path,
bool  take_lock 
)
static

Definition at line 115 of file null.c.

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

◆ stob_null_domain_fini()

static void stob_null_domain_fini ( struct m0_stob_domain dom)
static

Definition at line 206 of file null.c.

◆ stob_null_domain_init()

static int stob_null_domain_init ( struct m0_stob_type type,
const char *  location_data,
void *  cfg_init,
struct m0_stob_domain **  out 
)
static

Definition at line 179 of file null.c.

Here is the call graph for this function:

◆ stob_null_find()

static struct stob_null* stob_null_find ( struct stob_null_domain snd,
const struct m0_fid stob_fid,
bool  take_lock 
)
static

Definition at line 286 of file null.c.

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

◆ stob_null_fini()

static void stob_null_fini ( struct m0_stob stob)
static

Definition at line 338 of file null.c.

◆ stob_null_free()

static void stob_null_free ( struct m0_stob_domain dom,
struct m0_stob stob 
)
static

Definition at line 270 of file null.c.

Here is the call graph for this function:

◆ stob_null_init()

static int stob_null_init ( struct m0_stob stob,
struct m0_stob_domain dom,
const struct m0_fid stob_fid 
)
static

Definition at line 322 of file null.c.

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

◆ stob_null_punch()

static int stob_null_punch ( struct m0_stob stob,
struct m0_indexvec range,
struct m0_dtx dtx 
)
static

Definition at line 386 of file null.c.

◆ stob_null_type_deregister()

static void stob_null_type_deregister ( struct m0_stob_type type)
static

Definition at line 105 of file null.c.

Here is the call graph for this function:

◆ stob_null_type_register()

static void stob_null_type_register ( struct m0_stob_type type)
static

Definition at line 93 of file null.c.

Here is the call graph for this function:

Variable Documentation

◆ stob_null_domain_ops

static struct m0_stob_domain_ops stob_null_domain_ops
static
Initial value:
= {
.sdo_fini = &stob_null_domain_fini,
.sdo_stob_alloc = &stob_null_alloc,
.sdo_stob_free = &stob_null_free,
.sdo_stob_cfg_parse = &stob_null_cfg_parse,
.sdo_stob_cfg_free = &stob_null_cfg_free,
.sdo_stob_init = &stob_null_init,
.sdo_stob_create_credit = &stob_null_create_credit,
.sdo_stob_create = &stob_null_create,
}
static void stob_null_free(struct m0_stob_domain *dom, struct m0_stob *stob)
Definition: null.c:270
static int stob_null_create(struct m0_stob *stob, struct m0_stob_domain *dom, struct m0_dtx *dtx, const struct m0_fid *stob_fid, void *cfg)
Definition: null.c:347
static void stob_null_create_credit(struct m0_stob_domain *dom, struct m0_be_tx_credit *accum)
Definition: null.c:342
static struct m0_stob * stob_null_alloc(struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
Definition: null.c:264
static void stob_null_cfg_free(void *cfg_create)
Definition: null.c:282
static void stob_null_domain_fini(struct m0_stob_domain *dom)
Definition: null.c:206
static int stob_null_init(struct m0_stob *stob, struct m0_stob_domain *dom, const struct m0_fid *stob_fid)
Definition: null.c:322
static int stob_null_cfg_parse(const char *str_cfg_create, void **cfg_create)
Definition: null.c:276

Definition at line 90 of file null.c.

◆ stob_null_ops

static struct m0_stob_ops stob_null_ops
static
Initial value:
= {
.sop_fini = &stob_null_fini,
.sop_destroy_credit = &stob_null_destroy_credit,
.sop_destroy = &stob_null_destroy,
.sop_punch = &stob_null_punch,
.sop_block_shift = &stob_null_block_shift,
}
static uint32_t stob_null_block_shift(struct m0_stob *stob)
Definition: null.c:393
static int stob_null_destroy(struct m0_stob *stob, struct m0_dtx *dtx)
Definition: null.c:377
static void stob_null_destroy_credit(struct m0_stob *stob, struct m0_be_tx_credit *accum)
Definition: null.c:372
static void stob_null_fini(struct m0_stob *stob)
Definition: null.c:338
static int stob_null_punch(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
Definition: null.c:386

Definition at line 91 of file null.c.

◆ stob_null_type_ops

static struct m0_stob_type_ops stob_null_type_ops
static
Initial value:
= {
.sto_register = &stob_null_type_register,
.sto_deregister = &stob_null_type_deregister,
.sto_domain_cfg_init_parse = &stob_null_domain_cfg_init_parse,
.sto_domain_cfg_init_free = &stob_null_domain_cfg_init_free,
.sto_domain_cfg_create_parse = &stob_null_domain_cfg_create_parse,
.sto_domain_cfg_create_free = &stob_null_domain_cfg_create_free,
.sto_domain_init = &stob_null_domain_init,
.sto_domain_create = &stob_null_domain_create,
.sto_domain_destroy = &stob_null_domain_destroy,
}
static int stob_null_domain_destroy(struct m0_stob_type *type, const char *location_data)
Definition: null.c:247
static int stob_null_domain_init(struct m0_stob_type *type, const char *location_data, void *cfg_init, struct m0_stob_domain **out)
Definition: null.c:179
static int stob_null_domain_cfg_create_parse(const char *str_cfg_create, void **cfg_create)
Definition: null.c:169
static void stob_null_type_register(struct m0_stob_type *type)
Definition: null.c:93
static void stob_null_type_deregister(struct m0_stob_type *type)
Definition: null.c:105
static void stob_null_domain_cfg_init_free(void *cfg_init)
Definition: null.c:165
static int stob_null_domain_cfg_init_parse(const char *str_cfg_init, void **cfg_init)
Definition: null.c:159
static int stob_null_domain_create(struct m0_stob_type *type, const char *location_data, uint64_t dom_key, void *cfg_create)
Definition: null.c:210
static void stob_null_domain_cfg_create_free(void *cfg_create)
Definition: null.c:175

Definition at line 89 of file null.c.