Motr  M0
rebalance_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_rebalance_cmt;
34 
35 static int rebalance_cp_fom_create(struct m0_fop *fop, struct m0_fom **m,
36  struct m0_reqh *reqh);
37 
40 };
41 
42 static int rebalance_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 
57 M0_INTERNAL void m0_sns_cm_rebalance_cpx_init(void)
58 {
62  "SNS Rebalance copy packet", m0_sns_cpx_xc,
68  "SNS Rebalance copy packet reply",
69  m0_sns_cpx_reply_xc, M0_RPC_ITEM_TYPE_REPLY,
71 }
72 
73 M0_INTERNAL void m0_sns_cm_rebalance_cpx_fini(void)
74 {
77 }
78 
79 #undef M0_TRACE_SUBSYSTEM
80 
81 /*
82  * Local variables:
83  * c-indentation-style: "K&R"
84  * c-basic-offset: 8
85  * tab-width: 8
86  * fill-column: 80
87  * scroll-step: 1
88  * End:
89  */
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
static int rebalance_cp_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
struct m0_fop_type m0_sns_rebalance_cpx_reply_fopt
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
const struct m0_fom_type_ops rebalance_cp_fom_type_ops
return M0_RC(rc)
M0_INTERNAL void m0_sns_cpx_fini(struct m0_fop_type *ft)
Definition: sns_cp_onwire.c:46
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL void m0_sns_cm_rebalance_cpx_init(void)
M0_INTERNAL void m0_sns_cm_rebalance_cpx_fini(void)
Definition: reqh.h:94
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 sns_rebalance_cmt
Definition: cm.c:384
static struct m0_fop * fop
Definition: item.c:57
int32_t rc
Definition: trigger_fop.h:47
Definition: fop.h:79
struct m0_fop_type m0_sns_rebalance_cpx_fopt