Motr  M0
storage.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 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_SNSCM
24 #include "lib/trace.h"
25 #include "lib/errno.h"
26 #include "lib/memory.h"
27 #include "motr/setup.h" /* m0_cs_storage_devs_get */
28 
29 #include "lib/finject.h"
30 #include "sns/cm/ag.h"
31 #include "sns/cm/cm.h"
32 #include "sns/cm/cp.h"
33 #include "sns/cm/file.h"
34 
35 #include "stob/domain.h" /* m0_stob_domain_find_by_stob_id */
36 #include "stob/ad.h" /* m0_stob_ad_type */
37 #include "ioservice/storage_dev.h" /* m0_storage_dev_stob_find */
38 #include "ioservice/io_foms.h" /* m0_io_cob_stob_create */
39 #include "ioservice/fid_convert.h" /* m0_fid_convert_stob2cob */
40 #include "cob/cob.h" /* m0_cob_tx_credit */
41 #include "balloc/balloc.h" /* M0_BALLOC_SPARE_ZONE */
42 
48 static int ivec_prepare(struct m0_cm_cp *cp, struct m0_indexvec *iv,
49  m0_bindex_t idx, size_t unit_size, size_t max_buf_size,
50  uint32_t bshift)
51 {
52  size_t seg_size = unit_size < max_buf_size ?
53  unit_size : max_buf_size;
54  uint32_t seg_nr = (unit_size / max_buf_size) +
55  (unit_size % max_buf_size > 0);
56  int rc;
57  int i;
58 
59  M0_PRE(iv != NULL);
60 
62  if (rc != 0)
63  return M0_RC(rc);
64 
65  for (i = 0; i < seg_nr; ++i) {
66  iv->iv_vec.v_count[i] = seg_size >> bshift;
67  iv->iv_index[i] = idx >> bshift;
68  idx += seg_size;
69  }
70 
71  return 0;
72 }
73 
74 static int bufvec_prepare(struct m0_bufvec *obuf, struct m0_tl *cp_buffers_head,
75  uint32_t data_seg_nr, size_t seg_size, uint32_t bshift)
76 {
77  struct m0_net_buffer *nbuf;
78  struct m0_bufvec *ibuf;
79  int i;
80  int j = 0;
81 
82  M0_PRE(obuf != NULL);
83  M0_PRE(!cp_data_buf_tlist_is_empty(cp_buffers_head));
84 
85  obuf->ov_vec.v_nr = data_seg_nr;
86  M0_ALLOC_ARR(obuf->ov_vec.v_count, data_seg_nr);
87  if (obuf->ov_vec.v_count == NULL)
88  return M0_ERR(-ENOMEM);
89 
90  M0_ALLOC_ARR(obuf->ov_buf, data_seg_nr);
91  if (obuf->ov_buf == NULL) {
92  m0_free(obuf->ov_vec.v_count);
93  return M0_ERR(-ENOMEM);
94  }
95 
96  m0_tl_for(cp_data_buf, cp_buffers_head, nbuf) {
97  ibuf = &nbuf->nb_buffer;
98  for (i = 0; i < nbuf->nb_pool->nbp_seg_nr && j < data_seg_nr;
99  ++i, ++j) {
100  obuf->ov_vec.v_count[j] = seg_size >> bshift;
101  obuf->ov_buf[j] = m0_stob_addr_pack(ibuf->ov_buf[i],
102  bshift);
103  }
104  } m0_tl_endfor;
105 
106  M0_POST(j == data_seg_nr);
107 
108  return 0;
109 }
110 
111 static void bufvec_free(struct m0_bufvec *bv)
112 {
113  m0_free(bv->ov_vec.v_count);
114  m0_free(bv->ov_buf);
115 }
116 
117 static int cp_prepare(struct m0_cm_cp *cp,
118  struct m0_indexvec *dst_ivec,
119  struct m0_bufvec *dst_bvec,
120  m0_bindex_t start_idx, uint32_t bshift)
121 {
122  struct m0_net_buffer *nbuf;
123  uint32_t data_seg_nr;
124  size_t unit_size;
125  size_t max_buf_size;
126  size_t seg_size;
127  uint32_t seg_nr;
128  int rc;
129 
131  M0_PRE(!cp_data_buf_tlist_is_empty(&cp->c_buffers));
132 
133  nbuf = cp_data_buf_tlist_head(&cp->c_buffers);
134  data_seg_nr = cp->c_data_seg_nr;
135  seg_size = nbuf->nb_pool->nbp_seg_size;
136  seg_nr = nbuf->nb_pool->nbp_seg_nr;
137  unit_size = data_seg_nr * seg_size;
138  max_buf_size = seg_size * seg_nr;
139  rc = ivec_prepare(cp, dst_ivec, start_idx, unit_size,
140  max_buf_size, bshift);
141  if (rc != 0)
142  return M0_RC(rc);
143  rc = bufvec_prepare(dst_bvec, &cp->c_buffers, data_seg_nr, seg_size,
144  bshift);
145  if (rc != 0)
146  m0_indexvec_free(dst_ivec);
147 
148  return M0_RC(rc);
149 }
150 
151 static int cp_stob_io_init(struct m0_cm_cp *cp, const enum m0_stob_io_opcode op)
152 {
153  struct m0_sns_cm_cp *sns_cp;
154  struct m0_stob_io *stio;
155  uint32_t bshift;
156  int rc;
157 
158  M0_ENTRY("cp=%p op=%d", cp, op);
159 
160  if (M0_FI_ENABLED("no-stob"))
161  return M0_ERR(-ENOENT);
162 
163  sns_cp = cp2snscp(cp);
164  stio = &sns_cp->sc_stio;
165 
167  &sns_cp->sc_stob_id, &sns_cp->sc_stob);
168  if (rc == 0) {
169  M0_LOG(M0_DEBUG, "fom %p, %p stob found, fid="FID_F
170  ", state %d, so_ref %"PRIu64, &cp->c_fom,
171  sns_cp->sc_stob, FID_P(&sns_cp->sc_stob_id.si_fid),
172  m0_stob_state_get(sns_cp->sc_stob),
173  sns_cp->sc_stob->so_ref);
174  m0_stob_io_init(stio);
175  stio->si_flags = 0;
176  stio->si_opcode = op;
177  stio->si_fol_frag = &sns_cp->sc_fol_frag;
178  bshift = m0_stob_block_shift(sns_cp->sc_stob);
179 
180  rc = cp_prepare(cp, &stio->si_stob, &stio->si_user,
181  sns_cp->sc_index, bshift);
182  } else
184  "fom %p, ag_id "M0_AG_F", stob not found, rc %d",
185  &cp->c_fom, M0_AG_P(&cp->c_ag->cag_id), rc);
186  return rc;
187 }
188 
189 M0_INTERNAL struct m0_cob_domain *m0_sns_cm_cp2cdom(struct m0_cm_cp *cp)
190 {
191  return cm2sns(cp->c_ag->cag_cm)->sc_cob_dom;
192 }
193 
194 static int cob_stob_check(struct m0_cm_cp *cp)
195 {
196  struct m0_fid fid;
197  struct m0_sns_cm_file_ctx *fctx;
198  struct m0_fid *pver;
199  struct m0_cob *cob;
200 
201  fctx = ag2snsag(cp->c_ag)->sag_fctx;
202  pver = &fctx->sf_attr.ca_pver;
203  m0_fid_convert_stob2cob(&cp2snscp(cp)->sc_stob_id, &fid);
204 
206  pver, fctx->sf_attr.ca_lid, true, &cob);
207 }
208 
209 static int cp_stob_release_exts(struct m0_stob *stob,
210  struct m0_indexvec *range,
211  struct m0_dtx *dtx)
212 {
213  if (M0_FI_ENABLED("no-stob-punch"))
214  return 0;
216 
217  return stob->so_ops->sop_punch(stob, range, dtx);
218 }
219 
221 {
222  return M0_IN(io->si_state, (SIS_IDLE, SIS_BUSY));
223 }
224 
225 static int cp_io(struct m0_cm_cp *cp, const enum m0_stob_io_opcode op)
226 {
227  struct m0_fom *cp_fom;
228  struct m0_sns_cm_cp *sns_cp;
229  struct m0_stob *stob;
230  struct m0_stob_io *stio;
231  enum m0_stob_state stob_state;
232 #ifdef __SPARE_SPACE__
233  struct m0_sns_cm *sns_cm;
234  enum m0_sns_cm_op sns_op;
235 #endif
236  uint64_t balloc_flags = M0_BALLOC_NORMAL_ZONE;
237  int rc;
238 
239  M0_ENTRY("cp=%p op=%d", cp, op);
240 
241  sns_cp = cp2snscp(cp);
242  cp_fom = &cp->c_fom;
243  stio = &sns_cp->sc_stio;
244  if (!cp_stob_io_is_initialised(stio)) {
245  rc = cp_stob_io_init(cp, op);
246  if (rc != 0)
247  goto out;
248  }
249 
250  rc = m0_sns_cm_cp_tx_open(cp);
251  if (rc != 0)
252  goto out;
253  if (op == SIO_WRITE) {
254  rc = cob_stob_check(cp);
255  if (rc != 0)
256  goto out;
257  }
258  stob = sns_cp->sc_stob;
259  stob_state = m0_stob_state_get(stob);
260  if (stob_state != CSS_EXISTS) {
261  rc = -ENOENT;
262  goto out;
263  }
264  M0_LOG(M0_DEBUG, "fom %p, stob %p, fid="FID_F" so_state %d, "
265  "so_ref %"PRIu64, cp_fom, sns_cp->sc_stob,
266  FID_P(&stob->so_id.si_fid), stob_state, stob->so_ref);
267  m0_mutex_lock(&stio->si_mutex);
268  m0_fom_wait_on(cp_fom, &stio->si_wait, &cp_fom->fo_cb);
269  m0_mutex_unlock(&stio->si_mutex);
270  if (M0_FI_ENABLED("io-fail"))
271  rc = M0_ERR(-EIO);
272  else {
274  if (rc == 0) {
275 #ifdef __SPARE_SPACE__
276  sns_cm = M0_AMB(sns_cm, cp->c_ag->cag_cm, sc_base);
277  /*
278  * @todo: Handle in better way as these enums for SNS
279  * ops are on the way to get deprecated.
280  */
281  sns_op = (enum m0_sns_cm_op) sns_cm->sc_op;
282  if (sns_op == SNS_REPAIR)
283  balloc_flags |= M0_BALLOC_SPARE_ZONE;
284 #endif
286  &m0_stob_ad_type))
287  m0_stob_ad_balloc_set(stio, balloc_flags);
288  if (op == SIO_WRITE && sns_cp->sc_spare_punch) {
290  &cp_fom->fo_tx);
291  }
292  if (rc == 0) {
294  &cp_fom->fo_tx,
295  NULL);
296  }
297  } else {
298  M0_LOG(M0_ERROR, "Launching IO against the stob with"
299  "id "FID_F"is not feasible",
300  FID_P(&stob->so_id.si_fid));
301  }
302  }
303  if (rc != 0) {
304  m0_mutex_lock(&stio->si_mutex);
305  m0_fom_callback_cancel(&cp_fom->fo_cb);
306  m0_mutex_unlock(&stio->si_mutex);
307  m0_indexvec_free(&stio->si_stob);
308  bufvec_free(&stio->si_user);
309  m0_stob_io_fini(stio);
311  }
312 out:
313  if (rc != 0) {
314  if (rc < 0) {
315  m0_fom_phase_move(cp_fom, rc, M0_CCP_FAIL);
316  rc = M0_FSO_AGAIN;
317  }
318  return rc;
319  }
320  return cp->c_ops->co_phase_next(cp);
321 }
322 
323 
324 M0_INTERNAL int m0_sns_cm_cp_read(struct m0_cm_cp *cp)
325 {
326  cp->c_io_op = M0_CM_CP_READ;
327  return cp_io(cp, SIO_READ);
328 }
329 
330 M0_INTERNAL int m0_sns_cm_cp_write_pre(struct m0_cm_cp *cp)
331 {
332  M0_IMPOSSIBLE("M0_CCP_WRITE_PRE phase shouldn't be used!");
333 }
334 
335 M0_INTERNAL int m0_sns_cm_cp_write(struct m0_cm_cp *cp)
336 {
337  cp->c_io_op = M0_CM_CP_WRITE;
338  return cp_io(cp, SIO_WRITE);
339 }
340 
341 M0_INTERNAL int m0_sns_cm_cp_io_wait(struct m0_cm_cp *cp)
342 {
343  struct m0_sns_cm_cp *sns_cp = cp2snscp(cp);
344  struct m0_stob_io *stio;
345  struct m0_cob *cob;
346  struct m0_cob_oikey oikey;
347  struct m0_cob_domain *cdom;
348  struct m0_be_tx *betx;
349  uint64_t io_size;
350  int rc;
351 
352  M0_ENTRY("cp=%p", cp);
353 
354  stio = &sns_cp->sc_stio;
355  rc = sns_cp->sc_stio.si_rc;
356  /*
357  * Update cob size after writing to spare.
358  */
359  betx = m0_fom_tx(&cp->c_fom);
360  if (rc == 0 && cp->c_io_op == M0_CM_CP_WRITE &&
361  m0_be_tx_state(betx) == M0_BTS_ACTIVE) {
362  io_size = m0_io_size(stio, m0_stob_block_shift(sns_cp->sc_stob));
363  cdom = m0_sns_cm_cp2cdom(cp);
364  m0_cob_oikey_make(&oikey, &sns_cp->sc_cobfid, 0);
365  rc = m0_cob_locate(cdom, &oikey, 0, &cob);
366  if (rc == 0) {
367  io_size = max64u(cob->co_nsrec.cnr_size, io_size);
368  rc = m0_cob_size_update(cob, io_size, betx);
369  }
370  }
371  if (rc == 0) {
373  if (rc > 0)
374  return rc;
375  }
376  cp->c_ops->co_complete(cp);
377 
378  /* Cleanup before proceeding to next phase. */
379  m0_indexvec_free(&sns_cp->sc_stio.si_stob);
380  bufvec_free(&sns_cp->sc_stio.si_user);
381  m0_stob_io_fini(&sns_cp->sc_stio);
383 
384  if (rc != 0) {
385  M0_LOG(M0_ERROR, "stob io failed with rc=%d", rc);
387  return M0_FSO_AGAIN;
388  }
389  return cp->c_ops->co_phase_next(cp);
390 }
391 
394 #undef M0_TRACE_SUBSYSTEM
395 
396 /*
397  * Local variables:
398  * c-indentation-style: "K&R"
399  * c-basic-offset: 8
400  * tab-width: 8
401  * fill-column: 80
402  * scroll-step: 1
403  * End:
404  */
static m0_bcount_t seg_size
Definition: net.c:118
struct m0_cob_nsrec co_nsrec
Definition: cob.h:590
uint64_t ca_lid
Definition: cob.h:380
Definition: cm.h:205
static int ivec_prepare(struct m0_cm_cp *cp, struct m0_indexvec *iv, m0_bindex_t idx, size_t unit_size, size_t max_buf_size, uint32_t bshift)
Definition: storage.c:48
#define M0_PRE(cond)
#define M0_ALLOC_ARR(arr, nr)
Definition: memory.h:84
Definition: dtm.h:554
enum m0_stob_io_flags si_flags
Definition: io.h:290
Definition: cob.h:581
int(* sop_punch)(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
Definition: stob.h:199
static int cob_stob_check(struct m0_cm_cp *cp)
Definition: storage.c:194
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
Definition: mutex.c:66
struct m0_net_buffer_pool * nb_pool
Definition: net.h:1508
static int cp_io(struct m0_cm_cp *cp, const enum m0_stob_io_opcode op)
Definition: storage.c:225
M0_INTERNAL void m0_stob_io_fini(struct m0_stob_io *io)
Definition: io.c:122
uint64_t cnr_size
Definition: cob.h:430
M0_INTERNAL int m0_indexvec_alloc(struct m0_indexvec *ivec, uint32_t len)
Definition: vec.c:532
static uint32_t seg_nr
Definition: net.c:119
#define NULL
Definition: misc.h:38
#define M0_AG_P(ag)
Definition: ag.h:55
Definition: io.h:230
struct m0_stob_id sc_stob_id
Definition: cp.h:45
struct m0_bufvec nb_buffer
Definition: net.h:1322
const struct m0_stob_ops * so_ops
Definition: stob.h:164
M0_INTERNAL struct m0_sns_cm * cm2sns(struct m0_cm *cm)
Definition: cm.c:389
M0_INTERNAL struct m0_cob_domain * m0_sns_cm_cp2cdom(struct m0_cm_cp *cp)
Definition: storage.c:189
M0_INTERNAL int m0_storage_dev_stob_find(struct m0_storage_devs *devs, struct m0_stob_id *sid, struct m0_stob **stob)
Definition: storage_dev.c:868
m0_bcount_t nbp_seg_size
Definition: buffer_pool.h:255
m0_be_tx_state
Definition: tx.h:214
M0_INTERNAL void m0_storage_dev_stob_put(struct m0_storage_devs *devs, struct m0_stob *stob)
Definition: storage_dev.c:912
#define M0_LOG(level,...)
Definition: trace.h:167
Definition: cp.h:160
static int cp_prepare(struct m0_cm_cp *cp, struct m0_indexvec *dst_ivec, struct m0_bufvec *dst_bvec, m0_bindex_t start_idx, uint32_t bshift)
Definition: storage.c:117
static int cp_stob_release_exts(struct m0_stob *stob, struct m0_indexvec *range, struct m0_dtx *dtx)
Definition: storage.c:209
struct m0_vec ov_vec
Definition: vec.h:147
M0_INTERNAL bool m0_stob_domain_is_of_type(const struct m0_stob_domain *dom, const struct m0_stob_type *dt)
Definition: domain.c:349
const struct m0_stob_type m0_stob_ad_type
Definition: ad.c:1003
struct m0_cm_ag_id cag_id
Definition: ag.h:72
M0_INTERNAL void m0_indexvec_free(struct m0_indexvec *ivec)
Definition: vec.c:553
M0_INTERNAL void m0_stob_ad_balloc_set(struct m0_stob_io *io, uint64_t flags)
Definition: ad.c:2204
struct m0_dtx fo_tx
Definition: fom.h:498
uint64_t m0_bindex_t
Definition: types.h:80
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
Definition: fom.c:1490
struct m0_chan si_wait
Definition: io.h:318
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
Definition: mutex.c:49
M0_INTERNAL int m0_io_cob_stob_create(struct m0_fom *fom, struct m0_cob_domain *cdom, struct m0_fid *fid, struct m0_fid *pver, uint64_t lid, bool crow, struct m0_cob **out)
Definition: io_foms.c:951
static struct m0_cob_domain * cdom
Definition: xform.c:55
void ** ov_buf
Definition: vec.h:149
M0_INTERNAL int m0_cob_size_update(struct m0_cob *cob, uint64_t size, struct m0_be_tx *tx)
Definition: cob.c:2144
struct m0_stob * sc_stob
Definition: cp.h:66
static struct m0_be_tx * m0_fom_tx(struct m0_fom *fom)
Definition: fom.h:537
struct m0_stob_domain * so_domain
Definition: stob.h:165
M0_INTERNAL int m0_sns_cm_cp_write_pre(struct m0_cm_cp *cp)
Definition: storage.c:330
#define m0_tl_endfor
Definition: tlist.h:700
struct m0_fid fid
Definition: di.c:46
struct m0_vec iv_vec
Definition: vec.h:139
return M0_RC(rc)
op
Definition: libdemo.c:64
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
Definition: stob.c:270
struct m0_bufvec si_user
Definition: io.h:300
static uint32_t unit_size
Definition: layout.c:53
#define M0_ENTRY(...)
Definition: trace.h:170
enum m0_cm_op sc_op
Definition: cm.h:209
struct m0_fid sc_cobfid
Definition: cp.h:42
m0_bindex_t * iv_index
Definition: vec.h:141
#define M0_AG_F
Definition: ag.h:54
int i
Definition: dir.c:1033
#define PRIu64
Definition: types.h:58
enum m0_cm_cp_io_op c_io_op
Definition: cp.h:196
return M0_ERR(-EOPNOTSUPP)
static int bufvec_prepare(struct m0_bufvec *obuf, struct m0_tl *cp_buffers_head, uint32_t data_seg_nr, size_t seg_size, uint32_t bshift)
Definition: storage.c:74
#define M0_AMB(obj, ptr, field)
Definition: misc.h:320
if(value==NULL)
Definition: dir.c:350
M0_INTERNAL int m0_stob_io_prepare_and_launch(struct m0_stob_io *io, struct m0_stob *obj, struct m0_dtx *tx, struct m0_io_scope *scope)
Definition: io.c:219
Definition: stob.h:163
struct m0_indexvec si_stob
Definition: io.h:311
int32_t si_rc
Definition: io.h:334
static struct m0_stob * stob
Definition: storage.c:39
static struct m0_cob * cob
Definition: bytecount.c:40
M0_INTERNAL int m0_sns_cm_cp_write(struct m0_cm_cp *cp)
Definition: storage.c:335
m0_stob_io_opcode
Definition: io.h:227
struct m0_fid pver
Definition: idx_dix.c:74
struct m0_stob_io sc_stio
Definition: cp.h:63
uint32_t c_data_seg_nr
Definition: cp.h:190
M0_INTERNAL int m0_sns_cm_cp_io_wait(struct m0_cm_cp *cp)
Definition: storage.c:341
void m0_fom_phase_move(struct m0_fom *fom, int32_t rc, int phase)
Definition: fom.c:1699
M0_INTERNAL void m0_cob_oikey_make(struct m0_cob_oikey *oikey, const struct m0_fid *fid, int linkno)
Definition: cob.c:141
Definition: tlist.h:251
struct m0_cm * cag_cm
Definition: ag.h:70
m0_bindex_t sc_index
Definition: cp.h:60
m0_sns_cm_op
Definition: cm.h:103
const struct m0_cm_cp_ops * c_ops
Definition: cp.h:169
Definition: io.h:244
M0_INTERNAL void * m0_stob_addr_pack(const void *buf, uint32_t shift)
Definition: io.c:293
struct m0_fid si_fid
Definition: stob.h:105
M0_INTERNAL int m0_stob_io_private_setup(struct m0_stob_io *io, struct m0_stob *obj)
Definition: io.c:49
struct m0_fol_frag * si_fol_frag
Definition: io.h:390
#define M0_POST(cond)
uint32_t v_nr
Definition: vec.h:51
enum m0_stob_io_state si_state
Definition: io.h:345
Definition: io.h:255
struct m0_cm_aggr_group * c_ag
Definition: cp.h:172
Definition: io.h:285
m0_bcount_t * v_count
Definition: vec.h:53
M0_INTERNAL struct m0_sns_cm_cp * cp2snscp(const struct m0_cm_cp *cp)
Definition: cp.c:57
uint64_t so_ref
Definition: stob.h:168
struct m0_cob_domain * sc_cob_dom
Definition: cm.h:217
#define FID_P(f)
Definition: fid.h:77
static struct m0_stob_io io
Definition: ad.c:59
M0_INTERNAL struct m0_storage_devs * m0_cs_storage_devs_get(void)
Definition: setup.c:1783
M0_INTERNAL int m0_sns_cm_cp_tx_open(struct m0_cm_cp *cp)
Definition: cp.c:146
struct m0_fid ca_pver
Definition: cob.h:366
bool sc_spare_punch
Definition: cp.h:78
struct m0_mutex si_mutex
Definition: io.h:319
Definition: fom.h:481
static bool cp_stob_io_is_initialised(struct m0_stob_io *io)
Definition: storage.c:220
struct m0_sns_cm_file_ctx * sag_fctx
Definition: ag.h:48
M0_INTERNAL enum m0_stob_state m0_stob_state_get(struct m0_stob *stob)
Definition: stob.c:265
M0_INTERNAL int m0_sns_cm_cp_read(struct m0_cm_cp *cp)
Definition: storage.c:324
static void bufvec_free(struct m0_bufvec *bv)
Definition: storage.c:111
M0_INTERNAL uint64_t m0_io_size(struct m0_stob_io *sio, uint32_t bshift)
Definition: io_foms.c:1670
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
Definition: fid.h:38
void(* co_complete)(struct m0_cm_cp *cp)
Definition: cp.h:244
m0_stob_state
Definition: stob.h:81
int(* co_phase_next)(struct m0_cm_cp *cp)
Definition: cp.h:232
M0_INTERNAL void m0_fom_callback_cancel(struct m0_fom_callback *cb)
Definition: fom.c:1514
M0_INTERNAL int m0_cob_locate(struct m0_cob_domain *dom, struct m0_cob_oikey *oikey, uint64_t flags, struct m0_cob **out)
Definition: cob.c:1407
M0_INTERNAL void m0_stob_io_init(struct m0_stob_io *io)
Definition: io.c:111
struct m0_tl c_buffers
Definition: cp.h:184
struct m0_cm sc_base
Definition: cm.h:206
struct m0_cob_attr sf_attr
Definition: file.h:65
static struct m0_sns_cm_file_ctx fctx
Definition: net.c:55
Definition: cm.h:105
#define out(...)
Definition: gen.c:41
M0_INTERNAL int m0_sns_cm_cp_tx_close(struct m0_cm_cp *cp)
Definition: cp.c:187
struct m0_fom c_fom
Definition: cp.h:161
Definition: io.h:229
#define m0_tl_for(name, head, obj)
Definition: tlist.h:695
void m0_free(void *data)
Definition: memory.c:146
M0_INTERNAL void m0_fid_convert_stob2cob(const struct m0_stob_id *stob_id, struct m0_fid *cob_fid)
Definition: fid_convert.c:152
M0_INTERNAL bool m0_cm_cp_invariant(const struct m0_cm_cp *cp)
Definition: cp.c:587
M0_INTERNAL struct m0_sns_cm_ag * ag2snsag(const struct m0_cm_aggr_group *ag)
Definition: ag.c:391
int32_t rc
Definition: trigger_fop.h:47
static int cp_stob_io_init(struct m0_cm_cp *cp, const enum m0_stob_io_opcode op)
Definition: storage.c:151
struct m0_stob_id so_id
Definition: stob.h:166
struct m0_fol_frag sc_fol_frag
Definition: cp.h:83
struct m0_fom_callback fo_cb
Definition: fom.h:488
static uint64_t max64u(uint64_t a, uint64_t b)
Definition: arith.h:71
#define FID_F
Definition: fid.h:75
Definition: vec.h:145
Definition: tx.h:280
#define M0_IMPOSSIBLE(fmt,...)
enum m0_stob_io_opcode si_opcode
Definition: io.h:286