Motr  M0
stob.h
Go to the documentation of this file.
1 /* -*- C -*- */
2 /*
3  * Copyright (c) 2014-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 #pragma once
24 
25 #ifndef __MOTR_UT_STOB_H__
26 #define __MOTR_UT_STOB_H__
27 
28 #include "lib/types.h" /* uint64_t */
29 #include "module/module.h" /* m0_module */
30 
37 struct m0_stob;
38 struct m0_stob_domain;
39 struct m0_be_tx_credit;
40 struct ut_stob_module;
41 struct m0_stob_id;
42 struct m0_be_domain;
43 
44 enum {
46 };
47 
51 };
52 
53 extern struct m0_modlev m0_levels_ut_stob[];
54 extern const unsigned m0_levels_ut_stob_nr;
55 
56 M0_INTERNAL struct m0_stob *m0_ut_stob_linux_get(void);
57 M0_INTERNAL struct m0_stob *m0_ut_stob_linux_create(char *stob_create_cfg);
58 M0_INTERNAL struct m0_stob *m0_ut_stob_linux_get_by_key(uint64_t stob_key);
59 M0_INTERNAL void m0_ut_stob_put(struct m0_stob *stob, bool destroy);
60 
61 M0_INTERNAL int m0_ut_stob_create(struct m0_stob *stob, const char *str_cfg,
62  struct m0_be_domain *be_dom);
63 M0_INTERNAL int m0_ut_stob_destroy(struct m0_stob *stob,
64  struct m0_be_domain *be_dom);
65 M0_INTERNAL struct m0_stob *m0_ut_stob_open(struct m0_stob_domain *dom,
66  uint64_t stob_key,
67  const char *str_cfg);
68 M0_INTERNAL void m0_ut_stob_close(struct m0_stob *stob, bool destroy);
69 
70 M0_INTERNAL int m0_ut_stob_create_by_stob_id(struct m0_stob_id *stob_id,
71  const char *str_cfg);
72 M0_INTERNAL int m0_ut_stob_destroy_by_stob_id(struct m0_stob_id *stob_id);
73 
74 /* XXX move somewhere else */
75 M0_INTERNAL struct m0_dtx *m0_ut_dtx_open(struct m0_be_tx_credit *cred,
76  struct m0_be_domain *be_dom);
77 M0_INTERNAL void m0_ut_dtx_close(struct m0_dtx *dtx);
78 
79 M0_INTERNAL int m0_ut_stob_init(void);
80 M0_INTERNAL void m0_ut_stob_fini(void);
81 
83 #endif /* __MOTR_UT_STOB_H__ */
84 
85 /*
86  * Local variables:
87  * c-indentation-style: "K&R"
88  * c-basic-offset: 8
89  * tab-width: 8
90  * fill-column: 80
91  * scroll-step: 1
92  * End:
93  */
94 /*
95  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
96  */
Definition: dtm.h:554
M0_INTERNAL struct m0_stob * m0_ut_stob_open(struct m0_stob_domain *dom, uint64_t stob_key, const char *str_cfg)
Definition: stob.c:274
M0_INTERNAL void m0_ut_stob_close(struct m0_stob *stob, bool destroy)
Definition: stob.c:292
struct ut_stob_module * usm_private
Definition: stob.h:50
M0_INTERNAL int m0_ut_stob_destroy_by_stob_id(struct m0_stob_id *stob_id)
Definition: stob.c:317
M0_INTERNAL int m0_ut_stob_destroy(struct m0_stob *stob, struct m0_be_domain *be_dom)
Definition: stob.c:222
M0_INTERNAL struct m0_stob * m0_ut_stob_linux_get_by_key(uint64_t stob_key)
Definition: stob.c:174
M0_INTERNAL struct m0_stob * m0_ut_stob_linux_get(void)
Definition: stob.c:169
Definition: stob.h:163
static struct m0_stob * stob
Definition: storage.c:39
static struct m0_stob_domain * dom
Definition: storage.c:38
M0_INTERNAL void m0_ut_stob_put(struct m0_stob *stob, bool destroy)
Definition: stob.c:185
const unsigned m0_levels_ut_stob_nr
Definition: stob.c:67
M0_INTERNAL int m0_ut_stob_create_by_stob_id(struct m0_stob_id *stob_id, const char *str_cfg)
Definition: stob.c:301
M0_INTERNAL void m0_ut_stob_fini(void)
Definition: stob.c:123
M0_INTERNAL void m0_ut_dtx_close(struct m0_dtx *dtx)
Definition: stob.c:359
M0_INTERNAL struct m0_dtx * m0_ut_dtx_open(struct m0_be_tx_credit *cred, struct m0_be_domain *be_dom)
Definition: stob.c:333
M0_INTERNAL int m0_ut_stob_create(struct m0_stob *stob, const char *str_cfg, struct m0_be_domain *be_dom)
Definition: stob.c:202
M0_INTERNAL int m0_ut_stob_init(void)
Definition: stob.c:106
struct m0_module usm_module
Definition: stob.h:49
struct m0_modlev m0_levels_ut_stob[]
Definition: stob.c:60
M0_INTERNAL struct m0_stob * m0_ut_stob_linux_create(char *stob_create_cfg)
Definition: stob.c:179