21 |
#include "libbb.h" |
#include "libbb.h" |
22 |
#include "volume_id.h" |
#include "volume_id.h" |
23 |
|
|
24 |
#if __GNUC_PREREQ(4,1) |
PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
|
# pragma GCC visibility push(hidden) |
|
|
#endif |
|
25 |
|
|
26 |
#define dbg(...) ((void)0) |
#define dbg(...) ((void)0) |
27 |
/* #define dbg(...) bb_error_msg(__VA_ARGS__) */ |
/* #define dbg(...) bb_error_msg(__VA_ARGS__) */ |
28 |
|
|
|
|
|
29 |
/* volume_id.h */ |
/* volume_id.h */ |
30 |
|
|
31 |
#define VOLUME_ID_VERSION 48 |
#define VOLUME_ID_VERSION 48 |
58 |
#endif |
#endif |
59 |
|
|
60 |
struct volume_id { |
struct volume_id { |
61 |
|
int fd; |
62 |
|
// int fd_close:1; |
63 |
|
int error; |
64 |
|
size_t sbbuf_len; |
65 |
|
size_t seekbuf_len; |
66 |
|
uint8_t *sbbuf; |
67 |
|
uint8_t *seekbuf; |
68 |
|
uint64_t seekbuf_off; |
69 |
|
#ifdef UNUSED_PARTITION_CODE |
70 |
|
struct volume_id_partition *partitions; |
71 |
|
size_t partition_count; |
72 |
|
#endif |
73 |
// uint8_t label_raw[VOLUME_ID_LABEL_SIZE]; |
// uint8_t label_raw[VOLUME_ID_LABEL_SIZE]; |
74 |
// size_t label_raw_len; |
// size_t label_raw_len; |
75 |
char label[VOLUME_ID_LABEL_SIZE+1]; |
char label[VOLUME_ID_LABEL_SIZE+1]; |
81 |
// smallint usage_id; |
// smallint usage_id; |
82 |
// const char *usage; |
// const char *usage; |
83 |
// const char *type; |
// const char *type; |
|
|
|
|
#ifdef UNUSED_PARTITION_CODE |
|
|
struct volume_id_partition *partitions; |
|
|
size_t partition_count; |
|
|
#endif |
|
|
|
|
|
int fd; |
|
|
uint8_t *sbbuf; |
|
|
uint8_t *seekbuf; |
|
|
size_t sbbuf_len; |
|
|
uint64_t seekbuf_off; |
|
|
size_t seekbuf_len; |
|
|
// int fd_close:1; |
|
84 |
}; |
}; |
85 |
|
|
86 |
struct volume_id *volume_id_open_node(int fd); |
struct volume_id* FAST_FUNC volume_id_open_node(int fd); |
87 |
int volume_id_probe_all(struct volume_id *id, uint64_t off, uint64_t size); |
int FAST_FUNC volume_id_probe_all(struct volume_id *id, /*uint64_t off,*/ uint64_t size); |
88 |
void free_volume_id(struct volume_id *id); |
void FAST_FUNC free_volume_id(struct volume_id *id); |
89 |
|
|
90 |
/* util.h */ |
/* util.h */ |
91 |
|
|
162 |
|
|
163 |
/* RAID */ |
/* RAID */ |
164 |
|
|
165 |
//int volume_id_probe_highpoint_37x_raid(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_highpoint_37x_raid(struct volume_id *id /*,uint64_t off*/); |
166 |
//int volume_id_probe_highpoint_45x_raid(struct volume_id *id, uint64_t off, uint64_t size); |
//int FAST_FUNC volume_id_probe_highpoint_45x_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
167 |
|
|
168 |
//int volume_id_probe_intel_software_raid(struct volume_id *id, uint64_t off, uint64_t size); |
//int FAST_FUNC volume_id_probe_intel_software_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
169 |
|
|
170 |
int volume_id_probe_linux_raid(struct volume_id *id, uint64_t off, uint64_t size); |
int FAST_FUNC volume_id_probe_linux_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
171 |
|
|
172 |
//int volume_id_probe_lsi_mega_raid(struct volume_id *id, uint64_t off, uint64_t size); |
//int FAST_FUNC volume_id_probe_lsi_mega_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
173 |
|
|
174 |
//int volume_id_probe_nvidia_raid(struct volume_id *id, uint64_t off, uint64_t size); |
//int FAST_FUNC volume_id_probe_nvidia_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
175 |
|
|
176 |
//int volume_id_probe_promise_fasttrack_raid(struct volume_id *id, uint64_t off, uint64_t size); |
//int FAST_FUNC volume_id_probe_promise_fasttrack_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
177 |
|
|
178 |
//int volume_id_probe_silicon_medley_raid(struct volume_id *id, uint64_t off, uint64_t size); |
//int FAST_FUNC volume_id_probe_silicon_medley_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
179 |
|
|
180 |
//int volume_id_probe_via_raid(struct volume_id *id, uint64_t off, uint64_t size); |
//int FAST_FUNC volume_id_probe_via_raid(struct volume_id *id /*,uint64_t off*/, uint64_t size); |
181 |
|
|
182 |
//int volume_id_probe_lvm1(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_lvm1(struct volume_id *id /*,uint64_t off*/); |
183 |
//int volume_id_probe_lvm2(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_lvm2(struct volume_id *id /*,uint64_t off*/); |
184 |
|
|
185 |
/* FS */ |
/* FS */ |
186 |
|
|
187 |
int volume_id_probe_cramfs(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_btrfs(struct volume_id *id /*,uint64_t off*/); |
188 |
|
|
189 |
int volume_id_probe_ext(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_cramfs(struct volume_id *id /*,uint64_t off*/); |
190 |
|
|
191 |
int volume_id_probe_vfat(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_ext(struct volume_id *id /*,uint64_t off*/); |
192 |
|
|
193 |
int volume_id_probe_hfs_hfsplus(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_vfat(struct volume_id *id /*,uint64_t off*/); |
194 |
|
|
195 |
//int volume_id_probe_hpfs(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_hfs_hfsplus(struct volume_id *id /*,uint64_t off*/); |
196 |
|
|
197 |
int volume_id_probe_iso9660(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_hpfs(struct volume_id *id /*,uint64_t off*/); |
198 |
|
|
199 |
int volume_id_probe_jfs(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_iso9660(struct volume_id *id /*,uint64_t off*/); |
200 |
|
|
201 |
int volume_id_probe_linux_swap(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_jfs(struct volume_id *id /*,uint64_t off*/); |
202 |
|
|
203 |
int volume_id_probe_luks(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_linux_swap(struct volume_id *id /*,uint64_t off*/); |
204 |
|
|
205 |
//int volume_id_probe_mac_partition_map(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_luks(struct volume_id *id /*,uint64_t off*/); |
206 |
|
|
207 |
//int volume_id_probe_minix(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_mac_partition_map(struct volume_id *id /*,uint64_t off*/); |
208 |
|
|
209 |
//int volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_minix(struct volume_id *id /*,uint64_t off*/); |
210 |
|
|
211 |
int volume_id_probe_ntfs(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id /*,uint64_t off*/); |
212 |
|
|
213 |
int volume_id_probe_ocfs2(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_ntfs(struct volume_id *id /*,uint64_t off*/); |
214 |
|
|
215 |
int volume_id_probe_reiserfs(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_ocfs2(struct volume_id *id /*,uint64_t off*/); |
216 |
|
|
217 |
int volume_id_probe_romfs(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_reiserfs(struct volume_id *id /*,uint64_t off*/); |
218 |
|
|
219 |
int volume_id_probe_sysv(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_romfs(struct volume_id *id /*,uint64_t off*/); |
220 |
|
|
221 |
int volume_id_probe_udf(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_sysv(struct volume_id *id /*,uint64_t off*/); |
222 |
|
|
223 |
//int volume_id_probe_ufs(struct volume_id *id, uint64_t off); |
int FAST_FUNC volume_id_probe_udf(struct volume_id *id /*,uint64_t off*/); |
224 |
|
|
225 |
int volume_id_probe_xfs(struct volume_id *id, uint64_t off); |
//int FAST_FUNC volume_id_probe_ufs(struct volume_id *id /*,uint64_t off*/); |
226 |
|
|
227 |
#if __GNUC_PREREQ(4,1) |
int FAST_FUNC volume_id_probe_xfs(struct volume_id *id /*,uint64_t off*/); |
228 |
# pragma GCC visibility pop |
|
229 |
#endif |
POP_SAVED_FUNCTION_VISIBILITY |