Motr  M0
rm_rwlock.h
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 #pragma once
24 
25 #ifndef __MOTR_RM_RWLOCK_H__
26 #define __MOTR_RM_RWLOCK_H__
27 
28 #include "lib/errno.h"
29 #include "lib/misc.h"
30 #include "lib/memory.h"
31 #include "fid/fid.h"
32 #include "rm/rm.h"
33 #include "rm/rm_internal.h"
34 
107 };
108 
118  const struct m0_fid *rwl_fid;
121 };
122 
123 M0_INTERNAL void m0_rw_lockable_init(struct m0_rw_lockable *lockable,
124  const struct m0_fid *fid,
125  struct m0_rm_domain *dom);
126 
127 M0_INTERNAL void m0_rw_lockable_fini(struct m0_rw_lockable *lockable);
128 
129 M0_INTERNAL void m0_rm_rwlock_owner_init(struct m0_rm_owner *owner,
130  struct m0_fid *fid,
131  struct m0_rw_lockable *lockable,
132  struct m0_rm_remote *creditor);
133 
134 M0_INTERNAL void m0_rm_rwlock_owner_fini(struct m0_rm_owner *owner);
135 
136 M0_INTERNAL void m0_rm_rwlock_req_init(struct m0_rm_incoming *req,
137  struct m0_rm_owner *owner,
138  const struct m0_rm_incoming_ops *ops,
141 
142 M0_INTERNAL void m0_rm_rwlock_req_fini(struct m0_rm_incoming *req);
143 
144 M0_INTERNAL int m0_rw_lockable_type_register(struct m0_rm_domain *dom,
145  struct m0_rm_resource_type *rtype);
146 M0_INTERNAL
148 
150 extern const struct m0_fid M0_RWLOCK_FID;
151 
153 M0_INTERNAL int
155  struct m0_rm_resource_type *rwl_rt);
156 
158 M0_INTERNAL void
160  struct m0_rm_resource_type *rwl_rt);
161 
164 #endif /* __MOTR_RM_RWLOCK_H__ */
165 
166 /*
167  * Local variables:
168  * c-indentation-style: "K&R"
169  * c-basic-offset: 8
170  * tab-width: 8
171  * fill-column: 79
172  * scroll-step: 1
173  * End:
174  */
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
M0_INTERNAL int m0_rw_lockable_type_register(struct m0_rm_domain *dom, struct m0_rm_resource_type *rtype)
Definition: rm_rwlock.c:575
int const char const void size_t int flags
Definition: dir.c:328
M0_INTERNAL void m0_rw_lockable_fini(struct m0_rw_lockable *lockable)
Definition: rm_rwlock.c:523
static struct m0_rm_remote creditor
Definition: file.c:95
static struct io_request req
Definition: file.c:100
M0_INTERNAL void m0_rw_lockable_type_deregister(struct m0_rm_resource_type *rtype)
Definition: rm_rwlock.c:588
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
M0_INTERNAL void m0_rm_rwlock_req_fini(struct m0_rm_incoming *req)
Definition: rm_rwlock.c:567
const struct m0_fid M0_RWLOCK_FID
Definition: rm_rwlock.c:596
struct m0_fid fid
Definition: di.c:46
struct m0_rm_resource rwl_resource
Definition: rm_rwlock.h:120
m0_rm_incoming_flags
Definition: rm.h:1183
m0_rm_rwlock_req_type
Definition: rm_rwlock.h:104
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
static struct m0_stob_domain * dom
Definition: storage.c:38
M0_INTERNAL void m0_rm_rwlock_owner_fini(struct m0_rm_owner *owner)
Definition: rm_rwlock.c:542
Definition: fid.h:38
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
const struct m0_fid * rwl_fid
Definition: rm_rwlock.h:118
int type
Definition: dir.c:1031
struct m0_fom_ops ops
Definition: io_foms.c:623
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