Motr  M0
trigger_fop_common.c
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2015-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 #include "fop/fop.h"
24 #include "fop/fop_item_type.h"
25 
26 #include "sns/cm/cm.h"
27 #include "sns/cm/trigger_fop.h"
28 
29 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_SNSCM
30 #include "lib/trace.h"
31 
32 /*
33  * Implements a simplistic sns repair trigger FOM for corresponding trigger FOP.
34  * This is solely for testing purpose and a separate trigger FOP/FOM will be
35  * implemented later, which would be similar to this one.
36  */
37 
46 
55 
57  uint32_t op,
58  struct m0_fop **fop)
59 {
60  static struct m0_fop_type *sns_fop_type[] = {
71  };
72  M0_ENTRY();
74 
76  return *fop == NULL ? M0_ERR(-ENOMEM) : M0_RC(0);
77 }
78 
79 #undef M0_TRACE_SUBSYSTEM
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  */
struct m0_fop_type m0_sns_rebalance_status_rep_fopt
#define M0_PRE(cond)
struct m0_fop_type m0_sns_rebalance_trigger_fopt
static struct m0_fop_type * sns_fop_type(uint32_t op)
Definition: trigger_fom.c:83
struct m0_fop_type m0_sns_repair_status_rep_fopt
#define NULL
Definition: misc.h:38
struct m0_fop_type m0_sns_rebalance_abort_fopt
static struct m0_addb2_mach * mach
Definition: storage.c:42
return M0_RC(rc)
op
Definition: libdemo.c:64
#define M0_ENTRY(...)
Definition: trace.h:170
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL int m0_sns_cm_trigger_fop_alloc(struct m0_rpc_machine *mach, uint32_t op, struct m0_fop **fop)
struct m0_fop_type m0_sns_repair_quiesce_fopt
struct m0_fop_type m0_sns_repair_abort_rep_fopt
struct m0_fop_type m0_sns_repair_quiesce_rep_fopt
struct m0_fop_type m0_sns_rebalance_quiesce_rep_fopt
struct m0_fop_type m0_sns_rebalance_quiesce_fopt
struct m0_fop_type m0_sns_rebalance_abort_rep_fopt
struct m0_fop_type m0_sns_rebalance_status_fopt
struct m0_fop_type m0_sns_rebalance_trigger_rep_fopt
struct m0_fop_type m0_sns_repair_status_fopt
struct m0_fop_type m0_sns_repair_trigger_fopt
struct m0_fop_type m0_sns_repair_abort_fopt
static struct m0_fop * fop
Definition: item.c:57
#define IS_IN_ARRAY(idx, array)
Definition: misc.h:311
Definition: fop.h:79
struct m0_fop_type m0_sns_repair_trigger_rep_fopt
struct m0_fop * m0_fop_alloc(struct m0_fop_type *fopt, void *data, struct m0_rpc_machine *mach)
Definition: fop.c:96