Motr  M0
pool_fops.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 
24 #include "lib/errno.h"
25 #include "lib/memory.h"
26 #include "lib/misc.h" /* M0_IN */
27 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_POOL
28 #include "lib/trace.h"
29 #include "fop/fop.h"
30 #include "fop/fop_item_type.h"
31 #include "fop/fom_generic.h"
32 #include "rpc/item.h"
33 #include "rpc/rpc_opcodes.h"
34 #include "rpc/rpc.h"
35 #include "pool/pool_fops_xc.h"
36 
41 
42 M0_INTERNAL void m0_poolmach_fop_fini(void)
43 {
48 }
49 
50 extern struct m0_reqh_service_type m0_ios_type;
51 extern const struct m0_fom_type_ops poolmach_fom_type_ops;
52 
53 extern const struct m0_sm_conf poolmach_conf;
54 extern struct m0_sm_state_descr poolmach_phases[];
55 
56 M0_INTERNAL int m0_poolmach_fop_init(void)
57 {
61  .name = "Pool Machine query request",
63  .xt = m0_fop_poolmach_query_xc,
64  .rpc_flags = M0_RPC_ITEM_TYPE_REQUEST,
65  .fom_ops = &poolmach_fom_type_ops,
66  .svc_type = &m0_ios_type,
67  .sm = &poolmach_conf);
69  .name = "Pool Machine query reply",
71  .xt = m0_fop_poolmach_query_rep_xc,
72  .rpc_flags = M0_RPC_ITEM_TYPE_REPLY);
74  .name = "Pool Machine set request",
76  .xt = m0_fop_poolmach_set_xc,
77  .rpc_flags = M0_RPC_MUTABO_REQ,
78  .fom_ops = &poolmach_fom_type_ops,
79  .sm = &poolmach_conf,
80  .svc_type = &m0_ios_type);
82  .name = "Pool Machine set reply",
84  .xt = m0_fop_poolmach_set_rep_xc,
85  .rpc_flags = M0_RPC_ITEM_TYPE_REPLY);
86  return 0;
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  */
const struct m0_sm_conf poolmach_conf
Definition: pool_foms.c:245
#define M0_FOP_TYPE_INIT(ft,...)
Definition: fop.h:307
Definition: sm.h:350
void m0_fop_type_fini(struct m0_fop_type *fopt)
Definition: fop.c:232
M0_INTERNAL void m0_sm_conf_extend(const struct m0_sm_state_descr *base, struct m0_sm_state_descr *sub, uint32_t nr)
Definition: sm.c:763
static struct m0_xcode_type ** xt[]
Definition: protocol.c:64
const struct m0_sm_conf m0_generic_conf
Definition: fom_generic.c:838
struct m0_fop_type m0_fop_poolmach_set_rep_fopt
Definition: pool_fops.c:40
int opcode
Definition: crate.c:301
M0_INTERNAL void m0_poolmach_fop_fini(void)
Definition: pool_fops.c:42
struct m0_fop_type m0_fop_poolmach_set_fopt
Definition: pool_fops.c:39
const char * name
Definition: trace.c:110
M0_INTERNAL int m0_poolmach_fop_init(void)
Definition: pool_fops.c:56
struct m0_fop_type m0_fop_poolmach_query_fopt
Definition: pool_fops.c:37
uint32_t scf_nr_states
Definition: sm.h:354
struct m0_reqh_service_type m0_ios_type
Definition: io_service.c:112
const struct m0_fom_type_ops poolmach_fom_type_ops
Definition: pool_foms.c:234
struct m0_sm_state_descr * scf_state
Definition: sm.h:356
struct m0_sm_state_descr poolmach_phases[]
Definition: pool_foms.c:238
struct m0_fop_type m0_fop_poolmach_query_rep_fopt
Definition: pool_fops.c:38