Motr  M0
fid_convert.h
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 #pragma once
24 
25 #ifndef __MOTR_IOSERVICE_FID_CONVERT_H__
26 #define __MOTR_IOSERVICE_FID_CONVERT_H__
27 
28 #include "lib/types.h" /* uint32_t */
29 
73 struct m0_fid;
74 struct m0_stob_id;
75 
76 enum {
83  M0_AD_STOB_LINUX_DOM_KEY = 0xadf11e, /* AD file */
86 };
87 
88 M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid,
89  uint32_t container,
90  uint64_t key);
91 
92 M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid,
93  struct m0_fid *cob_fid,
94  uint32_t device_id);
95 M0_INTERNAL void m0_fid_convert_cob2gob(const struct m0_fid *cob_fid,
96  struct m0_fid *gob_fid);
97 M0_INTERNAL void m0_fid_convert_cob2stob(const struct m0_fid *cob_fid,
98  struct m0_stob_id *stob_id);
99 
100 M0_INTERNAL void m0_fid_convert_cob2adstob(const struct m0_fid *cob_fid,
101  struct m0_stob_id *stob_id);
102 M0_INTERNAL void m0_fid_convert_adstob2cob(const struct m0_stob_id *stob_id,
103  struct m0_fid *cob_fid);
104 M0_INTERNAL void m0_fid_convert_stob2cob(const struct m0_stob_id *stob_id,
105  struct m0_fid *cob_fid);
106 M0_INTERNAL void
107 m0_fid_convert_bstore2adstob(const struct m0_fid *bstore_fid,
108  struct m0_fid *stob_domain_fid);
109 M0_INTERNAL void
110 m0_fid_convert_adstob2bstore(const struct m0_fid *stob_domain_fid,
111  struct m0_fid *bstore_fid);
112 
113 M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid);
114 M0_INTERNAL uint64_t m0_fid_conf_sdev_device_id(const struct m0_fid *sdev_fid);
115 
116 M0_INTERNAL bool m0_fid_validate_gob(const struct m0_fid *gob_fid);
117 M0_INTERNAL bool m0_fid_validate_cob(const struct m0_fid *cob_fid);
118 M0_INTERNAL bool m0_fid_validate_adstob(const struct m0_stob_id *stob_id);
119 M0_INTERNAL bool m0_fid_validate_bstore(const struct m0_fid *bstore_fid);
120 M0_INTERNAL bool m0_fid_validate_linuxstob(const struct m0_stob_id *stob_id);
121 
122 M0_INTERNAL uint32_t m0_fid__device_id_extract(const struct m0_fid *fid);
123 
125 #endif /* __MOTR_IOSERVICE_FID_CONVERT_H__ */
126 
127 /*
128  * Local variables:
129  * c-indentation-style: "K&R"
130  * c-basic-offset: 8
131  * tab-width: 8
132  * fill-column: 80
133  * scroll-step: 1
134  * End:
135  */
136 /*
137  * vim: tabstop=8 shiftwidth=8 noexpandtab textwidth=80 nowrap
138  */
static struct m0_fid gob_fid
Definition: net.c:115
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
Definition: fid_convert.c:46
struct m0_container container
M0_INTERNAL uint64_t m0_fid_conf_sdev_device_id(const struct m0_fid *sdev_fid)
Definition: fid_convert.c:88
M0_INTERNAL void m0_fid_convert_cob2adstob(const struct m0_fid *cob_fid, struct m0_stob_id *stob_id)
Definition: fid_convert.c:38
M0_INTERNAL void m0_fid_convert_adstob2bstore(const struct m0_fid *stob_domain_fid, struct m0_fid *bstore_fid)
Definition: fid_convert.c:76
M0_INTERNAL bool m0_fid_validate_linuxstob(const struct m0_stob_id *stob_id)
Definition: fid_convert.c:103
struct m0_fid fid
Definition: di.c:46
M0_INTERNAL uint32_t m0_fid__device_id_extract(const struct m0_fid *fid)
Definition: fid_convert.c:40
M0_INTERNAL bool m0_fid_validate_adstob(const struct m0_stob_id *stob_id)
Definition: fid_convert.c:87
M0_INTERNAL void m0_fid_convert_cob2stob(const struct m0_fid *cob_fid, struct m0_stob_id *stob_id)
Definition: fid_convert.c:141
static struct m0_fid cob_fid
Definition: net.c:116
M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid)
Definition: fid_convert.c:81
M0_INTERNAL bool m0_fid_validate_gob(const struct m0_fid *gob_fid)
Definition: fid_convert.c:93
M0_INTERNAL bool m0_fid_validate_bstore(const struct m0_fid *bstore_fid)
Definition: fid_convert.c:98
Definition: fid.h:38
M0_INTERNAL void m0_fid_convert_cob2gob(const struct m0_fid *cob_fid, struct m0_fid *gob_fid)
Definition: fid_convert.c:69
M0_INTERNAL void m0_fid_convert_adstob2cob(const struct m0_stob_id *stob_id, struct m0_fid *cob_fid)
Definition: fid_convert.c:54
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
Definition: fid_convert.c:55
M0_INTERNAL bool m0_fid_validate_cob(const struct m0_fid *cob_fid)
Definition: fid_convert.c:99
M0_INTERNAL void m0_fid_convert_stob2cob(const struct m0_stob_id *stob_id, struct m0_fid *cob_fid)
Definition: fid_convert.c:152
M0_INTERNAL void m0_fid_convert_bstore2adstob(const struct m0_fid *bstore_fid, struct m0_fid *stob_domain_fid)
Definition: fid_convert.c:66
Definition: idx_mock.c:47