Motr  M0
locality.c File Reference
#include "lib/trace.h"
#include "sm/sm.h"
#include "lib/chan.h"
#include "lib/arith.h"
#include "lib/errno.h"
#include "lib/thread.h"
#include "lib/memory.h"
#include "lib/processor.h"
#include "lib/locality.h"
#include "module/instance.h"
#include "fop/fom.h"
#include "reqh/reqh.h"
#include "addb2/addb2.h"
#include "addb2/identifier.h"
Include dependency graph for locality.c:

Go to the source code of this file.

Data Structures

struct  chore_local
 
struct  locality_global
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB
 
#define LOC_FOR(idx_var, loc_var)
 
#define LOC_ENDFOR   } } while (0)
 
#define CHORES_FOR(chvar)
 
#define CHORES_ENDFOR   m0_tl_endfor; } while (0)
 

Enumerations

enum  { M0_CHORE_L_MAGIC, M0_CHORE_L_HEAD_MAGIC, M0_CHORES_G_MAGIC, M0_CHORES_G_HEAD_MAGIC }
 

Functions

 M0_LOCKERS_DEFINE (M0_INTERNAL, m0_locality, lo_lockers)
 
 M0_TL_DESCR_DEFINE (chore_l, "chores-local", static, struct chore_local, lo_linkage, lo_magix, M0_CHORE_L_MAGIC, M0_CHORE_L_HEAD_MAGIC)
 
 M0_TL_DEFINE (chore_l, static, struct chore_local)
 
 M0_TL_DESCR_DEFINE (chores_g, "chores-global", static, struct m0_locality_chore, lc_linkage, lc_magix, M0_CHORES_G_MAGIC, M0_CHORES_G_HEAD_MAGIC)
 
 M0_TL_DEFINE (chores_g, static, struct m0_locality_chore)
 
static struct locality_globalloc_glob (void)
 
static int loc_nr (void)
 
static void chore_del (struct m0_locality *loc, struct m0_locality_chore *chore)
 
static int chore_add (struct m0_locality *loc, struct m0_locality_chore *chore)
 
static void chore_post (struct m0_locality *loc, struct m0_locality_chore *chore, void(*cb)(struct m0_sm_group *, struct m0_sm_ast *))
 
static int chore_add_all (struct m0_locality_chore *chore)
 
static void chore_del_all (struct m0_locality_chore *chore)
 
static void chore_add_cb (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
static void chore_del_cb (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
static int locality_data_alloc (int key)
 
static void locality_data_free (int key)
 
static void locality_data_free_all (void)
 
static int ldata_alloc (struct m0_locality *loc, int key)
 
static void ldata_free (struct m0_locality *loc, int key)
 
M0_INTERNAL void m0_locality_init (struct m0_locality *loc, struct m0_sm_group *grp, struct m0_fom_domain *dom, size_t idx)
 
M0_INTERNAL void m0_locality_fini (struct m0_locality *loc)
 
M0_INTERNAL struct m0_localitym0_locality_here (void)
 
M0_INTERNAL struct m0_localitym0_locality_get (uint64_t value)
 
M0_INTERNAL struct m0_localitym0_locality0_get (void)
 
M0_INTERNAL void m0_locality_dom_set (struct m0_fom_domain *dom)
 
M0_INTERNAL void m0_locality_dom_unset (struct m0_fom_domain *dom)
 
static void locs_ast_handler (void *__unused)
 
static int ast_thread_init (void *__unused)
 
M0_INTERNAL int m0_localities_init (void)
 
M0_INTERNAL void m0_localities_fini (void)
 
int m0_locality_chore_init (struct m0_locality_chore *chore, const struct m0_locality_chore_ops *ops, void *datum, m0_time_t interval, size_t datasize)
 
void m0_locality_chore_fini (struct m0_locality_chore *chore)
 
M0_INTERNAL void m0_locality_chores_run (struct m0_locality *locality)
 
int m0_locality_data_alloc (size_t nob, int(*ctor)(void *, void *), void(*dtor)(void *, void *), void *datum)
 
void m0_locality_data_free (int key)
 
void * m0_locality_data (int key)
 
void m0_locality_data_iterate (int key, void(*func)(int idx, void *data, void *datum), void *datum)
 
static int ctor_cb (void *arg)
 
static int dtor_cb (void *arg)
 
int m0_locality_call (struct m0_locality *loc, int(*cb)(void *), void *data)
 
M0_INTERNAL struct m0_fom_domainm0_fom_dom (void)
 

Variables

struct {
   size_t   ld_nob
 
   int(*   ld_ctor )(void *, void *)
 
   void(*   ld_dtor )(void *, void *)
 
   void *   ld_datum
 
ldata [M0_LOCALITY_LOCKERS_NR]
 

Variable Documentation

◆ ld_ctor

int(* ld_ctor) (void *, void *)

Definition at line 54 of file locality.c.

◆ ld_datum

void* ld_datum

Definition at line 56 of file locality.c.

◆ ld_dtor

void(* ld_dtor) (void *, void *)

Definition at line 55 of file locality.c.

◆ ld_nob

size_t ld_nob

Definition at line 53 of file locality.c.