Motr  M0
isc.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 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_ISC_H__
26 #define __MOTR_ISC_H__
27 
28 #include "iscservice/isc_fops.h"
29 #include "fop/fom_generic.h"
30 
134  struct m0_fom *icp_fom;
135 
142  void *icp_data;
143 };
144 
148 };
149 
155 /* Public fields: */
156 
158  struct m0_buf icr_args;
171  int icr_rc;
172 /* Private fields: */
191  struct m0_fom icr_fom;
192  struct m0_reqh *icr_reqh;
193 };
194 
205 M0_INTERNAL void m0_isc_comp_req_init(struct m0_isc_comp_req *comp_req,
206  const struct m0_buf *comp_args,
207  const struct m0_fid *comp_fid,
208  const struct m0_cookie *comp_cookie,
209  enum m0_isc_comp_req_type comp_req_type,
210  struct m0_reqh *reqh);
211 
212 M0_INTERNAL void m0_isc_comp_req_fini(struct m0_isc_comp_req *comp_req);
213 
222 M0_INTERNAL int m0_isc_comp_req_exec(struct m0_isc_comp_req *comp_req);
223 
232 M0_INTERNAL int m0_isc_comp_req_exec_sync(struct m0_isc_comp_req *comp_req);
233 
245 M0_INTERNAL int m0_isc_comp_register(int (*ftn)(struct m0_buf *arg_in,
246  struct m0_buf *args_out,
247  struct m0_isc_comp_private
248  *comp_data, int *rc),
249  const char *f_name,
250  const struct m0_fid *ftn_fid);
251 
260 M0_INTERNAL void m0_isc_comp_unregister(const struct m0_fid *fid);
261 
271 M0_INTERNAL int m0_isc_comp_state_probe(const struct m0_fid *fid);
272 
273 /*
274  * Loads a computation library into m0d instances hosting ISC-service.
275  *
276  * The library must be accessible at @libpath on all the nodes where
277  * the m0d instances (processes) are running.
278  */
279 M0_INTERNAL int m0_isc_lib_register(const char *libpath, struct m0_fid *profile,
280  struct m0_reqh *reqh);
281 
286 M0_INTERNAL int m0_isc_io_launch(struct m0_stob_io *stio,
287  struct m0_fid *cob,
288  struct m0_io_indexvec *iv,
289  struct m0_fom *fom);
290 
296 M0_INTERNAL int64_t m0_isc_io_res(struct m0_stob_io *stio, char **buf);
297 
301 M0_INTERNAL void m0_isc_io_fini(struct m0_stob_io *stio);
302 
304 /* __MOTR_ISC_H__ */
305 #endif
306 
307 /*
308  * Local variables:
309  * c-indentation-style: "K&R"
310  * c-basic-offset: 8
311  * tab-width: 8
312  * fill-column: 80
313  * scroll-step: 1
314  * End:
315  */
m0_isc_comp_req_type
Definition: isc.h:145
struct m0_buf icr_result
Definition: isc.h:165
void * icp_data
Definition: isc.h:142
struct m0_fom icr_fom
Definition: isc.h:191
struct m0_chan icr_chan
Definition: isc.h:189
M0_INTERNAL int m0_isc_comp_req_exec_sync(struct m0_isc_comp_req *comp_req)
Definition: isc.c:517
int icr_rc
Definition: isc.h:171
Definition: sock.c:887
struct m0_fom * icp_fom
Definition: isc.h:134
struct m0_fid fid
Definition: di.c:46
Definition: buf.h:37
struct m0_fid icr_comp_fid
Definition: isc.h:167
M0_INTERNAL int64_t m0_isc_io_res(struct m0_stob_io *stio, char **buf)
Definition: isc.c:913
struct m0_mutex icr_guard
Definition: isc.h:187
bool icr_req_bulk
Definition: isc.h:181
M0_INTERNAL int m0_isc_comp_state_probe(const struct m0_fid *fid)
Definition: isc.c:668
static struct m0_cob * cob
Definition: bytecount.c:40
struct m0_reqh * icr_reqh
Definition: isc.h:192
M0_INTERNAL int m0_isc_lib_register(const char *libpath, struct m0_fid *profile, struct m0_reqh *reqh)
Definition: isc.c:730
struct m0_cookie icr_cookie
Definition: isc.h:169
Definition: reqh.h:94
Definition: dump.c:103
Definition: chan.h:229
Definition: io.h:285
M0_INTERNAL int m0_isc_comp_req_exec(struct m0_isc_comp_req *comp_req)
Definition: isc.c:497
M0_INTERNAL void m0_isc_comp_unregister(const struct m0_fid *fid)
Definition: isc.c:652
Definition: fom.h:481
M0_INTERNAL void m0_isc_comp_req_fini(struct m0_isc_comp_req *comp_req)
Definition: isc.c:567
struct m0_reqh reqh
Definition: rm_foms.c:48
static struct m0_fid profile
Definition: rconfc.c:49
M0_INTERNAL void m0_isc_io_fini(struct m0_stob_io *stio)
Definition: isc.c:923
Definition: fid.h:38
M0_INTERNAL void m0_isc_comp_req_init(struct m0_isc_comp_req *comp_req, const struct m0_buf *comp_args, const struct m0_fid *comp_fid, const struct m0_cookie *comp_cookie, enum m0_isc_comp_req_type comp_req_type, struct m0_reqh *reqh)
Definition: isc.c:537
struct m0_buf icr_args
Definition: isc.h:158
enum m0_isc_comp_req_type icr_req_type
Definition: isc.h:177
Definition: mutex.h:47
M0_INTERNAL int m0_isc_comp_register(int(*ftn)(struct m0_buf *arg_in, struct m0_buf *args_out, struct m0_isc_comp_private *comp_data, int *rc), const char *f_name, const struct m0_fid *ftn_fid)
Definition: isc.c:609
int32_t rc
Definition: trigger_fop.h:47
struct m0_isc_comp_private icr_comp_data
Definition: isc.h:186
M0_INTERNAL int m0_isc_io_launch(struct m0_stob_io *stio, struct m0_fid *cob, struct m0_io_indexvec *iv, struct m0_fom *fom)
Definition: isc.c:841