Motr  M0
fom_long_lock.c File Reference
#include "lib/trace.h"
#include "fop/fom_long_lock.h"
#include "lib/arith.h"
#include "lib/misc.h"
#include "lib/bob.h"
#include "motr/magic.h"
#include "addb2/identifier.h"
#include "addb2/addb2.h"
Include dependency graph for fom_long_lock.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_FOP
 

Functions

 M0_TL_DESCR_DEFINE (m0_lll, "list of lock-links in longlock", M0_INTERNAL, struct m0_long_lock_link, lll_lock_linkage, lll_magix, M0_FOM_LL_LINK_MAGIC, M0_FOM_LL_LINK_MAGIC)
 
 M0_TL_DEFINE (m0_lll, M0_INTERNAL, struct m0_long_lock_link)
 
 M0_BOB_DEFINE (M0_INTERNAL, &long_lock_bob, m0_long_lock)
 
 M0_BOB_DEFINE (M0_INTERNAL, &long_lock_link_bob, m0_long_lock_link)
 
M0_INTERNAL void m0_fom_ll_global_init (void)
 
M0_INTERNAL void m0_long_lock_link_init (struct m0_long_lock_link *link, struct m0_fom *fom, struct m0_long_lock_addb2 *addb2)
 
M0_INTERNAL void m0_long_lock_link_fini (struct m0_long_lock_link *link)
 
static void ll_addb2_reset (struct m0_long_lock_link *link)
 
static void ll_addb2_post (struct m0_long_lock_link *link)
 
static void ll_addb2_wait_start (struct m0_long_lock_link *link)
 
static void ll_addb2_wait_finish (struct m0_long_lock_link *link)
 
static bool link_invariant (const struct m0_long_lock_link *link)
 
static bool lock_invariant (const struct m0_long_lock *lock)
 
static bool can_lock (const struct m0_long_lock *lock, const struct m0_long_lock_link *link)
 
static void grant (struct m0_long_lock *lock, struct m0_long_lock_link *link)
 
static bool lock (struct m0_long_lock *lock, struct m0_long_lock_link *link, int next_phase)
 
M0_INTERNAL bool m0_long_write_lock (struct m0_long_lock *lk, struct m0_long_lock_link *link, int next_phase)
 
M0_INTERNAL bool m0_long_read_lock (struct m0_long_lock *lk, struct m0_long_lock_link *link, int next_phase)
 
M0_INTERNAL bool m0_long_lock (struct m0_long_lock *lock, bool write, struct m0_long_lock_link *link, int next_phase)
 
static void unlock (struct m0_long_lock *lock, struct m0_long_lock_link *link, bool check_ownership)
 
M0_INTERNAL void m0_long_write_unlock (struct m0_long_lock *lock, struct m0_long_lock_link *link)
 
M0_INTERNAL void m0_long_read_unlock (struct m0_long_lock *lock, struct m0_long_lock_link *link)
 
M0_INTERNAL void m0_long_unlock (struct m0_long_lock *lock, struct m0_long_lock_link *link)
 
M0_INTERNAL bool m0_long_is_read_locked (struct m0_long_lock *lock, const struct m0_fom *fom)
 
M0_INTERNAL bool m0_long_is_write_locked (struct m0_long_lock *lock, const struct m0_fom *fom)
 
M0_INTERNAL void m0_long_lock_init (struct m0_long_lock *lock)
 
M0_INTERNAL void m0_long_lock_fini (struct m0_long_lock *lock)
 

Variables

static const struct m0_bob_type long_lock_bob
 
static struct m0_bob_type long_lock_link_bob