Motr  M0
repair_cp_onwire.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_SNSCM
24 #include "lib/trace.h"
25 #include "fop/fop.h"
26 
27 #include "sns/cm/cm.h"
28 #include "sns/cm/sns_cp_onwire.h"
29 #include "sns/cm/sns_cp_onwire_xc.h"
30 
33 extern struct m0_cm_type sns_repair_cmt;
34 
35 static int repair_cp_fom_create(struct m0_fop *fop, struct m0_fom **m,
36  struct m0_reqh *reqh);
37 
38 M0_INTERNAL const struct m0_fom_type_ops repair_cp_fom_type_ops = {
40 };
41 
42 static int repair_cp_fom_create(struct m0_fop *fop, struct m0_fom **m,
43  struct m0_reqh *reqh)
44 {
45  struct m0_fop *r_fop;
46  int rc;
47 
49  if (r_fop == NULL)
50  return M0_ERR(-ENOMEM);
51  rc = m0_cm_cp_fom_create(fop, r_fop, m, reqh);
52 
53  return M0_RC(rc);
54 }
55 
56 M0_INTERNAL void m0_sns_cm_repair_cpx_init(void)
57 {
61  "SNS Repair copy packet", m0_sns_cpx_xc,
67  "SNS Repair copy packet reply",
68  m0_sns_cpx_reply_xc, M0_RPC_ITEM_TYPE_REPLY,
70 }
71 
72 M0_INTERNAL void m0_sns_cm_repair_cpx_fini(void)
73 {
76 }
77 
78 #undef M0_TRACE_SUBSYSTEM
79 
80 /*
81  * Local variables:
82  * c-indentation-style: "K&R"
83  * c-basic-offset: 8
84  * tab-width: 8
85  * fill-column: 80
86  * scroll-step: 1
87  * End:
88  */
static int repair_cp_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
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
#define NULL
Definition: misc.h:38
static struct m0_addb2_mach * m
Definition: consumer.c:38
M0_INTERNAL void m0_sns_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: sns_cp_onwire.c:29
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
return M0_RC(rc)
M0_INTERNAL void m0_sns_cm_repair_cpx_init(void)
M0_INTERNAL const struct m0_fom_type_ops repair_cp_fom_type_ops
M0_INTERNAL void m0_sns_cpx_fini(struct m0_fop_type *ft)
Definition: sns_cp_onwire.c:46
return M0_ERR(-EOPNOTSUPP)
struct m0_fop_type m0_sns_repair_cpx_fopt
struct m0_cm_type sns_repair_cmt
Definition: cm.c:383
Definition: reqh.h:94
M0_INTERNAL void m0_sns_cm_repair_cpx_fini(void)
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
static struct m0_fop * fop
Definition: item.c:57
struct m0_fop_type m0_sns_repair_cpx_reply_fopt
int32_t rc
Definition: trigger_fop.h:47
Definition: fop.h:79