78 .sd_name =
"File lock acquire",
82 .sd_name =
"Wait for file lock",
86 .sd_name =
"file locked, now unlock",
90 .sd_name =
"file unlocked, now fini",
202 for (
i = 0;
i <
NR;
i++) {
207 for (
i = 0;
i <
NR;
i++) {
void cs_fini(struct m0_motr *sctx)
M0_INTERNAL int m0_cm_ast_run_thread_init(struct m0_cm *cm)
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
M0_INTERNAL void m0_cm_lock(struct m0_cm *cm)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
struct m0_reqh * m0_cs_reqh_get(struct m0_motr *cctx)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL void m0_clink_del(struct m0_clink *link)
struct m0_htable sc_file_ctx
M0_INTERNAL struct m0_sns_cm * cm2sns(struct m0_cm *cm)
static struct m0_reqh * reqh
static struct m0_sm_conf flock_ut_conf
static struct m0_sns_cm * scm
static void file_unlock_and_wait(struct m0_sns_cm_file_ctx *fctx, struct m0_clink *clink)
M0_INTERNAL void m0_cm_ast_run_thread_fini(struct m0_cm *cm)
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
static void file_lock_wait(struct m0_sns_cm_file_ctx *fctx, struct m0_clink *clink)
M0_INTERNAL int m0_sns_cm_file_lock(struct m0_sns_cm *scm, const struct m0_fid *fid, struct m0_sns_cm_file_ctx **out)
#define container_of(ptr, type, member)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
M0_INTERNAL struct m0_reqh_service_type * m0_reqh_service_type_find(const char *sname)
static struct m0_fid gfid
M0_INTERNAL void m0_cm_unlock(struct m0_cm *cm)
static void sns_flock_single_fom(void)
M0_INTERNAL void m0_sm_group_unlock(struct m0_sm_group *grp)
struct m0_ut_suite sns_flock_ut
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
static void sns_file_lock_unlock(void)
struct m0_mutex sc_file_ctx_mutex
static int file_lock_verify(struct m0_sns_cm *scm, struct m0_fid *fid, int64_t ref)
M0_INTERNAL int m0_sns_cm_file_lock_wait(struct m0_sns_cm_file_ctx *fctx, struct m0_fom *fom)
M0_INTERNAL void m0_sns_cm_file_unlock(struct m0_sns_cm *scm, struct m0_fid *fid)
static struct flock_ut_fom * fom_simple2flock_fom(struct m0_fom_simple *fs)
struct m0_semaphore uf_sem
void m0_sm_state_set(struct m0_sm *mach, int state)
static int test_setup(void)
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
M0_INTERNAL int m0_sns_cm_rm_init(struct m0_sns_cm *scm)
struct m0_fom_simple uf_fom
struct m0_sm_group * sm_grp
static struct m0_rpc_server_ctx sctx
void flock_ut_fom_free(struct m0_fom_simple *sfom)
static struct m0_clink clink[RDWR_REQUEST_MAX]
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
struct m0_reqh_service_type m0_rms_type
M0_INTERNAL struct m0_reqh_service * m0_reqh_service_find(const struct m0_reqh_service_type *st, const struct m0_reqh *reqh)
M0_INTERNAL int64_t m0_ref_read(const struct m0_ref *ref)
static int flock_ut_fom_tick(struct m0_fom *fom, void *data, int *phase)
static struct m0_chan chan[RDWR_REQUEST_MAX]
static struct m0_fid test_fids[NR_FIDS]
M0_INTERNAL void m0_clink_add(struct m0_chan *chan, struct m0_clink *link)
M0_INTERNAL bool m0_chan_timedwait(struct m0_clink *link, const m0_time_t abs_timeout)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
static struct m0_sm_state_descr flock_ut_fom_phases[]
m0_time_t m0_time_from_now(uint64_t secs, long ns)
int cs_init(struct m0_motr *sctx)
struct m0_rm_incoming sf_rin
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
M0_INTERNAL struct m0_sns_cm_file_ctx * m0_sns_cm_fctx_locate(struct m0_sns_cm *scm, struct m0_fid *fid)
M0_INTERNAL void m0_sm_group_lock(struct m0_sm_group *grp)
M0_INTERNAL int m0_sns_cm_fctx_state_get(struct m0_sns_cm_file_ctx *fctx)
M0_INTERNAL void m0_rm_owner_unlock(struct m0_rm_owner *owner)
static struct m0_sns_cm_file_ctx fctx
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
static void sns_flock_multi_fom(void)
M0_INTERNAL void m0_rm_owner_lock(struct m0_rm_owner *owner)
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
struct m0_rm_owner sf_owner
#define M0_FOM_SIMPLE_POST(s, r, c, t, f, d, l)
M0_INTERNAL void m0_sns_cm_rm_fini(struct m0_sns_cm *scm)
static struct flock_ut_fom fs[NR]
static int fids_set(void)
static int test_fini(void)
static struct m0_reqh_service * service