Motr  M0
rebalance_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 M0_EXTERN struct m0_cm_type dix_rebalance_cmt;
35 
36 
37 static int dix_rebalance_cp_fom_create(struct m0_fop *fop, struct m0_fom **m,
38  struct m0_reqh *reqh);
39 
42 };
43 
44 static int dix_rebalance_cp_fom_create(struct m0_fop *fop, struct m0_fom **m,
45  struct m0_reqh *reqh)
46 {
47  struct m0_fop *r_fop;
48  int rc;
49 
51  if (r_fop == NULL)
52  return M0_ERR(-ENOMEM);
53  rc = m0_cm_cp_fom_create(fop, r_fop, m, reqh);
54 
55  return M0_RC(rc);
56 }
57 
63 M0_INTERNAL void m0_dix_cm_rebalance_cpx_init(void)
64 {
68  "DIX_Rebalance_copy_packet", m0_dix_cpx_xc,
74  "DIX_Rebalance_copy_packet_reply",
75  m0_cpx_reply_xc, M0_RPC_ITEM_TYPE_REPLY,
77 }
78 
84 M0_INTERNAL void m0_dix_cm_rebalance_cpx_fini(void)
85 {
88 }
89 
90 #undef M0_TRACE_SUBSYSTEM
91 
92 /*
93  * Local variables:
94  * c-indentation-style: "K&R"
95  * c-basic-offset: 8
96  * tab-width: 8
97  * fill-column: 80
98  * scroll-step: 1
99  * End:
100  */
static int dix_rebalance_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
const struct m0_fom_type_ops dix_rebalance_cp_fom_type_ops
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
M0_INTERNAL void m0_dix_cm_rebalance_cpx_fini(void)
return M0_RC(rc)
return M0_ERR(-EOPNOTSUPP)
Definition: reqh.h:94
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
Definition: fop.c:129
struct m0_fop_type m0_dix_rebalance_cpx_fopt
Definition: fom.h:481
Definition: cm.h:143
struct m0_reqh reqh
Definition: rm_foms.c:48
struct m0_fop_type m0_dix_rebalance_cpx_reply_fopt
M0_EXTERN struct m0_cm_type dix_rebalance_cmt
M0_INTERNAL void m0_dix_cm_rebalance_cpx_init(void)
static struct m0_fop * fop
Definition: item.c:57
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