Motr  M0
bulkio_common.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2012-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 #include "bulkio_common.h"
24 #include "rpc/rpclib.h" /* m0_rpc_server_ctx */
25 #include "ioservice/fid_convert.h" /* m0_fid_gob_make */
26 #include "mdservice/fsync_fops.h" /* m0_fop_fsync */
27 #include "ut/misc.h" /* M0_UT_PATH */
28 #include "ut/ut.h"
29 
30 #define S_DBFILE "bulkio_st.db"
31 #define S_STOBFILE "bulkio_st_stob"
32 #define S_ADDB_STOBFILE "linuxstob:bulkio_st_addb_stob"
33 
39 M0_TL_DESCR_DECLARE(rpcbulk, M0_EXTERN);
40 
42 
43 #ifndef __KERNEL__
44 static char **server_argv_alloc(const char *server_ep_addr, int *argc)
45 {
46  enum { STRLEN = 16 };
47  int n;
48  char **ret;
49  char ep[IO_ADDR_LEN];
50  char tm_len[STRLEN];
51  char rpc_size[STRLEN];
52  const char *argv[] = {
53  "bulkio_st", "-T", "AD", "-D", S_DBFILE,
54  "-S", S_STOBFILE, "-A", S_ADDB_STOBFILE, "-e", ep,
55  "-q", tm_len, "-m", rpc_size, "-w", "10", "-G", ep,
56  "-f", M0_UT_CONF_PROCESS, "-H", server_ep_addr,
57  "-c", M0_UT_PATH("diter.xc")
58  };
59 
60  n = snprintf(ep, sizeof ep, "%s:%s", M0_NET_XPRT_PREFIX_DEFAULT,
61  server_ep_addr);
62  M0_ASSERT(n < sizeof ep);
63 
64  n = snprintf(tm_len, sizeof tm_len, "%d", M0_NET_TM_RECV_QUEUE_DEF_LEN);
65  M0_ASSERT(n < sizeof tm_len);
66 
67  n = snprintf(rpc_size, sizeof rpc_size, "%d",
69  M0_ASSERT(n < sizeof rpc_size);
70 
71  M0_ALLOC_ARR(ret, ARRAY_SIZE(argv));
72  M0_ASSERT(ret != NULL);
73 
74  for (n = 0; n < ARRAY_SIZE(argv); ++n) {
75  ret[n] = m0_strdup(argv[n]);
76  M0_ASSERT(ret[n] != NULL);
77  }
78  *argc = ARRAY_SIZE(argv);
79  return ret;
80 }
81 
82 int bulkio_server_start(struct bulkio_params *bp, const char *saddr)
83 {
84  int argc;
85 
86  M0_PRE(saddr != NULL && *saddr != '\0');
87 
90 
92  M0_ASSERT(bp->bp_sctx != NULL);
93  *bp->bp_sctx = (struct m0_rpc_server_ctx){
95  .rsx_argv = server_argv_alloc(saddr, &argc),
96  .rsx_argc = argc,
97  .rsx_xprts = &bp->bp_xprt,
98  .rsx_log_file_name = bp->bp_slogfile
99  };
100  return m0_rpc_server_start(bp->bp_sctx);
101 }
102 
104 {
105  int i;
106 
108 
109  for (i = 0; i < sctx->rsx_argc; ++i)
110  m0_free(sctx->rsx_argv[i]);
112  m0_free(sctx);
113 }
114 #endif
115 
116 static void io_fids_init(struct bulkio_params *bp)
117 {
118  int i;
119  struct m0_fid gfid;
120 
121  M0_ASSERT(bp != NULL);
122  /* Populates fids. */
123  for (i = 0; i < IO_FIDS_NR; ++i) {
124  m0_fid_gob_make(&gfid, 2, 12345 + i);
127  }
128 }
129 
131 {
132  int i;
133 
134  M0_ASSERT(bp != NULL);
135 
136  /* Initialized the standard buffer with a data pattern for read IO. */
137  memset(bp->bp_readbuf, 'b', M0_0VEC_ALIGN);
138  memset(bp->bp_writebuf, 'a', M0_0VEC_ALIGN);
139 
140  for (i = 0; i < IO_FOPS_NR; ++i)
142  bp->bp_seg_nr, M0_0VEC_ALIGN,
143  M0_0VEC_SHIFT);
144 }
145 
147 {
148  int i;
149 
150  M0_ASSERT(bp != NULL);
151 
152  for (i = 0; i < IO_FOPS_NR; ++i)
154  M0_0VEC_SHIFT);
155 }
156 
157 static void io_fop_populate(struct bulkio_params *bp, int index,
158  uint64_t off_index, struct m0_io_fop **io_fops,
159  int segs_nr)
160 {
161  int i;
162  int rc;
163  struct m0_io_fop *iofop;
164  struct m0_rpc_bulk *rbulk;
165  struct m0_rpc_bulk_buf *rbuf;
166  struct m0_fop_cob_rw *rw;
167 
168  M0_ASSERT(bp != NULL);
169  M0_ASSERT(io_fops != NULL);
170 
171  iofop = io_fops[index];
172  rw = io_rw_get(&iofop->if_fop);
173  rw->crw_fid = bp->bp_fids[off_index];
175  rw->crw_pver = CONF_PVER_FID;
176 
177  rbulk = &iofop->if_rbulk;
178  /*
179  * Adds a m0_rpc_bulk_buf structure to list of such structures
180  * in m0_rpc_bulk.
181  */
182  rc = m0_rpc_bulk_buf_add(rbulk, segs_nr, 0,
183  &bp->bp_cnetdom, NULL, &rbuf);
184  M0_ASSERT(rc == 0);
185  M0_ASSERT(rbuf != NULL);
186 
187  /* Adds io buffers to m0_rpc_bulk_buf structure. */
188  for (i = 0; i < segs_nr; ++i) {
192  bp->bp_offsets[off_index], &bp->bp_cnetdom);
193  M0_ASSERT(rc == 0);
194 
195  bp->bp_offsets[off_index] +=
197  }
198 
199  /*
200  * Allocates memory for array of net buf descriptors and array of
201  * index vectors from io fop.
202  */
203  rc = m0_io_fop_prepare(&iofop->if_fop);
204  M0_ASSERT(rc == 0);
205  M0_ASSERT(rw->crw_desc.id_nr ==
206  m0_tlist_length(&rpcbulk_tl, &rbulk->rb_buflist));
208 
209  /*
210  * Stores the net buf desc/s after adding the corresponding
211  * net buffers to transfer machine to io fop wire format.
212  */
215  M0_ASSERT(rc == 0);
216 }
217 
219  int fids_nr, int fops_nr, int segs_nr)
220 {
221  int i;
222  int rc;
223  uint64_t seed;
224  uint64_t rnd;
225  struct m0_fop_type *fopt;
226  struct m0_io_fop **io_fops;
227 
228  seed = 0;
229  for (i = 0; i < fids_nr; ++i)
232  M0_ASSERT(bp->bp_wfops == NULL);
233  M0_ALLOC_ARR(bp->bp_wfops, fops_nr);
234  fopt = &m0_fop_cob_writev_fopt;
235  io_fops = bp->bp_wfops;
236  bp->bp_wfops_nr = fops_nr;
237  } else {
238  M0_ASSERT(bp->bp_rfops == NULL);
239  M0_ALLOC_ARR(bp->bp_rfops, fops_nr);
240  fopt = &m0_fop_cob_readv_fopt;
241  io_fops = bp->bp_rfops;
242  bp->bp_rfops_nr = fops_nr;
243  }
244  M0_ASSERT(io_fops != NULL);
245 
246  /* Allocates io fops. */
247  for (i = 0; i < fops_nr; ++i) {
248  M0_ALLOC_PTR(io_fops[i]);
249  M0_ASSERT(io_fops[i] != NULL);
250  rc = m0_io_fop_init(io_fops[i], &bp->bp_fids[0], fopt, NULL);
251  M0_ASSERT(rc == 0);
252  }
253 
254  /* Populates io fops. */
255  for (i = 0; i < fops_nr; ++i) {
256  if (fids_nr < fops_nr) {
257  rnd = m0_rnd(fids_nr, &seed);
258  M0_ASSERT(rnd < fids_nr);
259  }
260  else rnd = i;
261 
262  io_fop_populate(bp, i, rnd, io_fops, segs_nr);
263  }
264 }
265 
267 {
268  int i;
269 
270  for (i = 0; i < bp->bp_wfops_nr; ++i)
271  if (bp->bp_wfops[i] != NULL)
273  for (i = 0; i < bp->bp_rfops_nr; ++i)
274  if (bp->bp_rfops[i] != NULL)
276 
277  m0_free0(&bp->bp_rfops);
278  m0_free0(&bp->bp_wfops);
279  bp->bp_wfops_nr = bp->bp_rfops_nr = 0;
280 }
281 
289 int io_fsync_send_fop(struct m0_be_tx_remid *remid, struct thrd_arg *t)
290 {
291  int rc;
292  struct m0_fop *fop;
293  struct m0_fop_fsync *ffop;
294  struct m0_fop_fsync_rep *rfop;
295 
296  struct m0_rpc_item *item;
297  struct bulkio_params *bp;
298  struct m0_rpc_machine *machine;
299 
300  bp = t->ta_bp;
301 
303 
304  /* create a fop from fsync_fopt */
306  M0_UT_ASSERT(fop != NULL);
307 
308  /* populate fop */
309  ffop = m0_fop_data(fop);
310  ffop->ff_be_remid = *remid;
312 
313  /* send fop */
314  item = &fop->f_item;
317  rc = m0_rpc_post(item);
318  M0_UT_ASSERT(rc == 0);
319 
320  /* get and process the reply */
322  M0_UT_ASSERT(rc == 0);
324 
325  /* check the values returned */
326  M0_UT_ASSERT(rfop->ffr_be_remid.tri_txid == remid->tri_txid);
327  rc = rfop->ffr_rc;
328 
329  /* release structs */
331 
332  return rc;
333 }
334 
335 
337 {
338  int i;
339  int j;
340  int rc;
341  struct m0_rpc_item *item;
342  struct m0_rpc_bulk *rbulk;
343  struct m0_io_fop **io_fops;
344  struct m0_fop_cob_rw_reply *rw_reply;
345  struct bulkio_params *bp;
346 
347  i = t->ta_index;
348  bp = t->ta_bp;
349  io_fops = (t->ta_op == M0_IOSERVICE_WRITEV_OPCODE) ? bp->bp_wfops :
350  bp->bp_rfops;
351  M0_SET0(&io_fops[i]->if_fop.f_item.ri_sm);
352  rbulk = m0_fop_to_rpcbulk(&io_fops[i]->if_fop);
353  item = &io_fops[i]->if_fop.f_item;
356  rc = m0_rpc_post(item);
357  M0_ASSERT(rc == 0);
358 
360  M0_ASSERT(rc == 0);
362  M0_ASSERT(rw_reply->rwr_rc == 0);
363  bp->bp_remid = rw_reply->rwr_mod_rep.fmr_remid;
364 
365  if (m0_is_read_fop(&io_fops[i]->if_fop)) {
366  for (j = 0; j < bp->bp_iobuf[i]->nb_buffer.ov_vec.v_nr; ++j) {
367  rc = memcmp(bp->bp_iobuf[i]->nb_buffer.ov_buf[j],
368  bp->bp_readbuf,
370  v_count[j]);
371  M0_ASSERT(rc == 0);
372  memset(bp->bp_iobuf[i]->nb_buffer.ov_buf[j], 'a',
373  M0_0VEC_ALIGN);
374  }
375  m0_mutex_lock(&rbulk->rb_mutex);
376  M0_ASSERT(rbulk->rb_rc == 0);
377  m0_mutex_unlock(&rbulk->rb_mutex);
378  }
379 }
380 
382 {
383  int i;
384  int rc;
385 
386  M0_ASSERT(bp != NULL);
387 
388  /* Initialize fids and allocate buffers used for bulk transfer. */
389  io_fids_init(bp);
390 
391  M0_ASSERT(bp->bp_iobuf == NULL);
393  M0_ASSERT(bp->bp_iobuf != NULL);
394 
398  for (i = 0; i < IO_FOPS_NR; ++i) {
400  M0_ASSERT(bp->bp_iobuf[i] != NULL);
402  M0_ASSERT(bp->bp_threads[i] != NULL);
403  }
404 
406  M0_ALLOC_ARR(bp->bp_readbuf, M0_0VEC_ALIGN);
408 
410  M0_ALLOC_ARR(bp->bp_writebuf, M0_0VEC_ALIGN);
412 
415  M0_ASSERT(rc == 0);
418  &bp->bp_cnetdom));
419 
421 
422  for (i = 0; i < IO_FIDS_NR; ++i)
424 
425  bp->bp_rfops = NULL;
426  bp->bp_wfops = NULL;
427 
428  bp->bp_flock_rt.rt_name = "File Lock Resource Type";
429 
432 
433  M0_ASSERT(rc == 0);
434 
435 }
436 
438 {
439  int i;
440 
441  M0_ASSERT(bp != NULL);
442 
444  M0_ASSERT(bp->bp_iobuf != NULL);
446 
447  for (i = 0; i < IO_FOPS_NR; ++i) {
448  m0_free(bp->bp_iobuf[i]);
449  m0_free(bp->bp_threads[i]);
450  }
451  m0_free(bp->bp_iobuf);
453 
458 
459  M0_ASSERT(bp->bp_rfops == NULL);
460  M0_ASSERT(bp->bp_wfops == NULL);
461 
466 }
467 
468 int bulkio_client_start(struct bulkio_params *bp, const char *caddr,
469  const char *saddr)
470 {
471  int rc;
472  char *cdbname;
473  struct m0_rpc_client_ctx *cctx;
474 
475  M0_ASSERT(bp != NULL);
476  M0_ASSERT(caddr != NULL);
477  M0_ASSERT(saddr != NULL);
478 
480  M0_ASSERT(cctx != NULL);
481 
482  cctx->rcx_remote_addr = saddr;
486  cctx->rcx_local_addr = caddr;
489 
490  M0_ALLOC_ARR(cdbname, IO_STR_LEN);
491  M0_ASSERT(cdbname != NULL);
492  strcpy(cdbname, IO_CLIENT_DBNAME);
493 
495  M0_ASSERT(rc == 0);
496 
497  bp->bp_cctx = cctx;
498  bp->bp_saddr = saddr;
499  bp->bp_caddr = caddr;
500  bp->bp_cdbname = cdbname;
501 
502  return rc;
503 }
504 
506 {
507  int rc;
508 
509  M0_ASSERT(cctx != NULL);
510 
512  M0_ASSERT(rc == 0);
513 
514  m0_free(cctx);
515 }
516 
518 {
519  attr->ca_atime = attr->ca_mtime = attr->ca_ctime = 1416970585;
520  attr->ca_nlink = 1;
521  attr->ca_lid = 1;
522  attr->ca_mode = 0100644;
523  attr->ca_uid = attr->ca_gid = 0;
524  attr->ca_size = attr->ca_blocks = 0;
525  attr->ca_valid = M0_COB_ATIME | M0_COB_MTIME | M0_COB_CTIME |
528  M0_COB_MODE;
529 }
M0_INTERNAL int m0_rpc_post(struct m0_rpc_item *item)
Definition: rpc.c:63
#define M0_PRE(cond)
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
Definition: mutex.c:66
void m0_net_domain_fini(struct m0_net_domain *dom)
Definition: domain.c:71
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
Definition: fid_convert.c:46
#define m0_strdup(s)
Definition: string.h:43
enum m0_rpc_item_priority ri_prio
Definition: item.h:133
#define NULL
Definition: misc.h:38
struct m0_thread ** bp_threads
Definition: bulkio_common.h:88
struct m0_net_xprt * bp_xprt
M0_RPC_OPCODES
Definition: rpc_opcodes.h:41
M0_INTERNAL int m0_rpc_bulk_store(struct m0_rpc_bulk *rbulk, const struct m0_rpc_conn *conn, struct m0_net_buf_desc_data *to_desc, const struct m0_net_buffer_callbacks *bulk_cb)
Definition: bulk.c:520
#define S_ADDB_STOBFILE
Definition: bulkio_common.c:32
uint32_t crw_index
Definition: io_fops.h:388
struct m0_bufvec nb_buffer
Definition: net.h:1322
const m0_time_t M0_TIME_NEVER
Definition: time.c:108
M0_INTERNAL int m0_rpc_bulk_buf_databuf_add(struct m0_rpc_bulk_buf *rbuf, void *buf, m0_bcount_t count, m0_bindex_t index, struct m0_net_domain *netdom)
Definition: bulk.c:331
char ** rsx_argv
Definition: rpclib.h:77
int m0_rpc_server_start(struct m0_rpc_server_ctx *sctx)
Definition: rpclib.c:50
struct m0_rpc_server_ctx * bp_sctx
struct m0_vec ov_vec
Definition: vec.h:147
struct m0_rpc_bulk if_rbulk
Definition: io_fops.h:177
struct m0_fop_type m0_fop_fsync_ios_fopt
Definition: io_fops.c:82
struct m0_fid bp_fids[IO_FIDS_NR]
Definition: bulkio_common.h:70
struct m0_net_buf_desc_data * id_descs
Definition: io_fops.h:313
static struct m0_rpc_client_ctx cctx
Definition: rconfc.c:69
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:220
struct m0_rm_resource_type bp_flock_rt
M0_INTERNAL void m0_rm_domain_init(struct m0_rm_domain *dom)
Definition: rm.c:215
#define IO_CLIENT_DBNAME
Definition: bulkio_common.h:59
int bulkio_server_start(struct bulkio_params *bp, const char *saddr)
Definition: bulkio_common.c:82
#define M0_SET0(obj)
Definition: misc.h:64
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
Definition: mutex.c:49
static void io_fids_init(struct bulkio_params *bp)
int32_t ffr_rc
Definition: fsync_fops.h:64
struct m0_fid crw_pver
Definition: io_fops.h:391
static struct m0_rpc_item * item
Definition: item.c:56
int m0_rpc_item_wait_for_reply(struct m0_rpc_item *item, m0_time_t timeout)
Definition: item.c:824
void ** ov_buf
Definition: vec.h:149
struct m0_be_tx_remid bp_remid
int bulkio_client_start(struct bulkio_params *bp, const char *caddr, const char *saddr)
int m0_bufvec_alloc_aligned(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift)
Definition: vec.c:355
M0_INTERNAL void m0_file_lock_type_deregister(struct m0_rm_resource_type *flock_rt)
Definition: file.c:561
uint64_t bp_offsets[IO_FIDS_NR]
Definition: bulkio_common.h:73
op
Definition: libdemo.c:64
Definition: sock.c:754
void io_fops_destroy(struct bulkio_params *bp)
M0_INTERNAL int m0_file_lock_type_register(struct m0_rm_domain *dom, struct m0_rm_resource_type *flock_rt)
Definition: file.c:549
int i
Definition: dir.c:1033
M0_INTERNAL struct m0_rpc_bulk * m0_fop_to_rpcbulk(const struct m0_fop *fop)
Definition: io_fops.c:904
struct m0_fid crw_fid
Definition: io_fops.h:385
char * bp_readbuf
Definition: bulkio_common.h:94
M0_INTERNAL struct m0_fop_cob_rw_reply * io_rw_rep_get(struct m0_fop *fop)
Definition: io_fops.c:1056
struct m0_fop if_fop
Definition: io_fops.h:174
M0_INTERNAL uint64_t m0_rnd(uint64_t max, uint64_t *seed)
Definition: misc.c:115
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition: dump.c:949
if(value==NULL)
Definition: dir.c:350
#define S_DBFILE
Definition: bulkio_common.c:30
#define M0_NET_XPRT_PREFIX_DEFAULT
Definition: net.h:98
static void io_buffers_deallocate(struct bulkio_params *bp)
struct m0_rpc_client_ctx * bp_cctx
#define m0_free0(pptr)
Definition: memory.h:77
int32_t rb_rc
Definition: bulk.h:266
struct m0_io_descs crw_desc
Definition: io_fops.h:400
#define M0_ASSERT(cond)
uint32_t rcx_max_rpc_msg_size
Definition: rpclib.h:156
struct m0_rm_domain bp_rdom
static void io_fop_populate(struct bulkio_params *bp, int index, uint64_t off_index, struct m0_io_fop **io_fops, int segs_nr)
char * bp_writebuf
Definition: bulkio_common.h:95
struct m0_be_tx_remid ffr_be_remid
Definition: fsync_fops.h:70
static struct m0_thread t[8]
Definition: service_ut.c:1230
void io_fops_rpc_submit(struct thrd_arg *t)
struct m0_rpc_conn rcx_connection
Definition: rpclib.h:146
int m0_rpc_client_stop(struct m0_rpc_client_ctx *cctx)
Definition: rpclib.c:217
struct m0_net_xprt * m0_net_xprt_default_get(void)
Definition: net.c:151
void bulkio_params_init(struct bulkio_params *bp)
int m0_rpc_client_start(struct m0_rpc_client_ctx *cctx)
Definition: rpclib.c:160
struct m0_rpc_item * ri_reply
Definition: item.h:163
struct m0_fop_mod_rep rwr_mod_rep
Definition: io_fops.h:339
static struct m0_rpc_server_ctx sctx
Definition: console.c:88
M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid)
Definition: fid_convert.c:81
M0_INTERNAL size_t m0_tlist_length(const struct m0_tl_descr *d, const struct m0_tl *list)
Definition: tlist.c:117
uint32_t rcx_recv_queue_min_length
Definition: rpclib.h:153
M0_INTERNAL struct m0_rpc_machine * session_machine(const struct m0_rpc_session *s)
Definition: session.c:147
uint32_t v_nr
Definition: vec.h:51
static char ** server_argv_alloc(const char *server_ep_addr, int *argc)
Definition: bulkio_common.c:44
void bulkio_client_stop(struct m0_rpc_client_ctx *cctx)
m0_bcount_t * v_count
Definition: vec.h:1319
m0_bcount_t * v_count
Definition: vec.h:53
struct m0_fid * rcx_fid
Definition: rpclib.h:161
uint64_t tri_txid
Definition: tx.h:431
struct m0_rpc_machine machine
Definition: mdstore.c:58
struct m0_net_domain * rcx_net_dom
Definition: rpclib.h:128
M0_TL_DESCR_DECLARE(rpcbulk, M0_EXTERN)
M0_INTERNAL void m0_bufvec_free_aligned(struct m0_bufvec *bufvec, unsigned shift)
Definition: vec.c:436
void cob_attr_default_fill(struct m0_cob_attr *attr)
uint64_t rcx_max_rpcs_in_flight
Definition: rpclib.h:136
struct m0_fop_type m0_fop_cob_readv_fopt
Definition: io_fops.c:71
const char * rt_name
Definition: rm.h:389
uint64_t n
Definition: fops.h:107
struct m0_net_buffer ** bp_iobuf
Definition: bulkio_common.h:85
static uint32_t min32u(uint32_t a, uint32_t b)
Definition: arith.h:56
int m0_net_domain_init(struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
Definition: domain.c:36
char * ep
Definition: sw.h:132
static const struct m0_fid CONF_PVER_FID
Definition: bulkio_common.h:64
int rsx_xprts_nr
Definition: rpclib.h:71
struct m0_rpc_session rcx_session
Definition: rpclib.h:147
Definition: fid.h:38
#define S_STOBFILE
Definition: bulkio_common.c:31
struct m0_io_fop ** bp_rfops
Definition: bulkio_common.h:76
#define IO_SERVER_LOGFILE
Definition: bulkio_common.h:61
static void io_buffers_allocate(struct bulkio_params *bp)
struct m0_be_tx_remid ff_be_remid
Definition: fsync_fops.h:48
#define M0_ALLOC_PTR(ptr)
Definition: memory.h:86
#define M0_UT_CONF_PROCESS
Definition: misc.h:45
uint32_t id_nr
Definition: io_fops.h:312
struct m0_rpc_session * ri_session
Definition: item.h:147
const char * rcx_remote_addr
Definition: rpclib.h:134
struct m0_reqh_service_type m0_ioservice_type
void bulkio_params_fini(struct bulkio_params *bp)
void bulkio_server_stop(struct m0_rpc_server_ctx *sctx)
void m0_fop_put_lock(struct m0_fop *fop)
Definition: fop.c:199
static struct m0_fop * fop
Definition: item.c:57
struct m0_net_domain bp_cnetdom
Definition: bulkio_common.h:99
M0_INTERNAL int32_t m0_net_domain_get_max_buffer_segments(struct m0_net_domain *dom)
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
Definition: fop.c:346
const char * rcx_local_addr
Definition: rpclib.h:131
int io_fsync_send_fop(struct m0_be_tx_remid *remid, struct thrd_arg *t)
void io_fops_create(struct bulkio_params *bp, enum M0_RPC_OPCODES op, int fids_nr, int fops_nr, int segs_nr)
void m0_rpc_server_stop(struct m0_rpc_server_ctx *sctx)
Definition: rpclib.c:85
struct m0_tl rb_buflist
Definition: bulk.h:256
M0_INTERNAL int m0_io_fop_init(struct m0_io_fop *iofop, const struct m0_fid *gfid, struct m0_fop_type *ftype, void(*fop_release)(struct m0_ref *))
Definition: io_fops.c:865
static struct bulkio_params * bp
Definition: bulkio_ut.c:44
#define M0_UT_PATH(name)
Definition: misc.h:41
uint32_t ff_fsync_mode
Definition: fsync_fops.h:51
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
Definition: fid_convert.c:55
M0_INTERNAL bool m0_is_read_fop(const struct m0_fop *fop)
Definition: io_fops.c:916
const struct m0_net_buffer_callbacks m0_rpc__buf_bulk_cb
Definition: bulk.c:238
struct m0_fid gfid
Definition: dir.c:626
const char * bp_saddr
const char * bp_caddr
M0_INTERNAL struct m0_fop_cob_rw * io_rw_get(struct m0_fop *fop)
Definition: io_fops.c:1037
char * bp_slogfile
M0_INTERNAL int m0_io_fop_prepare(struct m0_fop *fop)
Definition: io_fops.c:1513
M0_INTERNAL int m0_rpc_bulk_buf_add(struct m0_rpc_bulk *rbulk, uint32_t segs_nr, m0_bcount_t length, struct m0_net_domain *netdom, struct m0_net_buffer *nb, struct m0_rpc_bulk_buf **out)
Definition: bulk.c:291
struct m0_fop_type m0_fop_cob_writev_fopt
Definition: io_fops.c:72
void m0_free(void *data)
Definition: memory.c:146
struct m0_rpc_item f_item
Definition: fop.h:83
int32_t rc
Definition: trigger_fop.h:47
struct m0_io_fop ** bp_wfops
Definition: bulkio_common.h:79
#define ARRAY_SIZE(a)
Definition: misc.h:45
M0_INTERNAL void m0_rm_domain_fini(struct m0_rm_domain *dom)
Definition: rm.c:227
struct m0_fid g_process_fid
Definition: ut.c:689
#define M0_UT_ASSERT(a)
Definition: ut.h:46
struct m0_be_tx_remid fmr_remid
Definition: fom_generic.h:243
Definition: fop.h:79
struct m0_mutex rb_mutex
Definition: bulk.h:251
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
Definition: fop.c:96
uint32_t bp_seg_nr