Motr  M0
seg0.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 #ifndef __MOTR_BE_SEG0_H__
25 #define __MOTR_BE_SEG0_H__
26 
27 #include "lib/tlist.h"
28 
29 /* import */
30 struct m0_buf;
31 struct m0_be_tx;
32 struct m0_be_domain;
33 
41 struct m0_be_0type {
42 
44  const char *b0_name;
45 
62  int (*b0_init)(struct m0_be_domain *dom, const char *suffix,
63  const struct m0_buf *data);
64 
65  void (*b0_fini)(struct m0_be_domain *dom, const char *suffix,
66  const struct m0_buf *data);
67 
70  uint64_t b0_magic;
71 };
72 
76 void m0_be_0type_register(struct m0_be_domain *dom, struct m0_be_0type *zt);
77 
81 void m0_be_0type_unregister(struct m0_be_domain *dom, struct m0_be_0type *zt);
82 
87  const struct m0_be_0type *zt,
88  const char *suffix,
89  struct m0_be_tx_credit *credit);
90 
95  const struct m0_be_0type *zt,
96  const char *suffix,
97  const struct m0_buf *data,
98  struct m0_be_tx_credit *credit);
99 
103 int m0_be_0type_add(struct m0_be_0type *zt,
104  struct m0_be_domain *dom,
105  struct m0_be_tx *tx,
106  const char *suffix,
107  const struct m0_buf *data);
108 
112 int m0_be_0type_del(struct m0_be_0type *zt,
113  struct m0_be_domain *dom,
114  struct m0_be_tx *tx,
115  const char *suffix);
116 
261 #endif /* __MOTR_BE_SEG0_H__ */
262 
263 /*
264  * Local variables:
265  * c-indentation-style: "K&R"
266  * c-basic-offset: 8
267  * tab-width: 8
268  * fill-column: 80
269  * scroll-step: 1
270  * End:
271  */
272 /*
273  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
274  */
void m0_be_0type_add_credit(struct m0_be_domain *dom, const struct m0_be_0type *zt, const char *suffix, const struct m0_buf *data, struct m0_be_tx_credit *credit)
Definition: seg0.c:139
int(* b0_init)(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
Definition: seg0.h:62
const char * b0_name
Definition: seg0.h:44
void m0_be_0type_del_credit(struct m0_be_domain *dom, const struct m0_be_0type *zt, const char *suffix, struct m0_be_tx_credit *credit)
Definition: seg0.c:156
struct m0_bufvec data
Definition: di.c:40
void m0_be_0type_unregister(struct m0_be_domain *dom, struct m0_be_0type *zt)
Definition: seg0.c:72
Definition: buf.h:37
void m0_be_0type_register(struct m0_be_domain *dom, struct m0_be_0type *zt)
Definition: seg0.c:65
static struct m0_stob_domain * dom
Definition: storage.c:38
struct m0_tlink b0_linkage
Definition: seg0.h:69
void(* b0_fini)(struct m0_be_domain *dom, const char *suffix, const struct m0_buf *data)
Definition: seg0.h:65
int m0_be_0type_add(struct m0_be_0type *zt, struct m0_be_domain *dom, struct m0_be_tx *tx, const char *suffix, const struct m0_buf *data)
Definition: seg0.c:79
int m0_be_0type_del(struct m0_be_0type *zt, struct m0_be_domain *dom, struct m0_be_tx *tx, const char *suffix)
Definition: seg0.c:112
uint64_t b0_magic
Definition: seg0.h:70
Definition: tx.h:280