Motr  M0
file.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2013-2020 Seagate Technology LLC and/or its Affiliates
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * For any questions about this software or licensing,
18  * please email opensource@seagate.com or cortx-questions@seagate.com.
19  *
20  */
21 
22 #include "lib/types.h" /* uint64_t */
23 #include "lib/chan.h"
24 #include "lib/misc.h"
25 #include "lib/memory.h"
26 #include "lib/time.h"
27 #include "lib/vec.h"
28 #include "fop/fom_generic.h"
29 #include "fid/fid.h"
30 #include "ut/ut.h"
31 
32 #include "rm/rm.h"
33 #include "rm/rm_internal.h"
34 #include "rm/rm_fops.h"
35 #include "file/file.h"
36 #include "rm/ut/rmut.h"
37 
38 /* Import */
40 
41 /*
42  * Hierarchy description:
43  * SERVER_1 is downward debtor for SERVER_2.
44  * SERVER_2 is upward creditor for SERVER_1.
45  */
46 
47 enum {
50 };
51 
53 static struct m0_thread srv_thr[SRV_THR_NR];
54 static int clnt_counter;
55 static int srv_counter;
56 
57 /* Maximum test servers for this testcase */
60 
61 /*
62  * m0_file_lock_type_register registers a single type
63  * This test needs two object hierarchies. Hence we need one more file type
64  * object.
65  */
66 static void fl_rtype_set(struct rm_ut_data *self)
67 {
68  struct m0_rm_resource_type *rt;
69  int rc;
70 
72  M0_UT_ASSERT(rt != NULL);
73  rt->rt_id = M0_RM_FLOCK_RT;
74  rt->rt_ops = &file_lock_type_ops;
75  rc = m0_rm_type_register(&self->rd_dom, rt);
76  M0_UT_ASSERT(rc == 0);
77  self->rd_rt = rt;
78 }
79 
80 static void fl_rtype_unset(struct rm_ut_data *self)
81 {
82  m0_rm_type_deregister(self->rd_rt);
83  m0_free0(&self->rd_rt);
84 }
85 
86 static void fl_res_set(struct rm_ut_data *self)
87 {
88  struct m0_file *flock;
89 
90  M0_ALLOC_PTR(flock);
91  M0_UT_ASSERT(flock != NULL);
92  m0_fid_set(&self->rd_fid, 1, 0);
93  m0_file_init(flock, &self->rd_fid, &self->rd_dom, 0);
94  self->rd_res = &flock->fi_res;
95 }
96 
97 static void fl_res_unset(struct rm_ut_data *self)
98 {
99  struct m0_file *flock;
100 
101  flock = container_of(self->rd_res, struct m0_file, fi_res);
102  m0_file_fini(flock);
103  m0_free(flock);
104  self->rd_res = NULL;
105 }
106 
107 static void fl_owner_set(struct rm_ut_data *self)
108 {
109  struct m0_rm_owner *owner;
110  struct m0_file *flock;
111 
112  M0_ALLOC_PTR(owner);
113  M0_UT_ASSERT(owner != NULL);
114  flock = container_of(self->rd_res, struct m0_file, fi_res);
115  m0_file_owner_init(owner, &m0_rm_no_group, flock, NULL);
116  self->rd_owner = owner;
117 }
118 
119 static void fl_owner_unset(struct rm_ut_data *self)
120 {
121  int rc;
122 
123  m0_rm_owner_windup(self->rd_owner);
124  rc = m0_rm_owner_timedwait(self->rd_owner, M0_BITS(ROS_FINAL),
125  M0_TIME_NEVER);
126  M0_UT_ASSERT(rc == 0);
127  M0_UT_ASSERT(owner_state(self->rd_owner) == ROS_FINAL);
128  m0_file_owner_fini(self->rd_owner);
129  m0_free0(&self->rd_owner);
130 }
131 
132 static void fl_datum_set(struct rm_ut_data *self)
133 {
134  self->rd_credit.cr_datum = RM_FILE_LOCK;
135 }
136 
137 const static struct rm_ut_data_ops fl_srv_ut_data_ops = {
139  .rtype_unset = fl_rtype_unset,
140  .resource_set = fl_res_set,
141  .resource_unset = fl_res_unset,
142  .owner_set = fl_owner_set,
143  .owner_unset = fl_owner_unset,
144  .credit_datum_set = fl_datum_set
145 };
146 
147 const static struct rm_ut_data_ops fl_client_ut_data_ops = {
149  .rtype_unset = fl_rtype_unset,
150  .resource_set = fl_res_set,
151  .resource_unset = fl_res_unset,
152  .owner_set = fl_owner_set,
153  .owner_unset = fl_owner_unset,
154  .credit_datum_set = fl_datum_set
155 };
156 
158 {
159  data->rd_ops = &fl_client_ut_data_ops;
160 }
161 
163 {
164  data->rd_ops = &fl_srv_ut_data_ops;
165 }
166 
167 static void file_encdec_test(struct rm_ut_data *utdata)
168 {
169  struct m0_file *decfile;
170  struct m0_rm_resource *dec_res;
171  m0_bcount_t buf_count = 16;
172  int rc;
173  char caddr[16];
174  void *addr = &caddr[0];
175  struct m0_bufvec bufvec = M0_BUFVEC_INIT_BUF(&addr, &buf_count);
176  struct m0_bufvec_cursor cur;
177 
178  /* Encode the resource from the data-set */
179  m0_bufvec_cursor_init(&cur, &bufvec);
180  rc = utdata->rd_rt->rt_ops->rto_encode(&cur, utdata->rd_res);
181  M0_UT_ASSERT(rc == 0);
182 
183  m0_bufvec_cursor_init(&cur, &bufvec);
184  rc = utdata->rd_rt->rt_ops->rto_decode(&cur, &dec_res);
185  M0_UT_ASSERT(rc == 0);
186  M0_UT_ASSERT(dec_res != NULL);
187  decfile = container_of(dec_res, struct m0_file, fi_res);
188 
189  M0_UT_ASSERT(utdata->rd_rt->rt_ops->rto_eq(utdata->rd_res,
190  &decfile->fi_res));
191  m0_rm_resource_free(dec_res);
192 }
193 
194 static void wait_lock(enum rm_server srv_id)
195 {
196  struct m0_rm_incoming *in = &rm_ctxs[srv_id].rc_test_data.rd_in;
197  struct m0_rm_owner *owner = rm_ctxs[srv_id].rc_test_data.rd_owner;
198  int rc;
199 
200  m0_file_lock(owner, in);
201  m0_rm_owner_lock(owner);
202  rc = m0_sm_timedwait(&in->rin_sm,
204  M0_TIME_NEVER);
205  M0_UT_ASSERT(rc == 0);
206  m0_rm_owner_unlock(owner);
207  M0_UT_ASSERT(in->rin_rc == 0);
208  m0_file_unlock(in);
209 }
210 
212 {
215  struct m0_sm_group *smgrp;
216  bool validation_lock = false;
217 
218  switch(test_id) {
219  case LOCK_ON_CLIENT_TEST:
223  &clnt->ro_owned[OWOS_CACHED]));
224  break;
225  case LOCK_ON_SERVER_TEST:
228  &srv->ro_owned[OWOS_CACHED]));
230  break;
232  smgrp = owner_grp(srv);
233  if (!m0_mutex_is_locked(&smgrp->s_lock)) {
234  validation_lock = true;
236  }
237  M0_UT_ASSERT(!m0_rm_ur_tlist_is_empty(&srv->ro_sublet) ||
239  &srv->ro_owned[OWOS_CACHED]) ||
241  &srv->ro_owned[OWOS_HELD]));
242  if (validation_lock)
244  break;
245  default:
246  break;
247  }
248 }
249 
250 static void dlock(enum rm_server srv_id, int n)
251 {
252  struct m0_rm_owner *owner = rm_ctxs[srv_id].rc_test_data.rd_owner;
253  struct m0_rm_incoming req;
254  int rc;
255 
256  M0_SET0(&req);
257  m0_file_lock(owner, &req);
258  m0_rm_owner_lock(owner);
260  rc = m0_sm_timedwait(&req.rin_sm,
262  M0_TIME_NEVER);
263  M0_UT_ASSERT(rc == 0);
264  M0_UT_ASSERT(req.rin_rc == 0);
266  m0_rm_owner_unlock(owner);
267  if (srv_id == SERVER_1) {
268  clnt_counter += n;
270  } else if (srv_id == SERVER_2) {
271  srv_counter += n;
272  }
274  M0_SET0(&req);
275 }
276 
277 static void srv_dlock(int n)
278 {
279  dlock(SERVER_2, n);
280 }
281 
282 static void srv_dlock_run(void)
283 {
284  int i;
285  int sum;
286  int rc;
287 
288  for (sum = i = 0; i < SRV_THR_NR; ++i) {
289  rc = M0_THREAD_INIT(&srv_thr[i], int, NULL,
290  &srv_dlock, i, "srv_dlock");
291  M0_UT_ASSERT(rc == 0);
292  sum += i;
293  }
294 
295  for (i = 0; i < SRV_THR_NR; ++i) {
298  }
300 }
301 
302 static void clnt_dlock(int n)
303 {
304  /* SERVER_1 acts as a client */
305  dlock(SERVER_1, n);
306 }
307 
308 static void client_dlock_run(void)
309 {
310  int i;
311  int sum;
312  int rc;
313 
314  /* Server-2 (server) is upward creditor for Server-1 (client) */
316 
317  for (sum = i = 0; i < CLNT_THR_NR; ++i) {
318  rc = M0_THREAD_INIT(&clnt_thr[i], int, NULL,
319  &clnt_dlock, i, "clnt_dlock");
320  M0_UT_ASSERT(rc == 0);
321  sum += i;
322  }
323 
324  for (i = 0; i < CLNT_THR_NR; ++i) {
327  }
329 }
330 
331 /* DLD - Test 3 */
332 static void server_lock_test(void)
333 {
334  /* Take a wait lock on server */
336 }
337 
338 /* DLD - Test 2 */
339 static void testcase2_run(void)
340 {
343  struct m0_rm_incoming req;
344 
345  /* Take the lock */
346  m0_file_lock(owner, in);
350 
351  /* Recursively try to take the same lock */
352  m0_file_lock(owner, &req);
354 
355  /* Release lock (from the first request) */
356  m0_file_unlock(in);
357 
358  /* Second lock request should now be successful */
359  M0_UT_ASSERT(req.rin_rc == 0);
362 }
363 
364 /* DLD - Test 1 */
365 static void testcase1_run(void)
366 {
367  /* Server-2 (server) is upward creditor for Server-1 (client) */
369 
370  /* Take a wait lock on client */
372 
373  /*
374  * Set up session pointer on the server. So that this lock can be
375  * revoked by the server.
376  */
378 }
379 
380 static void client_lock_test(void)
381 {
382  testcase1_run();
384  testcase2_run();
386 }
387 
388 static void client_tests(void)
389 {
391 
392  /* Test encode/decode for code coverage */
393  file_encdec_test(&rm_ctxs[SERVER_1].rc_test_data);
394 
395  /* Now start the use-cases */
397 
398  /* Begin next test */
401 
403 }
404 
405 static void server_tests(void)
406 {
407  /* Now start the tests - wait till all the servers are ready */
412 
413  /* Begin next test */
415  srv_dlock_run();
416 }
417 
418 static void rm_server_start(const int tid)
419 {
420  if (tid >= test_servers_nr)
421  return;
422 
423  switch(tid) {
424  case SERVER_1:
425  flock_client_utdata_ops_set(&rm_ctxs[tid].rc_test_data);
426  rm_ctx_server_start(tid);
427  client_tests();
428  break;
429  case SERVER_2:
430  flock_srv_utdata_ops_set(&rm_ctxs[tid].rc_test_data);
431  rm_ctx_server_start(tid);
432  server_tests();
433  break;
434  default:
435  break;
436  }
437 }
438 
439 /*
440  * Configure server hierarchy.
441  */
442 static void server_hier_config(void)
443 {
447 
451 }
452 
453 static void flock_utinit(void)
454 {
455  uint32_t i;
456 
457  /* Maximum 2 servers for this test */
458  test_servers_nr = 2;
459  for (i = 0; i < test_servers_nr; ++i)
460  rm_ctx_init(&rm_ctxs[i], i);
461 
464  clnt_counter = 0;
465  srv_counter = 0;
466 
471  /* Set up test sync points */
472  for (i = 0; i < LOCK_TESTS_NR; ++i) {
475  }
476 }
477 
478 static void flock_utfini(void)
479 {
480  int32_t i;
481 
482  /*
483  * Windup the server first, then the client. Trying to stop
484  * client first may put it into INSOLVENT state. This will
485  * finalize UT-RM objects hierarchy.
486  */
489 
490  /*
491  * Following loops cannot be combined.
492  * The ops within the loops need sync points. Hence they are separate.
493  */
494  /* Disconnect the servers. */
495  for (i = test_servers_nr - 1; i >= 0; --i) {
497  }
499  /*
500  * Finalise the servers. Must be done in the reverse order, so that the
501  * first initialised reqh is finalised last.
502  */
503  for (i = test_servers_nr - 1; i >= 0; --i) {
504  rm_ctx_fini(&rm_ctxs[i]);
505  }
506  for (i = 0; i < LOCK_TESTS_NR; ++i) {
509  }
512 }
513 
514 void flock_test(void)
515 {
516  int rc;
517  int i;
518 
519  flock_utinit();
520  /* Start RM servers */
521  for (i = 0; i < test_servers_nr; ++i) {
522  rc = M0_THREAD_INIT(&rm_ctxs[i].rc_thr, int, NULL,
523  &rm_server_start, i, "rm_server_%d", i);
524  M0_UT_ASSERT(rc == 0);
525  }
526 
527  for (i = 0; i < test_servers_nr; ++i) {
528  m0_thread_join(&rm_ctxs[i].rc_thr);
529  m0_thread_fini(&rm_ctxs[i].rc_thr);
530  }
531  flock_utfini();
532 }
533 
534 /*
535  * Local variables:
536  * c-indentation-style: "K&R"
537  * c-basic-offset: 8
538  * tab-width: 8
539  * fill-column: 80
540  * scroll-step: 1
541  * End:
542  */
Definition: rmut.h:47
#define M0_BUFVEC_INIT_BUF(addr_ptr, count_ptr)
Definition: vec.h:165
Definition: rm.h:886
static void fl_owner_set(struct rm_ut_data *self)
Definition: file.c:107
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
Definition: chan.c:336
static void fl_datum_set(struct rm_ut_data *self)
Definition: file.c:132
static void file_encdec_test(struct rm_ut_data *utdata)
Definition: file.c:167
#define NULL
Definition: misc.h:38
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
Definition: chan.c:201
static struct m0_thread srv_thr[SRV_THR_NR]
Definition: file.c:53
struct rm_ctx rm_ctxs[SERVER_NR]
Definition: rmut.c:54
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
Definition: chan.c:293
void creditor_cookie_setup(enum rm_server dsrv_id, enum rm_server csrv_id)
Definition: rmut.c:420
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
Definition: addb2.c:791
int m0_thread_join(struct m0_thread *q)
Definition: kthread.c:169
const m0_time_t M0_TIME_NEVER
Definition: time.c:108
static struct io_request req
Definition: file.c:100
static void rm_ctx_init(struct m0_rm_lock_ctx *ctx, struct m0_client *m0c, struct m0_fid *fid)
Definition: obj_lock.c:114
static void client_dlock_run(void)
Definition: file.c:308
struct rm_ut_data rc_test_data
Definition: rmut.h:133
static struct m0_uint128 test_id
Definition: example.c:32
bool(* rto_eq)(const struct m0_rm_resource *resource0, const struct m0_rm_resource *resource1)
Definition: rm.h:454
struct m0_bufvec data
Definition: di.c:40
struct m0_rm_owner * rd_owner
Definition: rmut.h:112
static int clnt_counter
Definition: file.c:54
static int sum
Definition: rwlock.c:53
static void fl_owner_unset(struct rm_ut_data *self)
Definition: file.c:119
M0_INTERNAL void m0_file_lock(struct m0_rm_owner *owner, struct m0_rm_incoming *req)
Definition: file.c:522
struct m0_rm_resource_type * rd_rt
Definition: rmut.h:110
#define M0_BITS(...)
Definition: misc.h:236
uint64_t m0_bcount_t
Definition: types.h:77
#define M0_THREAD_INIT(thread, TYPE, init, func, arg, namefmt,...)
Definition: thread.h:139
#define container_of(ptr, type, member)
Definition: misc.h:33
#define M0_SET0(obj)
Definition: misc.h:64
void flock_srv_utdata_ops_set(struct rm_ut_data *data)
Definition: file.c:162
M0_INTERNAL int m0_rm_owner_timedwait(struct m0_rm_owner *owner, uint64_t state, const m0_time_t abs_timeout)
Definition: rm.c:892
M0_INTERNAL int m0_sm_timedwait(struct m0_sm *mach, uint64_t states, m0_time_t deadline)
Definition: sm.c:387
void flock_test(void)
Definition: file.c:514
static void rm_ctx_fini(struct m0_ref *ref)
Definition: obj_lock.c:168
static void client_tests(void)
Definition: file.c:388
int i
Definition: dir.c:1033
struct m0_sm rin_sm
Definition: rm.h:1436
#define M0_SET_ARR0(arr)
Definition: misc.h:72
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
Definition: fid.c:116
struct m0_chan rm_ut_tests_chan
Definition: rmut.c:55
Definition: rmut.h:46
void loan_session_set(enum rm_server csrv_id, enum rm_server dsrv_id)
Definition: rmut.c:399
struct m0_tl ro_borrowed
Definition: rm.h:1033
static enum m0_rm_owner_state owner_state(const struct m0_rm_owner *owner)
Definition: rm_internal.h:297
rm_server
Definition: rmut.h:45
static const struct rm_ut_data_ops fl_client_ut_data_ops
Definition: file.c:147
flock_tests
Definition: rmut.h:62
#define m0_free0(pptr)
Definition: memory.h:77
const struct m0_uint128 m0_rm_no_group
Definition: rm.c:211
M0_INTERNAL void m0_chan_init(struct m0_chan *chan, struct m0_mutex *ch_guard)
Definition: chan.c:96
static void server_lock_test(void)
Definition: file.c:332
M0_INTERNAL bool m0_mutex_is_locked(const struct m0_mutex *mutex)
Definition: mutex.c:95
static enum m0_rm_incoming_state incoming_state(const struct m0_rm_incoming *in)
Definition: rm_internal.h:285
void test_verify(enum flock_tests test_id)
Definition: file.c:211
void rm_ctxs_conf_fini(struct rm_ctx *rm_ctxs, int ctxs_nr)
Definition: rmut.c:382
static int srv_counter
Definition: file.c:55
void m0_thread_fini(struct m0_thread *q)
Definition: thread.c:92
static struct m0_thread clnt_thr[CLNT_THR_NR]
Definition: file.c:52
static void fl_res_set(struct rm_ut_data *self)
Definition: file.c:86
int32_t rin_rc
Definition: rm.h:1446
M0_INTERNAL void m0_bufvec_cursor_init(struct m0_bufvec_cursor *cur, const struct m0_bufvec *bvec)
Definition: vec.c:563
static struct rectype rt[]
Definition: beck.c:428
void(* rtype_set)(struct rm_ut_data *self)
Definition: rmut.h:96
M0_INTERNAL void m0_file_owner_init(struct m0_rm_owner *owner, const struct m0_uint128 *grp_id, struct m0_file *file, struct m0_rm_remote *creditor)
Definition: file.c:507
enum rm_server debtor_id[SERVER_NR - 1]
Definition: rmut.h:137
static void testcase2_run(void)
Definition: file.c:339
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
Definition: mutex.c:35
static void server_tests(void)
Definition: file.c:405
static void flock_utfini(void)
Definition: file.c:478
Definition: xcode.h:73
static void clnt_dlock(int n)
Definition: file.c:302
static struct m0_sm_group * owner_grp(const struct m0_rm_owner *owner)
Definition: rm_internal.h:309
static struct m0_clink tests_clink[LOCK_TESTS_NR]
Definition: file.c:59
int(* rto_decode)(struct m0_bufvec_cursor *cur, struct m0_rm_resource **resource)
Definition: rm.h:468
static enum rm_server test_servers_nr
Definition: file.c:58
struct m0_mutex s_lock
Definition: sm.h:514
Definition: rm.h:1145
uint32_t rc_debtors_nr
Definition: rmut.h:134
static const struct rm_ut_data_ops fl_srv_ut_data_ops
Definition: file.c:137
M0_INTERNAL void m0_rm_resource_free(struct m0_rm_resource *res)
Definition: rm.c:386
static void srv_dlock_run(void)
Definition: file.c:282
static void client_lock_test(void)
Definition: file.c:380
M0_INTERNAL void m0_chan_signal_lock(struct m0_chan *chan)
Definition: chan.c:165
void rm_ctxs_conf_init(struct rm_ctx *rm_ctxs, int ctxs_nr)
Definition: rmut.c:345
void flock_client_utdata_ops_set(struct rm_ut_data *data)
Definition: file.c:157
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
Definition: chan.c:255
static void flock_utinit(void)
Definition: file.c:453
uint64_t n
Definition: fops.h:107
M0_INTERNAL void m0_file_unlock(struct m0_rm_incoming *req)
Definition: file.c:540
int(* rto_encode)(struct m0_bufvec_cursor *cur, const struct m0_rm_resource *resource)
Definition: rm.h:473
void rm_ctx_server_windup(enum rm_server srv_id)
Definition: rmut.c:278
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
struct m0_rm_resource fi_res
Definition: file.h:90
static void srv_dlock(int n)
Definition: file.c:277
static void testcase1_run(void)
Definition: file.c:365
bool m0_rm_ur_tlist_is_empty(const struct m0_tl *list)
Definition: rm.h:863
M0_INTERNAL void m0_rm_owner_windup(struct m0_rm_owner *owner)
Definition: rm.c:930
struct m0_tl ro_owned[OWOS_NR]
Definition: rm.h:1047
enum rm_server creditor_id
Definition: rmut.h:136
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
Definition: mutex.c:42
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
Definition: chan.c:208
struct m0_rm_incoming rd_in
Definition: rmut.h:113
const struct m0_rm_resource_type_ops * rt_ops
Definition: rm.h:388
M0_INTERNAL void m0_rm_owner_unlock(struct m0_rm_owner *owner)
Definition: rm.c:603
M0_INTERNAL int m0_rm_type_register(struct m0_rm_domain *dom, struct m0_rm_resource_type *rt)
Definition: rm.c:252
static void server_hier_config(void)
Definition: file.c:442
M0_INTERNAL void m0_file_fini(struct m0_file *file)
Definition: file.c:498
static void fl_rtype_unset(struct rm_ut_data *self)
Definition: file.c:80
struct m0_rm_resource * rd_res
Definition: rmut.h:111
Definition: file.h:81
M0_INTERNAL void m0_rm_owner_lock(struct m0_rm_owner *owner)
Definition: rm.c:592
M0_INTERNAL void m0_file_owner_fini(struct m0_rm_owner *owner)
Definition: file.c:516
M0_INTERNAL void m0_rm_type_deregister(struct m0_rm_resource_type *rt)
Definition: rm.c:288
static void fl_rtype_set(struct rm_ut_data *self)
Definition: file.c:66
void rm_ctx_server_stop(enum rm_server srv_id)
Definition: rmut.c:291
M0_INTERNAL void m0_chan_fini_lock(struct m0_chan *chan)
Definition: chan.c:112
void m0_free(void *data)
Definition: memory.c:146
const struct m0_rm_resource_type_ops file_lock_type_ops
Definition: file.c:188
static void dlock(enum rm_server srv_id, int n)
Definition: file.c:250
int32_t rc
Definition: trigger_fop.h:47
struct m0_mutex rm_ut_tests_chan_mutex
Definition: rmut.c:56
void rm_ctx_server_start(enum rm_server srv_id)
Definition: rmut.c:222
#define M0_UT_ASSERT(a)
Definition: ut.h:46
static void rm_server_start(const int tid)
Definition: file.c:418
Definition: vec.h:145
M0_INTERNAL void m0_file_init(struct m0_file *file, const struct m0_fid *fid, struct m0_rm_domain *dom, enum m0_di_types di_type)
Definition: file.c:477
static void wait_lock(enum rm_server srv_id)
Definition: file.c:194
static struct net_srv srv
Definition: net_test.c:52
static void fl_res_unset(struct rm_ut_data *self)
Definition: file.c:97