Motr  M0
sw_onwire_fop.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_CM
24 
25 #include "lib/trace.h"
26 #include "fop/fop.h"
27 
28 #include "cm/cm.h"
29 
32 
33 #include "cm/repreb/sw_onwire_fop_xc.h"
34 
43 extern struct m0_cm_type sns_rebalance_cmt;
44 
45 static int sns_rebalance_sw_fom_create(struct m0_fop *fop, struct m0_fom **m,
46  struct m0_reqh *reqh)
47 {
48  struct m0_fop *r_fop;
49  int rc;
50 
52  if (r_fop == NULL)
53  return M0_ERR(-ENOMEM);
55 
56  return M0_RC(rc);
57 }
58 
61 };
62 
64 {
68  "sns cm sw update fop",
69  m0_cm_sw_onwire_xc,
75  "sns cm sw update rep fop",
76  m0_cm_sw_onwire_rep_xc,
79 }
80 
82 {
85 }
86 
87 M0_INTERNAL int
89  void (*fop_release)(struct m0_ref *),
90  uint64_t proxy_id, const char *local_ep,
91  const struct m0_cm_sw *sw,
92  const struct m0_cm_sw *out_interval)
93 {
95  fop, fop_release, proxy_id,
96  local_ep, sw, out_interval);
97 }
98 
99 #undef M0_TRACE_SUBSYSTEM
100 
102 /*
103  * Local variables:
104  * c-indentation-style: "K&R"
105  * c-basic-offset: 8
106  * tab-width: 8
107  * fill-column: 80
108  * scroll-step: 1
109  * End:
110  */
M0_INTERNAL void m0_cm_repreb_sw_onwire_fop_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: sw_onwire_fop.c:46
Definition: sw.h:45
#define NULL
Definition: misc.h:38
static struct m0_addb2_mach * m
Definition: consumer.c:38
void fop_release(struct m0_ref *ref)
Definition: stats_ut_svc.c:148
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
Definition: fom.h:650
struct m0_cm_type sns_rebalance_cmt
Definition: cm.c:384
return M0_RC(rc)
static struct m0_cm * cm
Definition: cm.c:63
struct m0_fop_type sns_rebalance_sw_onwire_rep_fopt
Definition: sw_onwire_fop.c:42
return M0_ERR(-EOPNOTSUPP)
Definition: refs.h:34
M0_INTERNAL void m0_sns_cm_rebalance_sw_onwire_fop_fini(void)
Definition: sw_onwire_fop.c:81
Definition: reqh.h:94
M0_INTERNAL void m0_cm_repreb_sw_onwire_fop_fini(struct m0_fop_type *ft)
Definition: sw_onwire_fop.c:64
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
Definition: fop.c:129
M0_INTERNAL int m0_cm_repreb_sw_onwire_fop_setup(struct m0_cm *cm, struct m0_fop_type *ft, struct m0_fop *fop, void(*fop_release)(struct m0_ref *), uint64_t proxy_id, const char *local_ep, const struct m0_cm_sw *sw, const struct m0_cm_sw *out_interval)
Definition: sw_onwire_fop.c:70
const struct m0_fom_type_ops sns_rebalance_sw_fom_type_ops
Definition: sw_onwire_fop.c:59
Definition: fom.h:481
Definition: cm.h:143
struct m0_reqh reqh
Definition: rm_foms.c:48
static const char * local_ep(const struct m0_cm *cm)
Definition: cm_utils.c:397
Definition: cm.h:166
static struct m0_fop * fop
Definition: item.c:57
static int sns_rebalance_sw_fom_create(struct m0_fop *fop, struct m0_fom **m, struct m0_reqh *reqh)
Definition: sw_onwire_fop.c:45
M0_INTERNAL int m0_cm_repreb_sw_onwire_fom_create(struct m0_fop *fop, struct m0_fop *r_fop, struct m0_fom **out, struct m0_reqh *reqh)
int32_t rc
Definition: trigger_fop.h:47
M0_INTERNAL void m0_sns_cm_rebalance_sw_onwire_fop_init(void)
Definition: sw_onwire_fop.c:63
M0_INTERNAL int m0_sns_cm_rebalance_sw_onwire_fop_setup(struct m0_cm *cm, struct m0_fop *fop, void(*fop_release)(struct m0_ref *), uint64_t proxy_id, const char *local_ep, const struct m0_cm_sw *sw, const struct m0_cm_sw *out_interval)
Definition: sw_onwire_fop.c:88
Definition: fop.h:79
struct m0_fop_type sns_rebalance_sw_onwire_fopt
Definition: sw_onwire_fop.c:41