Motr  M0
fop.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 
23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_FOP
24 #include "lib/trace.h"
25 
26 #include "lib/memory.h"
27 #include "lib/misc.h" /* M0_SET0 */
28 #include "lib/errno.h"
29 #include "motr/magic.h"
30 #include "rpc/rpc_machine.h" /* m0_rpc_machine, m0_rpc_machine_lock */
31 #include "rpc/addb2.h"
32 #include "fop/fop.h"
33 #include "fop/fom.h"
34 #include "fop/fom_generic.h"
35 #include "fop/fom_long_lock.h" /* m0_fom_ll_global_init */
36 #include "fop/wire_xc.h"
37 #include "addb2/identifier.h"
38 #include "reqh/reqh.h"
39 
45 static struct m0_mutex fop_types_lock;
46 static struct m0_tl fop_types_list;
47 
48 M0_TL_DESCR_DEFINE(ft, "fop types", static, struct m0_fop_type,
49  ft_linkage, ft_magix,
51 
52 M0_TL_DEFINE(ft, static, struct m0_fop_type);
53 
54 M0_INTERNAL const char *m0_fop_name(const struct m0_fop *fop)
55 {
56  return fop->f_type != NULL ? fop->f_type->ft_name : "untyped";
57 }
58 
59 static size_t fop_data_size(const struct m0_fop *fop)
60 {
61  M0_PRE(fop->f_type->ft_xt != NULL);
62  return fop->f_type->ft_xt->xct_sizeof;
63 }
64 
65 M0_INTERNAL bool m0_fop_rpc_is_locked(struct m0_fop *fop)
66 {
68 }
69 
70 M0_INTERNAL int m0_fop_data_alloc(struct m0_fop *fop)
71 {
72  M0_PRE(fop->f_data.fd_data == NULL && fop->f_type != NULL);
73 
75  return fop->f_data.fd_data == NULL ? -ENOMEM : 0;
76 }
77 
78 M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt,
79  void *data, void (*fop_release)(struct m0_ref *))
80 {
81  M0_ENTRY();
82  M0_PRE(fop != NULL && fopt != NULL && fop_release != NULL);
83 
85  fop->f_type = fopt;
86  M0_SET0(&fop->f_item);
89  M0_LOG(M0_DEBUG, "fop: %p %s", fop, m0_fop_name(fop));
90 
91  M0_POST(m0_ref_read(&fop->f_ref) == 1);
92  M0_LEAVE();
93 }
94 
95 struct m0_fop *m0_fop_alloc(struct m0_fop_type *fopt, void *data,
96  struct m0_rpc_machine *mach)
97 {
98  struct m0_fop *fop;
99 
100  M0_PRE(mach != NULL);
101 
102  M0_ALLOC_PTR(fop);
103  if (fop == NULL)
104  return NULL;
105 
107  if (data == NULL) {
108  int rc = m0_fop_data_alloc(fop);
109  if (rc != 0) {
110  m0_fop_fini(fop);
111  m0_free(fop);
112  return NULL;
113  }
114  }
116  M0_POST(m0_ref_read(&fop->f_ref) == 1);
117  return fop;
118 }
119 M0_EXPORTED(m0_fop_alloc);
120 
121 struct m0_fop *m0_fop_alloc_at(struct m0_rpc_session *sess,
122  struct m0_fop_type *fopt)
123 {
124  return m0_fop_alloc(fopt, NULL, m0_fop_session_machine(sess));
125 }
126 M0_EXPORTED(m0_fop_alloc_at);
127 
129  struct m0_fop_type *rept)
130 {
131  return m0_fop_alloc(rept, NULL, m0_fop_rpc_machine(req));
132 }
133 M0_EXPORTED(m0_fop_reply_alloc);
134 
135 M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
136 {
137  M0_PRE(fop != NULL);
138  M0_ENTRY("fop: %p %s", fop, m0_fop_name(fop));
139  M0_PRE(M0_IN(m0_ref_read(&fop->f_ref), (0, 1)));
140 
142  if (fop->f_data.fd_data != NULL)
144  M0_LEAVE();
145 }
146 
147 M0_INTERNAL void m0_fop_release(struct m0_ref *ref)
148 {
149  struct m0_fop *fop;
150 
151  M0_ENTRY();
152  M0_PRE(ref != NULL);
153 
154  fop = container_of(ref, struct m0_fop, f_ref);
155  m0_fop_fini(fop);
156  m0_free(fop);
157 
158  M0_LEAVE();
159 }
160 
161 struct m0_fop *m0_fop_get(struct m0_fop *fop)
162 {
163  uint64_t count = m0_ref_read(&fop->f_ref);
164 
165  M0_ENTRY("fop: %p %s [%llu -> %llu]", fop, m0_fop_name(fop),
166  (unsigned long long)count, (unsigned long long)count + 1);
167  M0_PRE(count > 0);
168 
169  m0_ref_get(&fop->f_ref);
170 
171  M0_LEAVE();
172  return fop;
173 }
174 M0_EXPORTED(m0_fop_get);
175 
176 void m0_fop_put(struct m0_fop *fop)
177 {
178  uint64_t count = m0_ref_read(&fop->f_ref);
179 
180  M0_ENTRY("fop: %p %s [%llu -> %llu]", fop, m0_fop_name(fop),
181  (unsigned long long)count, (unsigned long long)count - 1);
183  M0_PRE(count > 0);
184 
185  m0_ref_put(&fop->f_ref);
186 
187  M0_LEAVE();
188 }
189 M0_EXPORTED(m0_fop_put);
190 
191 void m0_fop_put0(struct m0_fop *fop)
192 {
193  if (fop != NULL)
194  m0_fop_put(fop);
195 }
196 M0_EXPORTED(m0_fop_put0);
197 
199 {
200  struct m0_rpc_machine *mach;
201 
202  M0_PRE(m0_ref_read(&fop->f_ref) > 0);
203 
205  M0_ASSERT(mach != NULL);
207  m0_fop_put(fop);
209 }
210 M0_EXPORTED(m0_fop_put_lock);
211 
213 {
214  if (fop != NULL)
216 }
217 M0_EXPORTED(m0_fop_put0_lock);
218 
219 void *m0_fop_data(const struct m0_fop *fop)
220 {
221  return fop->f_data.fd_data;
222 }
223 M0_EXPORTED(m0_fop_data);
224 
225 uint32_t m0_fop_opcode(const struct m0_fop *fop)
226 {
228 }
229 M0_EXPORTED(m0_fop_opcode);
230 
231 void m0_fop_type_fini(struct m0_fop_type *fopt)
232 {
233  M0_ENTRY("name=%s opcode=%"PRIu32" rpc_flags=%"PRIu64,
234  fopt->ft_name, fopt->ft_rpc_item_type.rit_opcode,
237  if (fopt->ft_magix == M0_FOP_TYPE_MAGIC) {
239  ft_tlink_del_fini(fopt);
240  fopt->ft_magix = 0;
241  }
243 }
244 M0_EXPORTED(m0_fop_type_fini);
245 
247  const struct __m0_fop_type_init_args *args)
248 {
249  struct m0_rpc_item_type *rpc_type;
250  const struct m0_xcode_type *xt = args->xt;
251 
252  M0_ENTRY("name=%s opcode=%"PRIu32" rpc_flags=%"PRIu64,
253  args->name, args->opcode, args->rpc_flags);
254  M0_PRE(ft->ft_magix == 0);
255  M0_PRE(ergo(args->rpc_flags & M0_RPC_ITEM_TYPE_REPLY,
256  xt->xct_nr > 0 && xt->xct_child[0].xf_type == &M0_XT_U32));
257  M0_PRE_EX(xt == NULL ||
260  M0_BITS(M0_XA_ATOM)));
261 
262  rpc_type = &ft->ft_rpc_item_type;
263 
264  ft->ft_name = args->name;
265  ft->ft_xt = xt;
266  ft->ft_ops = args->fop_ops;
267 
268  rpc_type->rit_opcode = args->opcode;
269  rpc_type->rit_flags = args->rpc_flags;
270  rpc_type->rit_ops = args->rpc_ops ?: &m0_fop_default_item_type_ops;
271 
272  m0_fom_type_init(&ft->ft_fom_type, args->opcode,
273  args->fom_ops, args->svc_type, args->sm);
274  m0_rpc_item_type_register(rpc_type);
276  ft_tlink_init_at(ft, &fop_types_list);
278 }
279 M0_EXPORTED(m0_fop_type_init);
280 
281 M0_INTERNAL void m0_fop_type_init_nr(const struct m0_fop_type_batch *batch)
282 {
283  for (; batch->tb_type != NULL; ++batch)
284  m0_fop_type_init(batch->tb_type, &batch->tb_args);
285 }
286 
287 M0_INTERNAL void m0_fop_type_fini_nr(const struct m0_fop_type_batch *batch)
288 {
289  for (; batch->tb_type != NULL; ++batch) {
290  if (batch->tb_type->ft_magix != 0)
291  m0_fop_type_fini(batch->tb_type);
292  }
293 }
294 
295 M0_INTERNAL struct m0_fop_type *m0_fop_type_next(struct m0_fop_type *ftype)
296 {
297  struct m0_fop_type *rtype;
298 
300  if (ftype == NULL) {
301  /* Returns head of fop_types_list */
302  rtype = ft_tlist_head(&fop_types_list);
303  } else {
304  /* Returns Next from fop_types_list */
305  rtype = ft_tlist_next(&fop_types_list, ftype);
306  }
308  return rtype;
309 }
310 
311 
313 M0_EXTERN struct m0_sm_conf fom_states_conf;
314 M0_INTERNAL int m0_fops_init(void)
315 {
317  ft_tlist_init(&fop_types_list);
320 
324  "fop generic record frag");
326 }
327 
328 M0_INTERNAL void m0_fops_fini(void)
329 {
331  /* Do not finalise fop_types_list, it can be validly non-empty. */
333 
335 }
336 
337 struct m0_rpc_item *m0_fop_to_rpc_item(const struct m0_fop *fop)
338 {
339  M0_PRE(fop != NULL);
340 
341  return (struct m0_rpc_item *)&fop->f_item;
342 }
343 M0_EXPORTED(m0_fop_to_rpc_item);
344 
346 {
347  M0_PRE(item != NULL);
348  return container_of(item, struct m0_fop, f_item);
349 }
350 
352 {
353  M0_PRE(fop != NULL);
354  M0_PRE(mach != NULL);
355 
357 }
358 
360 {
361  M0_PRE(fop != NULL);
362 
363  return fop->f_item.ri_rmachine;
364 }
365 M0_EXPORTED(m0_fop_rpc_machine);
366 
367 M0_INTERNAL struct m0_fop_type *m0_item_type_to_fop_type
368  (const struct m0_rpc_item_type *item_type) {
369  M0_PRE(item_type != NULL);
370 
371  return container_of(item_type, struct m0_fop_type, ft_rpc_item_type);
372 }
373 
374 M0_INTERNAL int m0_fop_encdec(struct m0_fop *fop,
375  struct m0_bufvec_cursor *cur,
376  enum m0_xcode_what what)
377 {
378  int result;
379  struct m0_xcode_obj xo = M0_FOP_XCODE_OBJ(fop);
380 
381  result = m0_xcode_encdec(&xo, cur, what);
382  if (result == 0 && m0_fop_data(fop) == NULL)
383  fop->f_data.fd_data = xo.xo_ptr;
384  return result;
385 }
386 
387 M0_INTERNAL struct m0_fop_type *m0_fop_type_find(uint32_t opcode)
388 {
389  struct m0_fop_type *ftype = NULL;
390 
391  while ((ftype = m0_fop_type_next(ftype)) != NULL) {
392  if(ftype->ft_rpc_item_type.rit_opcode == opcode)
393  break;
394  }
395  return ftype;
396 }
397 
398 static int fop_xc_type(uint32_t opcode, const struct m0_xcode_type **out)
399 {
400  struct m0_fop_type *ftype;
401 
402  ftype = m0_fop_type_find(opcode);
403  if (ftype == NULL)
404  return M0_ERR(-EINVAL);
405 
406  *out = ftype->ft_xt;
407  return 0;
408 }
409 
410 M0_INTERNAL int m0_fop_xc_type(const struct m0_xcode_obj *par,
411  const struct m0_xcode_type **out)
412 {
413  struct m0_fop_fol_frag *rp = par->xo_ptr;
414 
415  return fop_xc_type(rp->ffrp_fop_code, out);
416 }
417 
418 M0_INTERNAL int m0_fop_rep_xc_type(const struct m0_xcode_obj *par,
419  const struct m0_xcode_type **out)
420 {
421  struct m0_fop_fol_frag *rp = par->xo_ptr;
422 
423  return fop_xc_type(rp->ffrp_rep_code, out);
424 }
425 
426 M0_INTERNAL int m0_fop_fol_add(struct m0_fop *fop, struct m0_fop *rep,
427  struct m0_dtx *dtx)
428 {
429  struct m0_fol_frag *frag;
430  struct m0_fop_fol_frag *rp;
431 
432  M0_ALLOC_PTR(frag);
433  if (frag == NULL)
434  return M0_ERR(-ENOMEM);
435 
436  M0_ALLOC_PTR(rp);
437  if (rp == NULL) {
438  m0_free(frag);
439  return M0_ERR(-ENOMEM);
440  }
441 
443  rp->ffrp_rep_code = rep->f_type->ft_rpc_item_type.rit_opcode;
444  rp->ffrp_fop = m0_fop_data(fop);
445  rp->ffrp_rep = m0_fop_data(rep);
446 
448  m0_fol_frag_add(&dtx->tx_fol_rec, frag);
449  return 0;
450 }
451 
453 {
454  M0_PRE(s != NULL && s->s_conn != NULL);
455 
456  return s->s_conn->c_rpc_machine;
457 }
458 M0_EXPORTED(m0_fop_session_machine);
459 
461 {
462  struct m0_fom_type *ft = &type->ft_fom_type;
463  struct m0_rpc_item_type *rt = &type->ft_rpc_item_type;
464  uint64_t mask = ((uint64_t)rt->rit_opcode) << 12;
465 
467  return (ft->ft_conf.scf_name != NULL ?
468  m0_sm_addb2_init(&ft->ft_conf, M0_AVI_PHASE,
469  mask | (M0_AFC_PHASE << 8)) : 0) ?:
470  m0_sm_addb2_init(&ft->ft_state_conf, M0_AVI_STATE,
471  mask | (M0_AFC_STATE << 8)) ?:
472  m0_sm_addb2_init(&rt->rit_outgoing_conf, M0_AVI_RPC_OUT_PHASE,
473  mask | (M0_AFC_RPC_OUT << 8)) ?:
474  m0_sm_addb2_init(&rt->rit_incoming_conf, M0_AVI_RPC_IN_PHASE,
475  mask | (M0_AFC_RPC_IN << 8));
476 }
477 
479 {
480  M0_PRE(fop != NULL);
481 
482  return &m0_fop_rpc_machine(fop)->rm_tm;
483 }
484 
486 {
487  M0_PRE(fop != NULL);
488 
489  return m0_fop_tm_get(fop)->ntm_dom;
490 }
491 
493 {
494  struct m0_fom_type *ft = &type->ft_fom_type;
495  struct m0_rpc_item_type *rt = &type->ft_rpc_item_type;
496 
497  m0_sm_addb2_fini(&ft->ft_conf);
498  m0_sm_addb2_fini(&ft->ft_state_conf);
499  m0_sm_addb2_fini(&rt->rit_outgoing_conf);
500  m0_sm_addb2_fini(&rt->rit_incoming_conf);
501 }
502 
504 #undef M0_TRACE_SUBSYSTEM
505 
506 /*
507  * Local variables:
508  * c-indentation-style: "K&R"
509  * c-basic-offset: 8
510  * tab-width: 8
511  * fill-column: 80
512  * scroll-step: 1
513  * End:
514  */
void * fd_data
Definition: fop.h:76
uint32_t ffrp_rep_code
Definition: wire.h:45
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
const struct m0_rpc_item_type_ops m0_fop_default_item_type_ops
uint32_t rit_opcode
Definition: item.h:474
uint32_t m0_fop_opcode(const struct m0_fop *fop)
Definition: fop.c:225
#define M0_PRE(cond)
M0_INTERNAL void m0_sm_conf_init(struct m0_sm_conf *conf)
Definition: sm.c:340
Definition: dtm.h:554
const struct m0_xcode_type * xf_type
Definition: xcode.h:253
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
Definition: mutex.c:66
#define M0_FOL_FRAG_TYPE_INIT(frag, name)
Definition: fol.h:349
M0_TL_DEFINE(ft, static, struct m0_fop_type)
M0_INTERNAL int m0_sm_addb2_init(struct m0_sm_conf *conf, uint64_t id, uint64_t counter)
Definition: sm.c:846
#define NULL
Definition: misc.h:38
static size_t fop_data_size(const struct m0_fop *fop)
Definition: fop.c:59
static struct buffer * cur(struct m0_addb2_mach *mach, m0_bcount_t space)
Definition: addb2.c:791
#define ergo(a, b)
Definition: misc.h:293
Definition: sm.h:350
const struct m0_rpc_item_type_ops * rit_ops
Definition: item.h:476
M0_INTERNAL int m0_fol_frag_type_register(struct m0_fol_frag_type *type)
Definition: fol.c:178
static struct io_request req
Definition: file.c:100
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
Definition: fop.c:78
#define M0_LOG(level,...)
Definition: trace.h:167
M0_LEAVE()
static struct m0_mutex fop_types_lock
Definition: fop.c:45
size_t xct_nr
Definition: xcode.h:343
void fop_release(struct m0_ref *ref)
Definition: stats_ut_svc.c:148
const struct m0_xcode_type * ft_xt
Definition: fop.h:231
void m0_fop_type_addb2_deinstrument(struct m0_fop_type *type)
Definition: fop.c:492
M0_EXTERN struct m0_sm_conf fom_states_conf
Definition: fop.c:313
M0_INTERNAL void m0_fol_frag_init(struct m0_fol_frag *frag, void *data, const struct m0_fol_frag_type *type)
Definition: fol.c:121
struct m0_bufvec data
Definition: di.c:40
struct m0_net_domain * ntm_dom
Definition: net.h:853
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:219
void m0_fop_type_fini(struct m0_fop_type *fopt)
Definition: fop.c:231
struct m0_xcode_field xct_child[0]
Definition: xcode.h:345
M0_INTERNAL void m0_xcode_free_obj(struct m0_xcode_obj *obj)
Definition: xcode.c:248
static struct m0_addb2_mach * mach
Definition: storage.c:42
#define M0_BITS(...)
Definition: misc.h:236
#define container_of(ptr, type, member)
Definition: misc.h:33
m0_xcode_what
Definition: xcode.h:647
#define M0_SET0(obj)
Definition: misc.h:64
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
Definition: mutex.c:49
static struct m0_xcode_type ** xt[]
Definition: protocol.c:64
M0_INTERNAL void m0_rpc_item_type_register(struct m0_rpc_item_type *item_type)
Definition: item.c:154
Definition: ub.c:49
void m0_rpc_item_init(struct m0_rpc_item *item, const struct m0_rpc_item_type *itype)
Definition: item.c:364
static struct m0_rpc_item * item
Definition: item.c:56
struct m0_fop_getxattr_rep * rep
Definition: dir.c:455
M0_INTERNAL struct m0_fop_type * m0_fop_type_next(struct m0_fop_type *ftype)
Definition: fop.c:295
struct m0_fol_frag_type m0_fop_fol_frag_type
M0_INTERNAL void m0_fops_fini(void)
Definition: fop.c:328
static m0_bcount_t count
Definition: xcode.c:167
struct m0_fom_type ft_fom_type
Definition: fop.h:233
const struct m0_fol_frag_type_ops * rpt_ops
Definition: fol.h:270
#define M0_ENTRY(...)
Definition: trace.h:170
void m0_rpc_item_fini(struct m0_rpc_item *item)
Definition: item.c:394
int opcode
Definition: crate.c:301
M0_INTERNAL bool m0_rpc_machine_is_locked(const struct m0_rpc_machine *machine)
Definition: rpc_machine.c:565
void m0_fop_put0_lock(struct m0_fop *fop)
Definition: fop.c:212
void m0_fop_rpc_machine_set(struct m0_fop *fop, struct m0_rpc_machine *mach)
Definition: fop.c:351
struct m0_fop_type * f_type
Definition: fop.h:82
#define PRIu64
Definition: types.h:58
M0_INTERNAL void m0_ref_put(struct m0_ref *ref)
Definition: refs.c:38
struct m0_rpc_machine * m0_fop_rpc_machine(const struct m0_fop *fop)
Definition: fop.c:359
void m0_ref_init(struct m0_ref *ref, int init_num, void(*release)(struct m0_ref *ref))
Definition: refs.c:24
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL const char * m0_fop_name(const struct m0_fop *fop)
Definition: fop.c:54
M0_INTERNAL void m0_ref_get(struct m0_ref *ref)
Definition: refs.c:32
static int fop_xc_type(uint32_t opcode, const struct m0_xcode_type **out)
Definition: fop.c:398
M0_INTERNAL void m0_rpc_machine_unlock(struct m0_rpc_machine *machine)
Definition: rpc_machine.c:558
M0_INTERNAL bool m0_fop_rpc_is_locked(struct m0_fop *fop)
Definition: fop.c:65
M0_INTERNAL int m0_fop_fol_add(struct m0_fop *fop, struct m0_fop *rep, struct m0_dtx *dtx)
Definition: fop.c:426
const struct m0_xcode_type * rpt_xt
Definition: fol.h:269
struct __m0_fop_type_init_args tb_args
Definition: fop.h:326
Definition: refs.h:34
const char * ft_name
Definition: fop.h:226
M0_INTERNAL int m0_fop_rep_xc_type(const struct m0_xcode_obj *par, const struct m0_xcode_type **out)
Definition: fop.c:418
struct m0_net_transfer_mc rm_tm
Definition: rpc_machine.h:88
#define M0_ASSERT(cond)
struct m0_rpc_machine * m0_fop_session_machine(const struct m0_rpc_session *s)
Definition: fop.c:452
Definition: tlist.h:251
M0_INTERNAL void m0_fom_type_init(struct m0_fom_type *type, uint64_t id, const struct m0_fom_type_ops *ops, const struct m0_reqh_service_type *svc_type, const struct m0_sm_conf *sm)
Definition: fom.c:1596
static struct rectype rt[]
Definition: beck.c:428
struct m0_fop * m0_fop_get(struct m0_fop *fop)
Definition: fop.c:161
void * m0_alloc(size_t size)
Definition: memory.c:126
M0_INTERNAL void m0_mutex_init(struct m0_mutex *mutex)
Definition: mutex.c:35
#define M0_POST(cond)
M0_INTERNAL void m0_sm_addb2_fini(struct m0_sm_conf *conf)
Definition: sm.c:870
m0_xcode_type_flags
Definition: xcode.h:300
M0_INTERNAL struct m0_fop_type * m0_item_type_to_fop_type(const struct m0_rpc_item_type *item_type)
Definition: fop.c:368
M0_INTERNAL int m0_fop_data_alloc(struct m0_fop *fop)
Definition: fop.c:70
M0_INTERNAL void m0_rpc_item_type_deregister(struct m0_rpc_item_type *item_type)
Definition: item.c:176
struct m0_fol_rec tx_fol_rec
Definition: dtm.h:561
M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
Definition: fop.c:135
struct m0_xcode_type * m0_fop_fol_frag_xc
Definition: wire_xc.c:10
M0_INTERNAL int m0_fops_init(void)
Definition: fop.c:314
M0_INTERNAL int m0_fop_xc_type(const struct m0_xcode_obj *par, const struct m0_xcode_type **out)
Definition: fop.c:410
M0_INTERNAL struct m0_fop_type * m0_fop_type_find(uint32_t opcode)
Definition: fop.c:387
uint64_t rit_flags
Definition: item.h:478
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
Definition: fop.c:128
struct m0_fop_data f_data
Definition: fop.h:83
#define PRIu32
Definition: types.h:66
const struct m0_xcode_type M0_XT_U32
Definition: xcode.c:932
M0_INTERNAL int64_t m0_ref_read(const struct m0_ref *ref)
Definition: refs.c:44
void m0_fop_type_init(struct m0_fop_type *ft, const struct __m0_fop_type_init_args *args)
Definition: fop.c:246
M0_TL_DESCR_DEFINE(ft, "fop types", static, struct m0_fop_type, ft_linkage, ft_magix, M0_FOP_TYPE_MAGIC, M0_FOP_TYPE_HEAD_MAGIC)
struct m0_ref f_ref
Definition: fop.h:81
M0_FOL_FRAG_TYPE_DECLARE(m0_fop_fol_frag,, NULL, NULL, NULL, NULL)
M0_INTERNAL void m0_rpc_machine_lock(struct m0_rpc_machine *machine)
Definition: rpc_machine.c:551
M0_INTERNAL void m0_fop_release(struct m0_ref *ref)
Definition: fop.c:147
void m0_fop_put0(struct m0_fop *fop)
Definition: fop.c:191
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
struct m0_net_domain * m0_fop_domain_get(const struct m0_fop *fop)
Definition: fop.c:485
M0_INTERNAL void m0_fol_frag_add(struct m0_fol_rec *rec, struct m0_fol_frag *frag)
Definition: fol.c:468
int m0_fop_type_addb2_instrument(struct m0_fop_type *type)
Definition: fop.c:460
const struct m0_fop_type_ops * ft_ops
Definition: fop.h:229
struct m0_rpc_item * m0_fop_to_rpc_item(const struct m0_fop *fop)
Definition: fop.c:337
struct m0_fop * m0_fop_alloc_at(struct m0_rpc_session *sess, struct m0_fop_type *fopt)
Definition: fop.c:121
M0_INTERNAL void m0_mutex_fini(struct m0_mutex *mutex)
Definition: mutex.c:42
M0_INTERNAL void m0_fop_type_init_nr(const struct m0_fop_type_batch *batch)
Definition: fop.c:281
void m0_fop_put_lock(struct m0_fop *fop)
Definition: fop.c:198
static struct m0_fop * fop
Definition: item.c:57
M0_INTERNAL int m0_fop_encdec(struct m0_fop *fop, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
Definition: fop.c:374
struct m0_rpc_item_type ft_rpc_item_type
Definition: fop.h:236
size_t xct_sizeof
Definition: xcode.h:341
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
Definition: fop.c:345
M0_INTERNAL void m0_fol_frag_type_deregister(struct m0_fol_frag_type *type)
Definition: fol.c:201
void * xo_ptr
Definition: xcode.h:353
static struct m0_fop_type * ft[]
Definition: service_ut.c:857
#define out(...)
Definition: gen.c:41
int type
Definition: dir.c:1031
M0_INTERNAL void m0_sm_conf_fini(struct m0_sm_conf *conf)
Definition: sm.c:376
struct m0_rpc_machine * ri_rmachine
Definition: item.h:160
#define M0_PRE_EX(cond)
struct m0_fop_type * tb_type
Definition: fop.h:325
#define M0_FOP_XCODE_OBJ(f)
Definition: fop.h:335
M0_INTERNAL void m0_fom_ll_global_init(void)
Definition: fom_long_lock.c:60
void m0_free(void *data)
Definition: memory.c:146
Definition: mutex.h:47
static struct m0_addb2_source * s
Definition: consumer.c:39
void m0_fop_put(struct m0_fop *fop)
Definition: fop.c:176
uint64_t ft_magix
Definition: fop.h:237
struct m0_rpc_item f_item
Definition: fop.h:84
int32_t rc
Definition: trigger_fop.h:47
M0_INTERNAL void m0_fop_type_fini_nr(const struct m0_fop_type_batch *batch)
Definition: fop.c:287
struct m0_net_transfer_mc * m0_fop_tm_get(const struct m0_fop *fop)
Definition: fop.c:478
static struct m0_tl fop_types_list
Definition: fop.c:46
Definition: fop.h:80
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
Definition: fop.c:95
uint32_t ffrp_fop_code
Definition: wire.h:43