Motr  M0
flip_fop.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 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CONF
24 
25 #include "lib/trace.h"
26 #include "lib/errno.h"
27 #include "lib/memory.h"
28 #include "conf/flip_fop.h"
29 
30 M0_INTERNAL bool m0_is_conf_flip_fop(const struct m0_fop *fop)
31 {
32  M0_PRE(fop != NULL);
33  return fop->f_type == &m0_fop_conf_flip_fopt;
34 }
35 
36 M0_INTERNAL bool m0_is_conf_flip_fop_rep(const struct m0_fop *fop)
37 {
38  M0_PRE(fop != NULL);
40 }
41 
43  const struct m0_fop *fop)
44 {
45  M0_PRE(fop != NULL);
47 
48  return m0_fop_data(fop);
49 }
50 
52  const struct m0_fop *fop)
53 {
54  M0_PRE(fop != NULL);
56 
57  return m0_fop_data(fop);
58 }
59 
60 #undef M0_TRACE_SUBSYSTEM
61 
62 /*
63  * Local variables:
64  * c-indentation-style: "K&R"
65  * c-basic-offset: 8
66  * tab-width: 8
67  * fill-column: 80
68  * scroll-step: 1
69  * End:
70  */
#define M0_PRE(cond)
#define NULL
Definition: misc.h:38
struct m0_fop_type m0_fop_conf_flip_rep_fopt
Definition: fop.c:68
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:220
struct m0_fop_type * f_type
Definition: fop.h:81
struct m0_fop_type m0_fop_conf_flip_fopt
Definition: fop.c:67
static struct m0_fop * fop
Definition: item.c:57
M0_INTERNAL bool m0_is_conf_flip_fop_rep(const struct m0_fop *fop)
Definition: flip_fop.c:36
M0_INTERNAL struct m0_fop_conf_flip * m0_conf_fop_to_flip_fop(const struct m0_fop *fop)
Definition: flip_fop.c:42
M0_INTERNAL bool m0_is_conf_flip_fop(const struct m0_fop *fop)
Definition: flip_fop.c:30
M0_INTERNAL struct m0_fop_conf_flip_rep * m0_conf_fop_to_flip_fop_rep(const struct m0_fop *fop)
Definition: flip_fop.c:51
Definition: fop.h:79