Motr  M0
load_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/finject.h" /* M0_FI_ENABLED */
28 #include "lib/memory.h"
29 #include "conf/load_fop.h"
30 #include "net/net.h" /* m0_net_domain_get_max_buffer_segment_size */
31 
32 /* tlists and tlist APIs referred from rpc layer. */
33 M0_TL_DESCR_DECLARE(rpcbulk, M0_EXTERN);
34 
35 M0_INTERNAL bool m0_is_conf_load_fop(const struct m0_fop *fop)
36 {
37  M0_PRE(fop != NULL);
38  return fop->f_type == &m0_fop_conf_load_fopt;
39 }
40 
41 M0_INTERNAL bool m0_is_conf_load_fop_rep(const struct m0_fop *fop)
42 {
43  M0_PRE(fop != NULL);
45 }
46 
48  const struct m0_fop *fop)
49 {
50  M0_PRE(fop != NULL);
52 
53  return m0_fop_data(fop);
54 }
55 
57  const struct m0_fop *fop)
58 {
59  M0_PRE(fop != NULL);
61 
62  return m0_fop_data(fop);
63 }
64 
66 {
67  struct m0_net_domain *dom;
68 
69  if (M0_FI_ENABLED("const_size"))
70  return 4096;
73 }
74 
75 #undef M0_TRACE_SUBSYSTEM
76 
77 /*
78  * Local variables:
79  * c-indentation-style: "K&R"
80  * c-basic-offset: 8
81  * tab-width: 8
82  * fill-column: 80
83  * scroll-step: 1
84  * End:
85  */
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_segment_size(struct m0_net_domain *dom)
#define M0_PRE(cond)
M0_INTERNAL struct m0_fop_conf_load * m0_conf_fop_to_load_fop(const struct m0_fop *fop)
Definition: load_fop.c:47
#define NULL
Definition: misc.h:38
void * m0_fop_data(const struct m0_fop *fop)
Definition: fop.c:220
uint64_t m0_bcount_t
Definition: types.h:77
M0_INTERNAL m0_bcount_t m0_conf_segment_size(struct m0_fop *fop)
Definition: load_fop.c:65
struct m0_fop_type m0_fop_conf_load_fopt
Definition: fop.c:58
struct m0_fop_type m0_fop_conf_load_rep_fopt
Definition: fop.c:59
struct m0_fop_type * f_type
Definition: fop.h:81
M0_INTERNAL bool m0_is_conf_load_fop_rep(const struct m0_fop *fop)
Definition: load_fop.c:41
static struct m0_stob_domain * dom
Definition: storage.c:38
M0_INTERNAL bool m0_is_conf_load_fop(const struct m0_fop *fop)
Definition: load_fop.c:35
#define M0_FI_ENABLED(tag)
Definition: finject.h:231
struct m0_net_domain * m0_fop_domain_get(const struct m0_fop *fop)
Definition: fop.c:486
static struct m0_fop * fop
Definition: item.c:57
M0_INTERNAL struct m0_fop_conf_load_rep * m0_conf_fop_to_load_fop_rep(const struct m0_fop *fop)
Definition: load_fop.c:56
Definition: fop.h:79
M0_TL_DESCR_DECLARE(rpcbulk, M0_EXTERN)