Motr  M0
rm_rwlock.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2015-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 
23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_RM
24 #include "lib/trace.h"
25 
26 #include "lib/memory.h" /* M0_ALLOC_PTR */
27 #include "fid/fid_xc.h"
28 #include "xcode/xcode.h"
29 #include "rm/rm_rwlock.h"
30 #include "addb2/addb2.h"
31 
188 /* Forward Declarations */
189 static bool rwlockable_equal(const struct m0_rm_resource *resource0,
190  const struct m0_rm_resource *resource1);
191 static m0_bcount_t rwlockable_len(const struct m0_rm_resource *resource);
192 static int rwlockable_encode(struct m0_bufvec_cursor *cur,
193  const struct m0_rm_resource *resource);
194 static int rwlockable_decode(struct m0_bufvec_cursor *cur,
195  struct m0_rm_resource **resource);
196 static void rwlockable_credit_init(struct m0_rm_resource *resource,
197  struct m0_rm_credit *credit);
198 static void rwlockable_resource_free(struct m0_rm_resource *resource);
199 
200 static bool rwlock_cr_intersects(const struct m0_rm_credit *self,
201  const struct m0_rm_credit *c1);
202 static m0_bcount_t rwlock_cr_len(const struct m0_rm_credit *c0);
203 
204 static int rwlock_cr_join(struct m0_rm_credit *self,
205  const struct m0_rm_credit *c1);
206 static int rwlock_cr_disjoin(struct m0_rm_credit *self,
207  const struct m0_rm_credit *c1,
208  struct m0_rm_credit *intersection);
209 static int rwlock_cr_copy(struct m0_rm_credit *dest,
210  const struct m0_rm_credit *self);
211 static int rwlock_cr_diff(struct m0_rm_credit *self,
212  const struct m0_rm_credit *c1);
213 static bool rwlock_cr_conflicts(const struct m0_rm_credit *self,
214  const struct m0_rm_credit *c1);
215 static bool rwlock_cr_is_subset(const struct m0_rm_credit *self,
216  const struct m0_rm_credit *c1);
217 static int rwlock_cr_encode(struct m0_rm_credit *self,
218  struct m0_bufvec_cursor *cur);
219 static int rwlock_cr_decode(struct m0_rm_credit *self,
220  struct m0_bufvec_cursor *cur);
221 static void rwlock_cr_free(struct m0_rm_credit *self);
222 static void rwlock_cr_initial_capital(struct m0_rm_credit *self);
223 
226  .rto_len = rwlockable_len,
227  .rto_decode = rwlockable_decode,
228  .rto_encode = rwlockable_encode,
229 };
230 
233  .rop_resource_free = rwlockable_resource_free,
234 };
235 
238  .cro_join = rwlock_cr_join,
239  .cro_copy = rwlock_cr_copy,
240  .cro_diff = rwlock_cr_diff,
241  .cro_free = rwlock_cr_free,
242  .cro_encode = rwlock_cr_encode,
243  .cro_decode = rwlock_cr_decode,
244  .cro_len = rwlock_cr_len,
245  .cro_is_subset = rwlock_cr_is_subset,
246  .cro_disjoin = rwlock_cr_disjoin,
247  .cro_conflicts = rwlock_cr_conflicts,
248  .cro_initial_capital = rwlock_cr_initial_capital,
249 };
250 
251 #define R_RW(res) container_of(res, struct m0_rw_lockable, rwl_resource)
252 #define RW_XO(rw) (&M0_XCODE_OBJ(m0_fid_xc, (void *)(rw)->rwl_fid))
253 #define CR_XO(cr) (&M0_XCODE_OBJ(&M0_XT_U64, (void *)&(cr)->cr_datum))
254 
255 M0_INTERNAL int
257  struct m0_rm_resource_type *rwl_rt)
258 {
259  M0_SET0(rwl_dom);
260  M0_SET0(rwl_rt);
261  m0_rm_domain_init(rwl_dom);
262  m0_rw_lockable_type_register(rwl_dom, rwl_rt);
263  return 0;
264 }
265 
266 M0_INTERNAL void
268  struct m0_rm_resource_type *rwl_rt)
269 {
271  m0_rm_domain_fini(rwl_dom);
272 }
273 
275 static bool rwlockable_equal(const struct m0_rm_resource *resource0,
276  const struct m0_rm_resource *resource1)
277 {
278  struct m0_rw_lockable *lockable0;
279  struct m0_rw_lockable *lockable1;
280 
281  M0_PRE(resource0 != NULL && resource1 != NULL);
282 
283  lockable0 = R_RW(resource0);
284  lockable1 = R_RW(resource1);
285 
286  return m0_fid_eq(lockable0->rwl_fid, lockable1->rwl_fid);
287 }
288 
289 static m0_bcount_t rwlockable_len(const struct m0_rm_resource *resource)
290 {
291  struct m0_rw_lockable *lockable;
292  struct m0_xcode_obj fidobj;
293  struct m0_xcode_ctx ctx;
294  static m0_bcount_t len;
295 
296  M0_PRE(resource != NULL);
297 
298  /*
299  * len depends only on size of fid, which is constant,
300  * therefore len can be calculated once and then reused.
301  */
302  if (len == 0) {
303  lockable = R_RW(resource);
304  fidobj.xo_type = m0_fid_xc;
305  fidobj.xo_ptr = (void *)lockable->rwl_fid;
306  m0_xcode_ctx_init(&ctx, &fidobj);
307  len = m0_xcode_length(&ctx);
308  M0_ASSERT(len > 0);
309  }
310 
311  return len;
312 }
313 
317  const struct m0_rm_resource *resource)
318 {
319  M0_ENTRY();
320  M0_PRE(resource != NULL);
321 
322  return M0_RC(m0_xcode_encdec(RW_XO(R_RW(resource)),
323  cur, M0_XCODE_ENCODE));
324 }
325 
327  struct m0_rm_resource **resource)
328 {
329  struct m0_rw_lockable *lockable;
330  struct m0_xcode_obj *xo;
331  int rc;
332 
333  M0_ENTRY();
334  M0_PRE(resource != NULL);
335 
336  M0_ALLOC_PTR(lockable);
337  if (lockable == NULL)
338  return M0_ERR(-ENOMEM);
339 
340  xo = RW_XO(lockable);
342  if (rc == 0) {
343  lockable->rwl_fid = xo->xo_ptr;
344  lockable->rwl_resource.r_ops = &rwlockable_ops;
345  *resource = &lockable->rwl_resource;
346  } else {
347  m0_free(lockable);
348  }
349 
350  return M0_RC(rc);
351 }
352 
353 static void rwlockable_credit_init(struct m0_rm_resource *resource,
354  struct m0_rm_credit *credit)
355 {
356  M0_PRE(credit != NULL);
357  credit->cr_datum = 0;
358  credit->cr_ops = &rwlock_credit_ops;
359 }
360 
361 static void rwlockable_resource_free(struct m0_rm_resource *resource)
362 {
363  struct m0_rw_lockable *lockable;
364 
365  lockable = R_RW(resource);
366  m0_xcode_free_obj(&M0_XCODE_OBJ(m0_fid_xc, (void *)lockable->rwl_fid));
367  m0_free(lockable);
368 }
369 
370 static bool rwlock_credit_invariant(const struct m0_rm_credit *rwlock_cr)
371 {
372  return rwlock_cr->cr_datum <= RM_RW_WRITE_LOCK;
373 }
374 
375 static bool rwlock_cr_intersects(const struct m0_rm_credit *self,
376  const struct m0_rm_credit *c1)
377 {
378  M0_PRE(c1 != NULL);
381 
382  return self->cr_datum != 0 && c1->cr_datum != 0;
383 }
384 
385 static m0_bcount_t rwlock_cr_len(const struct m0_rm_credit *c0)
386 {
387  struct m0_xcode_obj datumobj;
388  struct m0_xcode_ctx ctx;
389 
390  M0_PRE(c0 != NULL);
392 
393  datumobj.xo_type = &M0_XT_U64;
394  datumobj.xo_ptr = (void *)&c0->cr_datum;
395  m0_xcode_ctx_init(&ctx, &datumobj);
396  return m0_xcode_length(&ctx);
397 }
398 
399 static int rwlock_cr_join(struct m0_rm_credit *self,
400  const struct m0_rm_credit *c1)
401 {
404  /* Max credit value is write lock, also check for overflow */
405  M0_PRE(self->cr_datum + c1->cr_datum >= self->cr_datum &&
406  self->cr_datum + c1->cr_datum <= RM_RW_WRITE_LOCK);
407 
408  self->cr_datum += c1->cr_datum;
409 
411  return 0;
412 }
413 
414 static int rwlock_cr_disjoin(struct m0_rm_credit *self,
415  const struct m0_rm_credit *c1,
416  struct m0_rm_credit *intersection)
417 {
420 
421  if (self->cr_datum > c1->cr_datum) {
422  self->cr_datum -= c1->cr_datum;
423  intersection->cr_datum = c1->cr_datum;
424  } else {
425  self->cr_datum = 0;
426  intersection->cr_datum = self->cr_datum;
427  }
428 
430  rwlock_credit_invariant(intersection));
431  return 0;
432 }
433 
434 static int rwlock_cr_copy(struct m0_rm_credit *dest,
435  const struct m0_rm_credit *self)
436 {
437  M0_PRE(dest != NULL);
439 
440  dest->cr_datum = self->cr_datum;
441  dest->cr_owner = self->cr_owner;
442  dest->cr_ops = self->cr_ops;
444  return 0;
445 }
446 
447 static int rwlock_cr_diff(struct m0_rm_credit *self,
448  const struct m0_rm_credit *c1)
449 {
450  M0_PRE(c1 != NULL);
453 
454  self->cr_datum = (self->cr_datum > c1->cr_datum) ?
455  self->cr_datum-c1->cr_datum : 0;
457  return 0;
458 }
459 
460 static bool rwlock_cr_conflicts(const struct m0_rm_credit *self,
461  const struct m0_rm_credit *c1)
462 {
463  M0_PRE(c1 != NULL);
466 
467  return (self->cr_datum != 0 && c1->cr_datum == RM_RW_WRITE_LOCK) ||
468  (self->cr_datum == RM_RW_WRITE_LOCK && c1->cr_datum != 0);
469 }
470 
471 static bool rwlock_cr_is_subset(const struct m0_rm_credit *self,
472  const struct m0_rm_credit *c1)
473 {
476  return self->cr_datum <= c1->cr_datum;
477 }
478 
479 static int rwlock_cr_encode(struct m0_rm_credit *self,
480  struct m0_bufvec_cursor *cur)
481 {
483  return M0_RC(m0_xcode_encdec(CR_XO(self), cur, M0_XCODE_ENCODE));
484 }
485 
486 static int rwlock_cr_decode(struct m0_rm_credit *self,
487  struct m0_bufvec_cursor *cur)
488 {
489  return M0_RC(m0_xcode_encdec(CR_XO(self), cur, M0_XCODE_DECODE));
490 }
491 
492 static void rwlock_cr_free(struct m0_rm_credit *self)
493 {
494  self->cr_datum = 0;
495 }
496 
497 static void rwlock_cr_initial_capital(struct m0_rm_credit *self)
498 {
499  self->cr_datum = RM_RW_WRITE_LOCK;
500 }
501  /* end internal RWLockInternal */
503 
508 M0_INTERNAL void m0_rw_lockable_init(struct m0_rw_lockable *lockable,
509  const struct m0_fid *fid,
510  struct m0_rm_domain *dom)
511 {
512  M0_PRE(lockable != NULL);
513  M0_PRE(fid != NULL);
514 
515  lockable->rwl_resource.r_ops = &rwlockable_ops;
516  lockable->rwl_fid = fid;
517  if (dom != NULL)
519  &lockable->rwl_resource);
520 }
521 M0_EXPORTED(m0_rw_lockable_init);
522 
523 M0_INTERNAL void m0_rw_lockable_fini(struct m0_rw_lockable *lockable)
524 {
525  /* Delete embedded resource from domain */
526  m0_rm_resource_del(&lockable->rwl_resource);
527  lockable->rwl_resource.r_ops = NULL;
528  lockable->rwl_fid = NULL;
529 }
530 M0_EXPORTED(m0_rw_lockable_fini);
531 
532 M0_INTERNAL void m0_rm_rwlock_owner_init(struct m0_rm_owner *owner,
533  struct m0_fid *fid,
534  struct m0_rw_lockable *lockable,
535  struct m0_rm_remote *creditor)
536 {
538  &lockable->rwl_resource, creditor);
539 }
540 M0_EXPORTED(m0_rm_rwlock_owner_init);
541 
542 M0_INTERNAL void m0_rm_rwlock_owner_fini(struct m0_rm_owner *owner)
543 {
544  m0_rm_owner_fini(owner);
545 }
546 M0_EXPORTED(m0_rm_rwlock_owner_fini);
547 
548 M0_INTERNAL void m0_rm_rwlock_req_init(struct m0_rm_incoming *req,
549  struct m0_rm_owner *owner,
550  const struct m0_rm_incoming_ops *ops,
553 {
554  M0_ENTRY();
556 
558 
559  req->rin_want.cr_datum = (type == RM_RWLOCK_WRITE) ?
561  req->rin_ops = ops;
562 
563  M0_LEAVE();
564 }
565 M0_EXPORTED(m0_rm_rwlock_req_init);
566 
567 M0_INTERNAL void m0_rm_rwlock_req_fini(struct m0_rm_incoming *req)
568 {
569  M0_ENTRY();
571  M0_LEAVE();
572 }
573 M0_EXPORTED(m0_rm_rwlock_req_fini);
574 
576  struct m0_rm_resource_type *rtype)
577 {
578  M0_ENTRY();
579 
580  rtype->rt_id = M0_RM_RWLOCKABLE_RT;
581  rtype->rt_name = "rw-lockable";
582  rtype->rt_ops = &rwlockable_type_ops;
583  return M0_RC(m0_rm_type_register(dom, rtype));
584 }
585 M0_EXPORTED(m0_rw_lockable_type_register);
586 
587 M0_INTERNAL
589 {
590  M0_ENTRY();
591  m0_rm_type_deregister(rtype);
592  M0_LEAVE();
593 }
594 M0_EXPORTED(m0_rw_lockable_type_deregister);
595 
596 const struct m0_fid M0_RWLOCK_FID = M0_FID_TINIT('R', 'W', 'L');
597 
599 #undef M0_TRACE_SUBSYSTEM
600 
601 /*
602  * Local variables:
603  * c-indentation-style: "K&R"
604  * c-basic-offset: 8
605  * tab-width: 8
606  * fill-column: 79
607  * scroll-step: 1
608  * End:
609  */
const struct m0_rm_credit_ops * cr_ops
Definition: rm.h:502
M0_INTERNAL int m0_xcode_encdec(struct m0_xcode_obj *obj, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
Definition: xcode.c:416
#define M0_PRE(cond)
const struct m0_xcode_type * xo_type
Definition: xcode.h:351
static int rwlock_cr_join(struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: rm_rwlock.c:399
int const char const void size_t int flags
Definition: dir.c:328
static void rwlockable_resource_free(struct m0_rm_resource *resource)
Definition: rm_rwlock.c:361
uint64_t cr_datum
Definition: rm.h:514
#define NULL
Definition: misc.h:38
bool(* cro_intersects)(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: rm.h:579
static struct m0_rm_remote creditor
Definition: file.c:95
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
Definition: addb2.c:791
static struct io_request req
Definition: file.c:100
static bool rwlock_cr_intersects(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: rm_rwlock.c:375
static m0_bcount_t rwlockable_len(const struct m0_rm_resource *resource)
Definition: rm_rwlock.c:289
M0_LEAVE()
static int rwlock_cr_decode(struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
Definition: rm_rwlock.c:486
const struct m0_rm_resource_type_ops rwlockable_type_ops
Definition: rm_rwlock.c:224
M0_INTERNAL void m0_rm_rwlock_req_init(struct m0_rm_incoming *req, struct m0_rm_owner *owner, const struct m0_rm_incoming_ops *ops, enum m0_rm_incoming_flags flags, enum m0_rm_rwlock_req_type type)
Definition: rm_rwlock.c:548
bool(* rto_eq)(const struct m0_rm_resource *resource0, const struct m0_rm_resource *resource1)
Definition: rm.h:454
static int rwlock_cr_encode(struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
Definition: rm_rwlock.c:479
M0_INTERNAL void m0_rm_domain_init(struct m0_rm_domain *dom)
Definition: rm.c:215
M0_INTERNAL void m0_xcode_free_obj(struct m0_xcode_obj *obj)
Definition: xcode.c:248
uint64_t m0_bcount_t
Definition: types.h:77
static bool rwlock_cr_is_subset(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: rm_rwlock.c:471
#define M0_SET0(obj)
Definition: misc.h:64
M0_INTERNAL void m0_rw_lockable_fini(struct m0_rw_lockable *lockable)
Definition: rm_rwlock.c:523
#define RW_XO(rw)
Definition: rm_rwlock.c:252
struct m0_fid fid
Definition: di.c:46
struct m0_rm_resource rwl_resource
Definition: rm_rwlock.h:120
return M0_RC(rc)
M0_INTERNAL int m0_xcode_length(struct m0_xcode_ctx *ctx)
Definition: xcode.c:390
const struct m0_rm_resource_ops * r_ops
Definition: rm.h:305
#define M0_ENTRY(...)
Definition: trace.h:170
m0_rm_incoming_flags
Definition: rm.h:1183
M0_INTERNAL void m0_rm_rwlock_owner_init(struct m0_rm_owner *owner, struct m0_fid *fid, struct m0_rw_lockable *lockable, struct m0_rm_remote *creditor)
Definition: rm_rwlock.c:532
m0_rm_rwlock_req_type
Definition: rm_rwlock.h:104
static void rwlock_cr_initial_capital(struct m0_rm_credit *self)
Definition: rm_rwlock.c:497
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_rm_incoming_init(struct m0_rm_incoming *in, struct m0_rm_owner *owner, enum m0_rm_incoming_type type, enum m0_rm_incoming_policy policy, uint64_t flags)
Definition: rm.c:1060
M0_INTERNAL void m0_rm_rwlock_owner_fini(struct m0_rm_owner *owner)
Definition: rm_rwlock.c:542
#define M0_FID_TINIT(type, container, key)
Definition: fid.h:90
static void rwlock_cr_free(struct m0_rm_credit *self)
Definition: rm_rwlock.c:492
const struct m0_uint128 m0_rm_no_group
Definition: rm.c:211
#define M0_ASSERT(cond)
M0_INTERNAL void m0_rm_owner_fini(struct m0_rm_owner *owner)
Definition: rm.c:943
M0_INTERNAL void m0_rw_lockable_init(struct m0_rw_lockable *lockable, const struct m0_fid *fid, struct m0_rm_domain *dom)
Definition: rm_rwlock.c:508
static int rwlockable_decode(struct m0_bufvec_cursor *cur, struct m0_rm_resource **resource)
Definition: rm_rwlock.c:326
static struct m0_stob_domain * dom
Definition: storage.c:38
M0_INTERNAL void m0_rm_rwlock_req_fini(struct m0_rm_incoming *req)
Definition: rm_rwlock.c:567
M0_INTERNAL void m0_rw_lockable_type_deregister(struct m0_rm_resource_type *rtype)
Definition: rm_rwlock.c:588
void(* rop_credit_init)(struct m0_rm_resource *resource, struct m0_rm_credit *credit)
Definition: rm.h:365
#define M0_POST(cond)
static bool rwlockable_equal(const struct m0_rm_resource *resource0, const struct m0_rm_resource *resource1)
Definition: rm_rwlock.c:275
const struct m0_fid M0_RWLOCK_FID
Definition: rm_rwlock.c:596
M0_INTERNAL int m0_rwlockable_domain_type_init(struct m0_rm_domain *rwl_dom, struct m0_rm_resource_type *rwl_rt)
Definition: rm_rwlock.c:256
const struct m0_rm_resource_ops rwlockable_ops
Definition: rm_rwlock.c:231
static bool rwlock_cr_conflicts(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: rm_rwlock.c:460
M0_INTERNAL bool m0_fid_eq(const struct m0_fid *fid0, const struct m0_fid *fid1)
Definition: fid.c:164
const char * rt_name
Definition: rm.h:389
M0_INTERNAL void m0_rm_resource_add(struct m0_rm_resource_type *rtype, struct m0_rm_resource *res)
Definition: rm.c:337
static bool rwlock_credit_invariant(const struct m0_rm_credit *rwlock_cr)
Definition: rm_rwlock.c:370
Definition: fid.h:38
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
static int rwlockable_encode(struct m0_bufvec_cursor *cur, const struct m0_rm_resource *resource)
Definition: rm_rwlock.c:316
static int rwlock_cr_disjoin(struct m0_rm_credit *self, const struct m0_rm_credit *c1, struct m0_rm_credit *intersection)
Definition: rm_rwlock.c:414
const struct m0_fid * rwl_fid
Definition: rm_rwlock.h:118
M0_INTERNAL void m0_rm_incoming_fini(struct m0_rm_incoming *in)
Definition: rm.c:1099
const struct m0_rm_resource_type_ops * rt_ops
Definition: rm.h:388
M0_INTERNAL int m0_rm_type_register(struct m0_rm_domain *dom, struct m0_rm_resource_type *rt)
Definition: rm.c:252
void * xo_ptr
Definition: xcode.h:353
static int rwlock_cr_copy(struct m0_rm_credit *dest, const struct m0_rm_credit *self)
Definition: rm_rwlock.c:434
#define CR_XO(cr)
Definition: rm_rwlock.c:253
#define M0_XCODE_OBJ(type, ptr)
Definition: xcode.h:962
static m0_bcount_t rwlock_cr_len(const struct m0_rm_credit *c0)
Definition: rm_rwlock.c:385
Definition: nucleus.c:42
M0_INTERNAL void m0_xcode_ctx_init(struct m0_xcode_ctx *ctx, const struct m0_xcode_obj *obj)
Definition: xcode.c:373
const struct m0_rm_credit_ops rwlock_credit_ops
Definition: rm_rwlock.c:236
int type
Definition: dir.c:1031
M0_INTERNAL void m0_rm_type_deregister(struct m0_rm_resource_type *rt)
Definition: rm.c:288
struct m0_fom_ops ops
Definition: io_foms.c:623
static void rwlockable_credit_init(struct m0_rm_resource *resource, struct m0_rm_credit *credit)
Definition: rm_rwlock.c:353
M0_INTERNAL void m0_rm_owner_init(struct m0_rm_owner *owner, struct m0_fid *fid, const struct m0_uint128 *group, struct m0_rm_resource *res, struct m0_rm_remote *creditor)
Definition: rm.c:609
void m0_free(void *data)
Definition: memory.c:146
M0_INTERNAL void m0_rwlockable_domain_type_fini(struct m0_rm_domain *rwl_dom, struct m0_rm_resource_type *rwl_rt)
Definition: rm_rwlock.c:267
static int rwlock_cr_diff(struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: rm_rwlock.c:447
const struct m0_xcode_type M0_XT_U64
Definition: xcode.c:940
#define R_RW(res)
Definition: rm_rwlock.c:251
int32_t rc
Definition: trigger_fop.h:47
uint64_t rt_id
Definition: rm.h:403
M0_INTERNAL int m0_rw_lockable_type_register(struct m0_rm_domain *dom, struct m0_rm_resource_type *rtype)
Definition: rm_rwlock.c:575
M0_INTERNAL void m0_rm_domain_fini(struct m0_rm_domain *dom)
Definition: rm.c:227
M0_INTERNAL void m0_rm_resource_del(struct m0_rm_resource *res)
Definition: rm.c:361
Definition: rm.h:1156