Motr  M0
repair_cp_onwire.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2017-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_DIXCM
24 #include "lib/trace.h"
25 #include "fop/fop.h"
26 #include "cm/cp.h"
27 
28 #include "dix/cm/cm.h"
29 #include "dix/cm/dix_cp_onwire.h"
30 #include "dix/cm/dix_cp_onwire_xc.h"
31 
34 extern struct m0_cm_type dix_repair_cmt;
35 
36 static int dix_repair_cp_fom_create(struct m0_fop *fop, struct m0_fom **m,
37  struct m0_reqh *reqh);
38 
41 };
42 
43 static int dix_repair_cp_fom_create(struct m0_fop *fop, struct m0_fom **m,
44  struct m0_reqh *reqh)
45 {
46  struct m0_fop *r_fop;
47  int rc;
48 
50  if (r_fop == NULL)
51  return M0_ERR(-ENOMEM);
52  rc = m0_cm_cp_fom_create(fop, r_fop, m, reqh);
53 
54  return M0_RC(rc);
55 }
56 
62 M0_INTERNAL void m0_dix_cm_repair_cpx_init(void)
63 {
67  "DIX_Repair_copy_packet", m0_dix_cpx_xc,
73  "DIX_Repair_copy_packet_reply",
74  m0_cpx_reply_xc, M0_RPC_ITEM_TYPE_REPLY,
76 }
77 
83 M0_INTERNAL void m0_dix_cm_repair_cpx_fini(void)
84 {
87 }
88 
89 #undef M0_TRACE_SUBSYSTEM
90 
91 /*
92  * Local variables:
93  * c-indentation-style: "K&R"
94  * c-basic-offset: 8
95  * tab-width: 8
96  * fill-column: 80
97  * scroll-step: 1
98  * End:
99  */
M0_INTERNAL void m0_dix_cm_repair_cpx_init(void)
M0_INTERNAL void m0_dix_cm_repair_cpx_fini(void)
M0_INTERNAL int m0_cm_cp_fom_create(struct m0_fop *fop, struct m0_fop *r_fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: cp.c:454
M0_INTERNAL void m0_dix_cpx_init(struct m0_fop_type *ft, const struct m0_fom_type_ops *fomt_ops, enum M0_RPC_OPCODES op, const char *name, const struct m0_xcode_type *xt, uint64_t rpc_flags, struct m0_cm_type *cmt)
Definition: dix_cp_onwire.c:32
#define NULL
Definition: misc.h:38
static struct m0_addb2_mach * m
Definition: consumer.c:38
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
return M0_RC(rc)
return M0_ERR(-EOPNOTSUPP)
static int dix_repair_cp_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
struct m0_fop_type m0_dix_repair_cpx_reply_fopt
Definition: reqh.h:94
const struct m0_fom_type_ops dix_repair_cp_fom_type_ops
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
Definition: fop.c:129
Definition: fom.h:481
Definition: cm.h:143
struct m0_reqh reqh
Definition: rm_foms.c:48
struct m0_cm_type dix_repair_cmt
Definition: cm.h:173
static struct m0_fop * fop
Definition: item.c:57
struct m0_fop_type m0_dix_repair_cpx_fopt
M0_INTERNAL void m0_dix_cpx_fini(struct m0_fop_type *ft)
Definition: dix_cp_onwire.c:50
int32_t rc
Definition: trigger_fop.h:47
Definition: fop.h:79