Motr  M0
coroutine2.c File Reference
#include "lib/trace.h"
#include "lib/coroutine.h"
#include "lib/string.h"
#include "ut/ut.h"
#include "be/op.h"
#include "reqh/reqh.h"
#include "fop/fom.h"
#include "fop/fom_generic.h"
#include "fop/fom_simple.h"
#include "fop/fom_long_lock.h"
Include dependency graph for coroutine2.c:

Go to the source code of this file.

Data Structures

struct  test_tree
 

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT
 
#define _S(name, flags, allowed)
 
#define F   M0_CO_FRAME_DATA
 
#define LR   M0_FOM_LONG_LOCK_RETURN
 

Enumerations

enum  coroutine2_state { C2_INIT = M0_FOM_PHASE_INIT, C2_FINISH = M0_FOM_PHASE_FINISH, C2_NR }
 

Functions

struct m0_reqhm0_ut__reqh_init (void)
 
void m0_ut__reqh_fini (void)
 
static void crud (struct m0_fom *fom, struct test_tree *tree, int k, int v)
 
static void insert (struct m0_fom *fom, struct test_tree *tree, int k, int v)
 
static void delete (struct m0_fom *fom, struct test_tree *tree, int k)
 
static struct m0_co_contextCO (struct m0_fom *fom)
 
static struct m0_co_opOP (struct m0_fom *fom)
 
static void wait_for_coroutine_fom (void)
 
static int coroutine_fom_tick (struct m0_fom *fom, int *x, int *__unused)
 
static void test_run (void)
 
void m0_test_coroutine2 (void)
 

Variables

static struct m0_sm_state_descr coroutine2_states [C2_NR]
 
static struct m0_sm_conf coroutine2_conf
 
static struct m0_semaphore ready
 
static struct m0_semaphore insert1
 
static struct m0_semaphore insert2
 
static struct m0_semaphore delete1
 
static struct m0_semaphore delete2
 
static struct m0_fom_simple fom_simple
 
static struct m0_co_context fom_context = {}
 
static struct m0_co_op fom_op = {}
 
static struct test_tree fom_tree = {}
 
static struct m0_long_lock fom_lock = {}
 

Macro Definition Documentation

◆ _S

#define _S (   name,
  flags,
  allowed 
)
Value:
[name] = { \
.sd_flags = flags, \
.sd_name = #name, \
.sd_allowed = allowed \
}
int const char const void size_t int flags
Definition: dir.c:328
const char * name
Definition: trace.c:110

◆ F

#define F   M0_CO_FRAME_DATA

Definition at line 87 of file coroutine2.c.

◆ LR

#define LR   M0_FOM_LONG_LOCK_RETURN

Definition at line 88 of file coroutine2.c.

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_UT

Definition at line 22 of file coroutine2.c.

Enumeration Type Documentation

◆ coroutine2_state

Enumerator
C2_INIT 
C2_FINISH 
C2_NR 

Definition at line 38 of file coroutine2.c.

Function Documentation

◆ CO()

static struct m0_co_context* CO ( struct m0_fom fom)
static

Definition at line 90 of file coroutine2.c.

Here is the caller graph for this function:

◆ coroutine_fom_tick()

static int coroutine_fom_tick ( struct m0_fom fom,
int *  x,
int *  __unused 
)
static

Definition at line 119 of file coroutine2.c.

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

◆ crud()

static void crud ( struct m0_fom fom,
struct test_tree tree,
int  k,
int  v 
)
static

Definition at line 140 of file coroutine2.c.

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

◆ delete()

static void delete ( struct m0_fom fom,
struct test_tree tree,
int  k 
)
static

Definition at line 192 of file coroutine2.c.

Here is the call graph for this function:

◆ insert()

static void insert ( struct m0_fom fom,
struct test_tree tree,
int  k,
int  v 
)
static

Definition at line 172 of file coroutine2.c.

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

◆ m0_test_coroutine2()

void m0_test_coroutine2 ( void  )

Definition at line 224 of file coroutine2.c.

Here is the call graph for this function:

◆ m0_ut__reqh_fini()

void m0_ut__reqh_fini ( void  )

Definition at line 84 of file locality.c.

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

◆ m0_ut__reqh_init()

struct m0_reqh* m0_ut__reqh_init ( void  )

Definition at line 67 of file locality.c.

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

◆ OP()

static struct m0_co_op* OP ( struct m0_fom fom)
static

Definition at line 96 of file coroutine2.c.

Here is the caller graph for this function:

◆ test_run()

static void test_run ( void  )
static

Definition at line 212 of file coroutine2.c.

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

◆ wait_for_coroutine_fom()

static void wait_for_coroutine_fom ( void  )
static

Definition at line 102 of file coroutine2.c.

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

Variable Documentation

◆ coroutine2_conf

struct m0_sm_conf coroutine2_conf
static
Initial value:
= {
.scf_name = "coroutine2_states",
.scf_nr_states = ARRAY_SIZE(coroutine2_states),
.scf_state = coroutine2_states,
}
static struct m0_sm_state_descr coroutine2_states[C2_NR]
Definition: coroutine2.c:44
#define ARRAY_SIZE(a)
Definition: misc.h:45

Definition at line 57 of file coroutine2.c.

◆ coroutine2_states

struct m0_sm_state_descr coroutine2_states[C2_NR]
static
Initial value:
= {
#define _S(name, flags, allowed)
}
#define M0_BITS(...)
Definition: misc.h:236
#define _S(name, flags, allowed)

Definition at line 44 of file coroutine2.c.

◆ delete1

struct m0_semaphore delete1
static

Definition at line 75 of file coroutine2.c.

◆ delete2

struct m0_semaphore delete2
static

Definition at line 76 of file coroutine2.c.

◆ fom_context

struct m0_co_context fom_context = {}
static

Definition at line 79 of file coroutine2.c.

◆ fom_lock

struct m0_long_lock fom_lock = {}
static

Definition at line 84 of file coroutine2.c.

◆ fom_op

struct m0_co_op fom_op = {}
static

Definition at line 80 of file coroutine2.c.

◆ fom_simple

struct m0_fom_simple fom_simple
static

Definition at line 78 of file coroutine2.c.

◆ fom_tree

struct test_tree fom_tree = {}
static

Definition at line 83 of file coroutine2.c.

◆ insert1

struct m0_semaphore insert1
static

Definition at line 73 of file coroutine2.c.

◆ insert2

struct m0_semaphore insert2
static

Definition at line 74 of file coroutine2.c.

◆ ready

struct m0_semaphore ready
static

Definition at line 72 of file coroutine2.c.