Motr  M0
confd_stob.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2020 Seagate Technology LLC and/or its Affiliates
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * For any questions about this software or licensing,
17  * please email opensource@seagate.com or cortx-questions@seagate.com.
18  *
19  */
20 
21 
22 #pragma once
23 #ifndef __MOTR_CONF_CONFD_STOB_H__
24 #define __MOTR_CONF_CONFD_STOB_H__
25 
26 #include "fid/fid.h"
27 #include "fop/fom.h"
28 #include "stob/domain.h"
29 #include "stob/stob.h"
30 
39 #define M0_CONFD_FID(old_version, new_version, tx_id) \
40  M0_FID_INIT((uint64_t)(old_version) << 32 | (uint64_t)(new_version), \
41  (tx_id))
42 
51 M0_INTERNAL int m0_confd_stob_init(struct m0_stob **stob,
52  const char *location,
53  struct m0_fid *confd_fid);
54 
61 M0_INTERNAL void m0_confd_stob_fini(struct m0_stob *stob);
62 
73 M0_INTERNAL int m0_confd_stob_read(struct m0_stob *stob, char **str);
74 
81 M0_INTERNAL int m0_confd_stob_bufvec_write(struct m0_stob *stob,
82  struct m0_bufvec *bufvec);
83 
91 M0_INTERNAL int m0_confd_stob_write(struct m0_stob *stob, char *str);
92 
101 M0_INTERNAL int m0_conf_stob_location_generate(struct m0_fom *fom,
102  char **location);
103 
105 #endif /* __MOTR_CONF_CONFD_H__ */
106 
107 /*
108  * Local variables:
109  * c-indentation-style: "K&R"
110  * c-basic-offset: 8
111  * tab-width: 8
112  * fill-column: 80
113  * scroll-step: 1
114  * End:
115  */
const char * location
Definition: storage.c:50
void m0_confd_stob_fini(struct m0_stob *stob)
Definition: confd_stob.c:104
M0_INTERNAL int m0_conf_stob_location_generate(struct m0_fom *fom, char **location)
Definition: confd_stob.c:181
Definition: stob.h:163
static struct m0_stob * stob
Definition: storage.c:39
int m0_confd_stob_init(struct m0_stob **stob, const char *location, struct m0_fid *confd_fid)
Definition: confd_stob.c:50
int m0_confd_stob_bufvec_write(struct m0_stob *stob, struct m0_bufvec *bufvec)
Definition: confd_stob.c:159
Definition: dump.c:103
int m0_confd_stob_write(struct m0_stob *stob, char *str)
Definition: confd_stob.c:168
Definition: fom.h:481
Definition: fid.h:38
int m0_confd_stob_read(struct m0_stob *stob, char **str)
Definition: confd_stob.c:135
Definition: vec.h:145