/src/e2fsprogs/lib/ext2fs/ext2fs.h
Line | Count | Source |
1 | | /* |
2 | | * ext2fs.h --- ext2fs |
3 | | * |
4 | | * Copyright (C) 1993, 1994, 1995, 1996 Theodore Ts'o. |
5 | | * |
6 | | * %Begin-Header% |
7 | | * This file may be redistributed under the terms of the GNU Library |
8 | | * General Public License, version 2. |
9 | | * %End-Header% |
10 | | */ |
11 | | |
12 | | #ifndef _EXT2FS_EXT2FS_H |
13 | | #define _EXT2FS_EXT2FS_H |
14 | | |
15 | | #ifdef __GNUC__ |
16 | | #define EXT2FS_ATTR(x) __attribute__(x) |
17 | | #else |
18 | | #define EXT2FS_ATTR(x) |
19 | | #endif |
20 | | |
21 | | #ifndef __nonstring |
22 | | #ifdef __has_attribute |
23 | | #if __has_attribute(__nonstring__) |
24 | | #define __nonstring __attribute__((__nonstring__)) |
25 | | #else |
26 | | #define __nonstring |
27 | | #endif /* __has_attribute(__nonstring__) */ |
28 | | #else |
29 | | # define __nonstring |
30 | | #endif /* __has_attribute */ |
31 | | #endif /* __nonstring */ |
32 | | |
33 | | #ifdef CONFIG_TDB |
34 | | #define EXT2FS_NO_TDB_UNUSED |
35 | | #else |
36 | | #define EXT2FS_NO_TDB_UNUSED EXT2FS_ATTR((unused)) |
37 | | #endif |
38 | | |
39 | | #ifdef __cplusplus |
40 | | extern "C" { |
41 | | #endif |
42 | | |
43 | | /* |
44 | | * Non-GNU C compilers won't necessarily understand inline |
45 | | */ |
46 | | #if (!defined(__GNUC__) && !defined(__WATCOMC__)) |
47 | | #define NO_INLINE_FUNCS |
48 | | #endif |
49 | | |
50 | | /* |
51 | | * Where the master copy of the superblock is located, and how big |
52 | | * superblocks are supposed to be. We define SUPERBLOCK_SIZE because |
53 | | * the size of the superblock structure is not necessarily trustworthy |
54 | | * (some versions have the padding set up so that the superblock is |
55 | | * 1032 bytes long). |
56 | | */ |
57 | 0 | #define SUPERBLOCK_OFFSET 1024 |
58 | 1.79k | #define SUPERBLOCK_SIZE 1024 |
59 | | |
60 | | #define UUID_STR_SIZE 37 |
61 | | |
62 | | /* |
63 | | * The last ext2fs revision level that this version of the library is |
64 | | * able to support. |
65 | | */ |
66 | 575 | #define EXT2_LIB_CURRENT_REV EXT2_DYNAMIC_REV |
67 | | |
68 | | #ifdef HAVE_SYS_TYPES_H |
69 | | #include <sys/types.h> |
70 | | #endif |
71 | | |
72 | | #include <stdio.h> |
73 | | #include <stdlib.h> |
74 | | #include <string.h> |
75 | | #include <time.h> |
76 | | #include <errno.h> |
77 | | |
78 | | #if EXT2_FLAT_INCLUDES |
79 | | #include "e2_types.h" |
80 | | #include "ext2_fs.h" |
81 | | #include "ext3_extents.h" |
82 | | #else |
83 | | #include <ext2fs/ext2_types.h> |
84 | | #include <ext2fs/ext2_fs.h> |
85 | | #include <ext2fs/ext3_extents.h> |
86 | | #endif /* EXT2_FLAT_INCLUDES */ |
87 | | |
88 | | typedef __u32 __bitwise ext2_ino_t; |
89 | | typedef __u32 __bitwise blk_t; |
90 | | typedef __u64 __bitwise blk64_t; |
91 | | typedef __u32 __bitwise dgrp_t; |
92 | | typedef __s32 __bitwise ext2_off_t; |
93 | | typedef __s64 __bitwise ext2_off64_t; |
94 | | typedef __s64 __bitwise e2_blkcnt_t; |
95 | | typedef __u32 __bitwise ext2_dirhash_t; |
96 | | |
97 | | #if EXT2_FLAT_INCLUDES |
98 | | #include "com_err.h" |
99 | | #include "ext2_io.h" |
100 | | #include "ext2_err.h" |
101 | | #include "ext2_ext_attr.h" |
102 | | #else |
103 | | #include <et/com_err.h> |
104 | | #include <ext2fs/ext2_io.h> |
105 | | #include <ext2fs/ext2_err.h> |
106 | | #include <ext2fs/ext2_ext_attr.h> |
107 | | #endif |
108 | | |
109 | | #include "hashmap.h" |
110 | | |
111 | | /* |
112 | | * Portability help for Microsoft Visual C++ |
113 | | */ |
114 | | #ifdef _MSC_VER |
115 | | #define EXT2_QSORT_TYPE int __cdecl |
116 | | #else |
117 | | #define EXT2_QSORT_TYPE int |
118 | | #endif |
119 | | |
120 | | typedef struct struct_ext2_filsys *ext2_filsys; |
121 | | |
122 | 2.71k | #define EXT2FS_MARK_ERROR 0 |
123 | 13.4k | #define EXT2FS_UNMARK_ERROR 1 |
124 | 0 | #define EXT2FS_TEST_ERROR 2 |
125 | | |
126 | | struct ext2fs_struct_generic_bitmap_base { |
127 | | errcode_t magic; |
128 | | ext2_filsys fs; |
129 | | }; |
130 | | |
131 | | typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_generic_bitmap; |
132 | | typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_inode_bitmap; |
133 | | typedef struct ext2fs_struct_generic_bitmap_base *ext2fs_block_bitmap; |
134 | | |
135 | 0 | #define EXT2_FIRST_INODE(s) EXT2_FIRST_INO(s) |
136 | | |
137 | | |
138 | | /* |
139 | | * Badblocks list definitions |
140 | | */ |
141 | | |
142 | | typedef struct ext2_struct_u32_list *ext2_badblocks_list; |
143 | | typedef struct ext2_struct_u32_iterate *ext2_badblocks_iterate; |
144 | | |
145 | | typedef struct ext2_struct_u32_list *ext2_u32_list; |
146 | | typedef struct ext2_struct_u32_iterate *ext2_u32_iterate; |
147 | | |
148 | | /* old */ |
149 | | typedef struct ext2_struct_u32_list *badblocks_list; |
150 | | typedef struct ext2_struct_u32_iterate *badblocks_iterate; |
151 | | |
152 | | #define BADBLOCKS_FLAG_DIRTY 1 |
153 | | |
154 | | /* |
155 | | * ext2_dblist structure and abstractions (see dblist.c) |
156 | | */ |
157 | | struct ext2_db_entry2 { |
158 | | ext2_ino_t ino; |
159 | | blk64_t blk; |
160 | | e2_blkcnt_t blockcnt; |
161 | | }; |
162 | | |
163 | | /* Ye Olde 32-bit version */ |
164 | | struct ext2_db_entry { |
165 | | ext2_ino_t ino; |
166 | | blk_t blk; |
167 | | int blockcnt; |
168 | | }; |
169 | | |
170 | | typedef struct ext2_struct_dblist *ext2_dblist; |
171 | | |
172 | | #define DBLIST_ABORT 1 |
173 | | |
174 | | /* |
175 | | * ext2_fileio definitions |
176 | | */ |
177 | | |
178 | 0 | #define EXT2_FILE_WRITE 0x0001 |
179 | 0 | #define EXT2_FILE_CREATE 0x0002 |
180 | | |
181 | 0 | #define EXT2_FILE_MASK 0x00FF |
182 | | |
183 | 0 | #define EXT2_FILE_BUF_DIRTY 0x4000 |
184 | 0 | #define EXT2_FILE_BUF_VALID 0x2000 |
185 | | |
186 | | typedef struct ext2_file *ext2_file_t; |
187 | | |
188 | 0 | #define EXT2_SEEK_SET 0 |
189 | 0 | #define EXT2_SEEK_CUR 1 |
190 | 0 | #define EXT2_SEEK_END 2 |
191 | | |
192 | | /* |
193 | | * Flags for the ext2_filsys structure and for ext2fs_open() |
194 | | */ |
195 | 1.39k | #define EXT2_FLAG_RW 0x01 |
196 | 0 | #define EXT2_FLAG_CHANGED 0x02 |
197 | 495 | #define EXT2_FLAG_DIRTY 0x04 |
198 | 0 | #define EXT2_FLAG_VALID 0x08 |
199 | 17 | #define EXT2_FLAG_IB_DIRTY 0x10 |
200 | 285 | #define EXT2_FLAG_BB_DIRTY 0x20 |
201 | 595 | #define EXT2_FLAG_SWAP_BYTES 0x40 |
202 | | #define EXT2_FLAG_SWAP_BYTES_READ 0x80 |
203 | | #define EXT2_FLAG_SWAP_BYTES_WRITE 0x100 |
204 | 595 | #define EXT2_FLAG_MASTER_SB_ONLY 0x200 |
205 | 575 | #define EXT2_FLAG_FORCE 0x400 |
206 | 555 | #define EXT2_FLAG_SUPER_ONLY 0x800 |
207 | 569 | #define EXT2_FLAG_JOURNAL_DEV_OK 0x1000 |
208 | 1.17k | #define EXT2_FLAG_IMAGE_FILE 0x2000 |
209 | 712 | #define EXT2_FLAG_EXCLUSIVE 0x4000 |
210 | 1.14k | #define EXT2_FLAG_SOFTSUPP_FEATURES 0x8000 |
211 | 595 | #define EXT2_FLAG_NOFREE_ON_ERROR 0x10000 |
212 | 390 | #define EXT2_FLAG_64BITS 0x20000 |
213 | | #define EXT2_FLAG_PRINT_PROGRESS 0x40000 |
214 | 595 | #define EXT2_FLAG_DIRECT_IO 0x80000 |
215 | 117 | #define EXT2_FLAG_SKIP_MMP 0x100000 |
216 | 14.2k | #define EXT2_FLAG_IGNORE_CSUM_ERRORS 0x200000 |
217 | 495 | #define EXT2_FLAG_SHARE_DUP 0x400000 |
218 | 722 | #define EXT2_FLAG_IGNORE_SB_ERRORS 0x800000 |
219 | 9.37k | #define EXT2_FLAG_BBITMAP_TAIL_PROBLEM 0x1000000 |
220 | 446 | #define EXT2_FLAG_IBITMAP_TAIL_PROBLEM 0x2000000 |
221 | 595 | #define EXT2_FLAG_THREADS 0x4000000 |
222 | | #define EXT2_FLAG_IGNORE_SWAP_DIRENT 0x8000000 |
223 | | |
224 | | /* |
225 | | * Internal flags for use by the ext2fs library only |
226 | | */ |
227 | 0 | #define EXT2_FLAG2_USE_FAKE_TIME 0x000000001 |
228 | | |
229 | | /* |
230 | | * Special flag in the ext2 inode i_flag field that means that this is |
231 | | * a new inode. (So that ext2_write_inode() can clear extra fields.) |
232 | | */ |
233 | | #define EXT2_NEW_INODE_FL 0x80000000 |
234 | | |
235 | | /* |
236 | | * Flags for mkjournal |
237 | | */ |
238 | 0 | #define EXT2_MKJOURNAL_V1_SUPER 0x0000001 /* create V1 superblock (deprecated) */ |
239 | 0 | #define EXT2_MKJOURNAL_LAZYINIT 0x0000002 /* don't zero journal inode before use*/ |
240 | 0 | #define EXT2_MKJOURNAL_NO_MNT_CHECK 0x0000004 /* don't check mount status */ |
241 | | |
242 | | /* |
243 | | * Normal journal area size to fast commit area size ratio. This is used to |
244 | | * set default size of fast commit area. |
245 | | */ |
246 | 0 | #define EXT2_JOURNAL_TO_FC_BLKS_RATIO 64 |
247 | | |
248 | | struct blk_alloc_ctx; |
249 | | struct opaque_ext2_group_desc; |
250 | | |
251 | | struct struct_ext2_filsys { |
252 | | errcode_t magic; |
253 | | io_channel io; |
254 | | int flags; |
255 | | char * device_name; |
256 | | struct ext2_super_block * super; |
257 | | unsigned int blocksize; |
258 | | int fragsize; |
259 | | dgrp_t group_desc_count; |
260 | | unsigned long desc_blocks; |
261 | | struct opaque_ext2_group_desc * group_desc; |
262 | | unsigned int inode_blocks_per_group; |
263 | | ext2fs_inode_bitmap inode_map; |
264 | | ext2fs_block_bitmap block_map; |
265 | | /* XXX FIXME-64: not 64-bit safe, but not used? */ |
266 | | errcode_t (*get_blocks)(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks); |
267 | | errcode_t (*check_directory)(ext2_filsys fs, ext2_ino_t ino); |
268 | | errcode_t (*write_bitmaps)(ext2_filsys fs); |
269 | | errcode_t (*read_inode)(ext2_filsys fs, ext2_ino_t ino, |
270 | | struct ext2_inode *inode); |
271 | | errcode_t (*write_inode)(ext2_filsys fs, ext2_ino_t ino, |
272 | | struct ext2_inode *inode); |
273 | | ext2_badblocks_list badblocks; |
274 | | ext2_dblist dblist; |
275 | | __u32 stride; /* for mke2fs */ |
276 | | struct ext2_super_block * orig_super; |
277 | | struct ext2_image_hdr * image_header; |
278 | | __u32 umask; |
279 | | time_t now; |
280 | | int cluster_ratio_bits; |
281 | | __u16 default_bitmap_type; |
282 | | __u16 pad; |
283 | | __u32 flags2; |
284 | | /* |
285 | | * Reserved for future expansion |
286 | | */ |
287 | | __u32 reserved[4]; |
288 | | |
289 | | /* |
290 | | * Reserved for the use of the calling application. |
291 | | */ |
292 | | void * priv_data; |
293 | | |
294 | | /* |
295 | | * Inode cache |
296 | | */ |
297 | | struct ext2_inode_cache *icache; |
298 | | io_channel image_io; |
299 | | |
300 | | /* |
301 | | * More callback functions |
302 | | */ |
303 | | errcode_t (*get_alloc_block)(ext2_filsys fs, blk64_t goal, |
304 | | blk64_t *ret); |
305 | | errcode_t (*get_alloc_block2)(ext2_filsys fs, blk64_t goal, |
306 | | blk64_t *ret, struct blk_alloc_ctx *ctx); |
307 | | void (*block_alloc_stats)(ext2_filsys fs, blk64_t blk, int inuse); |
308 | | |
309 | | /* |
310 | | * Buffers for Multiple mount protection(MMP) block. |
311 | | */ |
312 | | void *mmp_buf; |
313 | | void *mmp_cmp; |
314 | | int mmp_fd; |
315 | | |
316 | | /* |
317 | | * Time at which e2fsck last updated the MMP block. |
318 | | */ |
319 | | long mmp_last_written; |
320 | | |
321 | | /* progress operation functions */ |
322 | | struct ext2fs_progress_ops *progress_ops; |
323 | | |
324 | | /* Precomputed FS UUID checksum for seeding other checksums */ |
325 | | __u32 csum_seed; |
326 | | |
327 | | io_channel journal_io; |
328 | | char *journal_name; |
329 | | |
330 | | /* New block range allocation hooks */ |
331 | | errcode_t (*new_range)(ext2_filsys fs, int flags, blk64_t goal, |
332 | | blk64_t len, blk64_t *pblk, blk64_t *plen); |
333 | | void (*block_alloc_stats_range)(ext2_filsys fs, blk64_t blk, blk_t num, |
334 | | int inuse); |
335 | | |
336 | | /* hashmap for SHA of data blocks */ |
337 | | struct ext2fs_hashmap* block_sha_map; |
338 | | |
339 | | const struct ext2fs_nls_table *encoding; |
340 | | }; |
341 | | |
342 | | #if EXT2_FLAT_INCLUDES |
343 | | #include "e2_bitops.h" |
344 | | #else |
345 | | #include <ext2fs/bitops.h> |
346 | | #endif |
347 | | |
348 | | /* |
349 | | * 64-bit bitmap backend types |
350 | | */ |
351 | 0 | #define EXT2FS_BMAP64_BITARRAY 1 |
352 | 0 | #define EXT2FS_BMAP64_RBTREE 2 |
353 | 0 | #define EXT2FS_BMAP64_AUTODIR 3 |
354 | | |
355 | | /* |
356 | | * Return flags for the block iterator functions |
357 | | */ |
358 | 0 | #define BLOCK_CHANGED 1 |
359 | 0 | #define BLOCK_ABORT 2 |
360 | 0 | #define BLOCK_ERROR 4 |
361 | 0 | #define BLOCK_INLINE_DATA_CHANGED 8 |
362 | | |
363 | | /* |
364 | | * Block iterate flags |
365 | | * |
366 | | * BLOCK_FLAG_APPEND, or BLOCK_FLAG_HOLE, indicates that the iterator |
367 | | * function should be called on blocks where the block number is zero. |
368 | | * This is used by ext2fs_expand_dir() to be able to add a new block |
369 | | * to an inode. It can also be used for programs that want to be able |
370 | | * to deal with files that contain "holes". |
371 | | * |
372 | | * BLOCK_FLAG_DEPTH_TRAVERSE indicates that the iterator function for |
373 | | * the indirect, doubly indirect, etc. blocks should be called after |
374 | | * all of the blocks contained in the indirect blocks are processed. |
375 | | * This is useful if you are going to be deallocating blocks from an |
376 | | * inode. |
377 | | * |
378 | | * BLOCK_FLAG_DATA_ONLY indicates that the iterator function should be |
379 | | * called for data blocks only. |
380 | | * |
381 | | * BLOCK_FLAG_READ_ONLY is a promise by the caller that it will not |
382 | | * modify returned block number. |
383 | | * |
384 | | * BLOCK_FLAG_NO_LARGE is for internal use only. It informs |
385 | | * ext2fs_block_iterate2 that large files won't be accepted. |
386 | | */ |
387 | 0 | #define BLOCK_FLAG_APPEND 1 |
388 | | #define BLOCK_FLAG_HOLE 1 |
389 | 0 | #define BLOCK_FLAG_DEPTH_TRAVERSE 2 |
390 | 0 | #define BLOCK_FLAG_DATA_ONLY 4 |
391 | 0 | #define BLOCK_FLAG_READ_ONLY 8 |
392 | | |
393 | 0 | #define BLOCK_FLAG_NO_LARGE 0x1000 |
394 | | |
395 | | /* |
396 | | * Magic "block count" return values for the block iterator function. |
397 | | */ |
398 | 0 | #define BLOCK_COUNT_IND (-1) |
399 | 0 | #define BLOCK_COUNT_DIND (-2) |
400 | 0 | #define BLOCK_COUNT_TIND (-3) |
401 | 0 | #define BLOCK_COUNT_TRANSLATOR (-4) |
402 | | |
403 | | #define BLOCK_ALLOC_UNKNOWN 0 |
404 | 0 | #define BLOCK_ALLOC_DATA 1 |
405 | | #define BLOCK_ALLOC_METADATA 2 |
406 | | |
407 | | struct blk_alloc_ctx { |
408 | | ext2_ino_t ino; |
409 | | struct ext2_inode *inode; |
410 | | blk64_t lblk; |
411 | | int flags; |
412 | | }; |
413 | | |
414 | | #if 0 |
415 | | /* |
416 | | * Flags for ext2fs_move_blocks |
417 | | */ |
418 | | #define EXT2_BMOVE_GET_DBLIST 0x0001 |
419 | | #define EXT2_BMOVE_DEBUG 0x0002 |
420 | | #endif |
421 | | |
422 | | /* |
423 | | * Generic (non-filesystem layout specific) extents structure |
424 | | */ |
425 | | |
426 | 0 | #define EXT2_EXTENT_FLAGS_LEAF 0x0001 |
427 | 0 | #define EXT2_EXTENT_FLAGS_UNINIT 0x0002 |
428 | 0 | #define EXT2_EXTENT_FLAGS_SECOND_VISIT 0x0004 |
429 | | |
430 | | struct ext2fs_extent { |
431 | | blk64_t e_pblk; /* first physical block */ |
432 | | blk64_t e_lblk; /* first logical block extent covers */ |
433 | | __u32 e_len; /* number of blocks covered by extent */ |
434 | | __u32 e_flags; /* extent flags */ |
435 | | }; |
436 | | |
437 | | typedef struct ext2_extent_handle *ext2_extent_handle_t; |
438 | | typedef struct ext2_extent_path *ext2_extent_path_t; |
439 | | |
440 | | /* |
441 | | * Flags used by ext2fs_extent_get() |
442 | | */ |
443 | 0 | #define EXT2_EXTENT_CURRENT 0x0000 |
444 | 0 | #define EXT2_EXTENT_MOVE_MASK 0x000F |
445 | 0 | #define EXT2_EXTENT_ROOT 0x0001 |
446 | 0 | #define EXT2_EXTENT_LAST_LEAF 0x0002 |
447 | 0 | #define EXT2_EXTENT_FIRST_SIB 0x0003 |
448 | 0 | #define EXT2_EXTENT_LAST_SIB 0x0004 |
449 | 0 | #define EXT2_EXTENT_NEXT_SIB 0x0005 |
450 | 0 | #define EXT2_EXTENT_PREV_SIB 0x0006 |
451 | 0 | #define EXT2_EXTENT_NEXT_LEAF 0x0007 |
452 | 0 | #define EXT2_EXTENT_PREV_LEAF 0x0008 |
453 | 0 | #define EXT2_EXTENT_NEXT 0x0009 |
454 | 0 | #define EXT2_EXTENT_PREV 0x000A |
455 | 0 | #define EXT2_EXTENT_UP 0x000B |
456 | 0 | #define EXT2_EXTENT_DOWN 0x000C |
457 | 0 | #define EXT2_EXTENT_DOWN_AND_LAST 0x000D |
458 | | |
459 | | /* |
460 | | * Flags used by ext2fs_extent_insert() |
461 | | */ |
462 | 0 | #define EXT2_EXTENT_INSERT_AFTER 0x0001 /* insert after handle loc'n */ |
463 | 0 | #define EXT2_EXTENT_INSERT_NOSPLIT 0x0002 /* insert may not cause split */ |
464 | | |
465 | | /* |
466 | | * Flags used by ext2fs_extent_delete() |
467 | | */ |
468 | 0 | #define EXT2_EXTENT_DELETE_KEEP_EMPTY 0x001 /* keep node if last extent gone */ |
469 | | |
470 | | /* |
471 | | * Flags used by ext2fs_extent_set_bmap() |
472 | | */ |
473 | 0 | #define EXT2_EXTENT_SET_BMAP_UNINIT 0x0001 |
474 | | |
475 | | /* |
476 | | * Data structure returned by ext2fs_extent_get_info() |
477 | | */ |
478 | | struct ext2_extent_info { |
479 | | int curr_entry; |
480 | | int curr_level; |
481 | | int num_entries; |
482 | | int max_entries; |
483 | | int max_depth; |
484 | | int bytes_avail; |
485 | | blk64_t max_lblk; |
486 | | blk64_t max_pblk; |
487 | | __u32 max_len; |
488 | | __u32 max_uninit_len; |
489 | | }; |
490 | | |
491 | | /* |
492 | | * Flags for directory block reading and writing functions |
493 | | */ |
494 | | #define EXT2_DIRBLOCK_V2_STRUCT 0x0001 |
495 | | |
496 | | /* |
497 | | * Return flags for the directory iterator functions |
498 | | */ |
499 | 0 | #define DIRENT_CHANGED 1 |
500 | 0 | #define DIRENT_ABORT 2 |
501 | | #define DIRENT_ERROR 3 |
502 | | |
503 | | /* |
504 | | * Directory iterator flags |
505 | | */ |
506 | | |
507 | 0 | #define DIRENT_FLAG_INCLUDE_EMPTY 1 |
508 | 0 | #define DIRENT_FLAG_INCLUDE_REMOVED 2 |
509 | 0 | #define DIRENT_FLAG_INCLUDE_CSUM 4 |
510 | 0 | #define DIRENT_FLAG_INCLUDE_INLINE_DATA 8 |
511 | | |
512 | 0 | #define DIRENT_DOT_FILE 1 |
513 | | #define DIRENT_DOT_DOT_FILE 2 |
514 | 0 | #define DIRENT_OTHER_FILE 3 |
515 | 0 | #define DIRENT_DELETED_FILE 4 |
516 | 0 | #define DIRENT_CHECKSUM 5 |
517 | | |
518 | | /* |
519 | | * Inode scan definitions |
520 | | */ |
521 | | typedef struct ext2_struct_inode_scan *ext2_inode_scan; |
522 | | |
523 | | /* |
524 | | * ext2fs_scan flags |
525 | | */ |
526 | 0 | #define EXT2_SF_CHK_BADBLOCKS 0x0001 |
527 | 0 | #define EXT2_SF_BAD_INODE_BLK 0x0002 |
528 | 0 | #define EXT2_SF_BAD_EXTRA_BYTES 0x0004 |
529 | 0 | #define EXT2_SF_SKIP_MISSING_ITABLE 0x0008 |
530 | 0 | #define EXT2_SF_DO_LAZY 0x0010 |
531 | 0 | #define EXT2_SF_WARN_GARBAGE_INODES 0x0020 |
532 | | |
533 | | /* |
534 | | * ext2fs_check_if_mounted flags |
535 | | */ |
536 | 0 | #define EXT2_MF_MOUNTED 1 |
537 | 0 | #define EXT2_MF_ISROOT 2 |
538 | 0 | #define EXT2_MF_READONLY 4 |
539 | 0 | #define EXT2_MF_SWAP 8 |
540 | 0 | #define EXT2_MF_BUSY 16 |
541 | 0 | #define EXT2_MF_EXTFS 32 |
542 | | |
543 | | /* |
544 | | * Ext2/linux mode flags. We define them here so that we don't need |
545 | | * to depend on the OS's sys/stat.h, since we may be compiling on a |
546 | | * non-Linux system. |
547 | | */ |
548 | 0 | #define LINUX_S_IFMT 00170000 |
549 | | #define LINUX_S_IFSOCK 0140000 |
550 | 0 | #define LINUX_S_IFLNK 0120000 |
551 | 0 | #define LINUX_S_IFREG 0100000 |
552 | | #define LINUX_S_IFBLK 0060000 |
553 | 0 | #define LINUX_S_IFDIR 0040000 |
554 | | #define LINUX_S_IFCHR 0020000 |
555 | | #define LINUX_S_IFIFO 0010000 |
556 | | #define LINUX_S_ISUID 0004000 |
557 | | #define LINUX_S_ISGID 0002000 |
558 | | #define LINUX_S_ISVTX 0001000 |
559 | | |
560 | | #define LINUX_S_IRWXU 00700 |
561 | | #define LINUX_S_IRUSR 00400 |
562 | | #define LINUX_S_IWUSR 00200 |
563 | | #define LINUX_S_IXUSR 00100 |
564 | | |
565 | | #define LINUX_S_IRWXG 00070 |
566 | | #define LINUX_S_IRGRP 00040 |
567 | | #define LINUX_S_IWGRP 00020 |
568 | | #define LINUX_S_IXGRP 00010 |
569 | | |
570 | | #define LINUX_S_IRWXO 00007 |
571 | | #define LINUX_S_IROTH 00004 |
572 | | #define LINUX_S_IWOTH 00002 |
573 | | #define LINUX_S_IXOTH 00001 |
574 | | |
575 | 0 | #define LINUX_S_ISLNK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFLNK) |
576 | 0 | #define LINUX_S_ISREG(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFREG) |
577 | 0 | #define LINUX_S_ISDIR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFDIR) |
578 | | #define LINUX_S_ISCHR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFCHR) |
579 | | #define LINUX_S_ISBLK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFBLK) |
580 | | #define LINUX_S_ISFIFO(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFIFO) |
581 | | #define LINUX_S_ISSOCK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFSOCK) |
582 | | |
583 | | /* |
584 | | * ext2 size of an inode |
585 | | */ |
586 | 0 | #define EXT2_I_SIZE(i) ((i)->i_size | ((__u64) (i)->i_size_high << 32)) |
587 | | |
588 | | static inline __u32 __encode_extra_time(time_t seconds EXT2FS_ATTR((unused)), |
589 | | __u32 nsec) |
590 | 0 | { |
591 | 0 | __u32 extra = 0; |
592 | 0 |
|
593 | 0 | #if (SIZEOF_TIME_T > 4) |
594 | 0 | extra = ((seconds - (__s32)(seconds & 0xffffffff)) >> 32) & |
595 | 0 | EXT4_EPOCH_MASK; |
596 | 0 | #endif |
597 | 0 | return extra | (nsec << EXT4_EPOCH_BITS); |
598 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:__encode_extra_time(long, unsigned int) Unexecuted instantiation: imager.c:__encode_extra_time Unexecuted instantiation: blknum.c:__encode_extra_time Unexecuted instantiation: closefs.c:__encode_extra_time Unexecuted instantiation: csum.c:__encode_extra_time Unexecuted instantiation: dir_iterate.c:__encode_extra_time Unexecuted instantiation: freefs.c:__encode_extra_time Unexecuted instantiation: gen_bitmap64.c:__encode_extra_time Unexecuted instantiation: get_num_dirs.c:__encode_extra_time Unexecuted instantiation: getenv.c:__encode_extra_time Unexecuted instantiation: inline_data.c:__encode_extra_time Unexecuted instantiation: inode.c:__encode_extra_time Unexecuted instantiation: io_manager.c:__encode_extra_time Unexecuted instantiation: mkjournal.c:__encode_extra_time Unexecuted instantiation: mmp.c:__encode_extra_time Unexecuted instantiation: openfs.c:__encode_extra_time Unexecuted instantiation: read_bb.c:__encode_extra_time Unexecuted instantiation: rw_bitmaps.c:__encode_extra_time Unexecuted instantiation: unix_io.c:__encode_extra_time Unexecuted instantiation: alloc.c:__encode_extra_time Unexecuted instantiation: alloc_sb.c:__encode_extra_time Unexecuted instantiation: alloc_stats.c:__encode_extra_time Unexecuted instantiation: badblocks.c:__encode_extra_time Unexecuted instantiation: bitmaps.c:__encode_extra_time Unexecuted instantiation: bitops.c:__encode_extra_time Unexecuted instantiation: blkmap64_ba.c:__encode_extra_time Unexecuted instantiation: blkmap64_rb.c:__encode_extra_time Unexecuted instantiation: block.c:__encode_extra_time Unexecuted instantiation: bmap.c:__encode_extra_time Unexecuted instantiation: crc32c.c:__encode_extra_time Unexecuted instantiation: dirblock.c:__encode_extra_time Unexecuted instantiation: ext_attr.c:__encode_extra_time Unexecuted instantiation: extent.c:__encode_extra_time Unexecuted instantiation: fallocate.c:__encode_extra_time Unexecuted instantiation: fileio.c:__encode_extra_time Unexecuted instantiation: gen_bitmap.c:__encode_extra_time Unexecuted instantiation: getsectsize.c:__encode_extra_time Unexecuted instantiation: i_block.c:__encode_extra_time Unexecuted instantiation: ind_block.c:__encode_extra_time Unexecuted instantiation: inline.c:__encode_extra_time Unexecuted instantiation: ismounted.c:__encode_extra_time Unexecuted instantiation: nls_utf8.c:__encode_extra_time Unexecuted instantiation: punch.c:__encode_extra_time Unexecuted instantiation: sha512.c:__encode_extra_time Unexecuted instantiation: symlink.c:__encode_extra_time Unexecuted instantiation: valid_blk.c:__encode_extra_time Unexecuted instantiation: link.c:__encode_extra_time Unexecuted instantiation: lookup.c:__encode_extra_time Unexecuted instantiation: dirhash.c:__encode_extra_time Unexecuted instantiation: expanddir.c:__encode_extra_time Unexecuted instantiation: newdir.c:__encode_extra_time Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:__encode_extra_time(long, unsigned int) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:__encode_extra_time(long, unsigned int) |
599 | | static inline time_t __decode_extra_sec(time_t seconds, |
600 | | __u32 extra EXT2FS_ATTR((unused))) |
601 | 0 | { |
602 | 0 | #if (SIZEOF_TIME_T > 4) |
603 | 0 | if (extra & EXT4_EPOCH_MASK) |
604 | 0 | seconds += ((time_t)(extra & EXT4_EPOCH_MASK) << 32); |
605 | 0 | #endif |
606 | 0 | return seconds; |
607 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:__decode_extra_sec(long, unsigned int) Unexecuted instantiation: imager.c:__decode_extra_sec Unexecuted instantiation: blknum.c:__decode_extra_sec Unexecuted instantiation: closefs.c:__decode_extra_sec Unexecuted instantiation: csum.c:__decode_extra_sec Unexecuted instantiation: dir_iterate.c:__decode_extra_sec Unexecuted instantiation: freefs.c:__decode_extra_sec Unexecuted instantiation: gen_bitmap64.c:__decode_extra_sec Unexecuted instantiation: get_num_dirs.c:__decode_extra_sec Unexecuted instantiation: getenv.c:__decode_extra_sec Unexecuted instantiation: inline_data.c:__decode_extra_sec Unexecuted instantiation: inode.c:__decode_extra_sec Unexecuted instantiation: io_manager.c:__decode_extra_sec Unexecuted instantiation: mkjournal.c:__decode_extra_sec Unexecuted instantiation: mmp.c:__decode_extra_sec Unexecuted instantiation: openfs.c:__decode_extra_sec Unexecuted instantiation: read_bb.c:__decode_extra_sec Unexecuted instantiation: rw_bitmaps.c:__decode_extra_sec Unexecuted instantiation: unix_io.c:__decode_extra_sec Unexecuted instantiation: alloc.c:__decode_extra_sec Unexecuted instantiation: alloc_sb.c:__decode_extra_sec Unexecuted instantiation: alloc_stats.c:__decode_extra_sec Unexecuted instantiation: badblocks.c:__decode_extra_sec Unexecuted instantiation: bitmaps.c:__decode_extra_sec Unexecuted instantiation: bitops.c:__decode_extra_sec Unexecuted instantiation: blkmap64_ba.c:__decode_extra_sec Unexecuted instantiation: blkmap64_rb.c:__decode_extra_sec Unexecuted instantiation: block.c:__decode_extra_sec Unexecuted instantiation: bmap.c:__decode_extra_sec Unexecuted instantiation: crc32c.c:__decode_extra_sec Unexecuted instantiation: dirblock.c:__decode_extra_sec Unexecuted instantiation: ext_attr.c:__decode_extra_sec Unexecuted instantiation: extent.c:__decode_extra_sec Unexecuted instantiation: fallocate.c:__decode_extra_sec Unexecuted instantiation: fileio.c:__decode_extra_sec Unexecuted instantiation: gen_bitmap.c:__decode_extra_sec Unexecuted instantiation: getsectsize.c:__decode_extra_sec Unexecuted instantiation: i_block.c:__decode_extra_sec Unexecuted instantiation: ind_block.c:__decode_extra_sec Unexecuted instantiation: inline.c:__decode_extra_sec Unexecuted instantiation: ismounted.c:__decode_extra_sec Unexecuted instantiation: nls_utf8.c:__decode_extra_sec Unexecuted instantiation: punch.c:__decode_extra_sec Unexecuted instantiation: sha512.c:__decode_extra_sec Unexecuted instantiation: symlink.c:__decode_extra_sec Unexecuted instantiation: valid_blk.c:__decode_extra_sec Unexecuted instantiation: link.c:__decode_extra_sec Unexecuted instantiation: lookup.c:__decode_extra_sec Unexecuted instantiation: dirhash.c:__decode_extra_sec Unexecuted instantiation: expanddir.c:__decode_extra_sec Unexecuted instantiation: newdir.c:__decode_extra_sec Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:__decode_extra_sec(long, unsigned int) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:__decode_extra_sec(long, unsigned int) |
608 | | static inline __u32 __decode_extra_nsec(__u32 extra) |
609 | 0 | { |
610 | 0 | return (extra & EXT4_NSEC_MASK) >> EXT4_EPOCH_BITS; |
611 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:__decode_extra_nsec(unsigned int) Unexecuted instantiation: imager.c:__decode_extra_nsec Unexecuted instantiation: blknum.c:__decode_extra_nsec Unexecuted instantiation: closefs.c:__decode_extra_nsec Unexecuted instantiation: csum.c:__decode_extra_nsec Unexecuted instantiation: dir_iterate.c:__decode_extra_nsec Unexecuted instantiation: freefs.c:__decode_extra_nsec Unexecuted instantiation: gen_bitmap64.c:__decode_extra_nsec Unexecuted instantiation: get_num_dirs.c:__decode_extra_nsec Unexecuted instantiation: getenv.c:__decode_extra_nsec Unexecuted instantiation: inline_data.c:__decode_extra_nsec Unexecuted instantiation: inode.c:__decode_extra_nsec Unexecuted instantiation: io_manager.c:__decode_extra_nsec Unexecuted instantiation: mkjournal.c:__decode_extra_nsec Unexecuted instantiation: mmp.c:__decode_extra_nsec Unexecuted instantiation: openfs.c:__decode_extra_nsec Unexecuted instantiation: read_bb.c:__decode_extra_nsec Unexecuted instantiation: rw_bitmaps.c:__decode_extra_nsec Unexecuted instantiation: unix_io.c:__decode_extra_nsec Unexecuted instantiation: alloc.c:__decode_extra_nsec Unexecuted instantiation: alloc_sb.c:__decode_extra_nsec Unexecuted instantiation: alloc_stats.c:__decode_extra_nsec Unexecuted instantiation: badblocks.c:__decode_extra_nsec Unexecuted instantiation: bitmaps.c:__decode_extra_nsec Unexecuted instantiation: bitops.c:__decode_extra_nsec Unexecuted instantiation: blkmap64_ba.c:__decode_extra_nsec Unexecuted instantiation: blkmap64_rb.c:__decode_extra_nsec Unexecuted instantiation: block.c:__decode_extra_nsec Unexecuted instantiation: bmap.c:__decode_extra_nsec Unexecuted instantiation: crc32c.c:__decode_extra_nsec Unexecuted instantiation: dirblock.c:__decode_extra_nsec Unexecuted instantiation: ext_attr.c:__decode_extra_nsec Unexecuted instantiation: extent.c:__decode_extra_nsec Unexecuted instantiation: fallocate.c:__decode_extra_nsec Unexecuted instantiation: fileio.c:__decode_extra_nsec Unexecuted instantiation: gen_bitmap.c:__decode_extra_nsec Unexecuted instantiation: getsectsize.c:__decode_extra_nsec Unexecuted instantiation: i_block.c:__decode_extra_nsec Unexecuted instantiation: ind_block.c:__decode_extra_nsec Unexecuted instantiation: inline.c:__decode_extra_nsec Unexecuted instantiation: ismounted.c:__decode_extra_nsec Unexecuted instantiation: nls_utf8.c:__decode_extra_nsec Unexecuted instantiation: punch.c:__decode_extra_nsec Unexecuted instantiation: sha512.c:__decode_extra_nsec Unexecuted instantiation: symlink.c:__decode_extra_nsec Unexecuted instantiation: valid_blk.c:__decode_extra_nsec Unexecuted instantiation: link.c:__decode_extra_nsec Unexecuted instantiation: lookup.c:__decode_extra_nsec Unexecuted instantiation: dirhash.c:__decode_extra_nsec Unexecuted instantiation: expanddir.c:__decode_extra_nsec Unexecuted instantiation: newdir.c:__decode_extra_nsec Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:__decode_extra_nsec(unsigned int) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:__decode_extra_nsec(unsigned int) |
612 | | #define ext2fs_inode_actual_size(inode) \ |
613 | | ((size_t)(EXT2_GOOD_OLD_INODE_SIZE + \ |
614 | | (sizeof(*inode) > EXT2_GOOD_OLD_INODE_SIZE ? \ |
615 | | ((struct ext2_inode_large *)(inode))->i_extra_isize : 0))) |
616 | 0 | #define clamp(val, min, max) ((val) < (min) ? (min) : ((val) > (max) ? \ |
617 | 0 | (max) : (val))) |
618 | 0 | #define ext2fs_inode_xtime_set(inode, field, sec) \ |
619 | 0 | do { \ |
620 | 0 | if (ext2fs_inode_includes(ext2fs_inode_actual_size(inode), \ |
621 | 0 | field ## _extra)) { \ |
622 | 0 | (inode)->field = (__u32)(sec & 0xfffffff); \ |
623 | 0 | ((struct ext2_inode_large *)(inode))->field ## _extra = \ |
624 | 0 | __encode_extra_time(sec, 0); \ |
625 | 0 | } else { \ |
626 | 0 | (inode)->field = (__u32) clamp(sec, INT32_MIN, INT32_MAX); \ |
627 | 0 | } \ |
628 | 0 | } while (0) |
629 | 0 | #define ext2fs_inode_xtime_get(inode, field) \ |
630 | 0 | (ext2fs_inode_includes(ext2fs_inode_actual_size(inode), field ## _extra) ? \ |
631 | 0 | __decode_extra_sec((inode)->field, \ |
632 | 0 | ((struct ext2_inode_large *)(inode))->field ## _extra) : \ |
633 | 0 | (time_t)(inode)->field) |
634 | | |
635 | | static inline void __sb_set_tstamp(__u32 *lo, __u8 *hi EXT2FS_ATTR((unused)), |
636 | | time_t seconds) |
637 | 0 | { |
638 | 0 | *lo = seconds & 0xffffffff; |
639 | 0 | #if (SIZEOF_TIME_T > 4) |
640 | 0 | *hi = (seconds >> 32) & EXT4_EPOCH_MASK; |
641 | | #else |
642 | | *hi = 0; |
643 | | #endif |
644 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:__sb_set_tstamp(unsigned int*, unsigned char*, long) Unexecuted instantiation: imager.c:__sb_set_tstamp Unexecuted instantiation: blknum.c:__sb_set_tstamp Unexecuted instantiation: closefs.c:__sb_set_tstamp Unexecuted instantiation: csum.c:__sb_set_tstamp Unexecuted instantiation: dir_iterate.c:__sb_set_tstamp Unexecuted instantiation: freefs.c:__sb_set_tstamp Unexecuted instantiation: gen_bitmap64.c:__sb_set_tstamp Unexecuted instantiation: get_num_dirs.c:__sb_set_tstamp Unexecuted instantiation: getenv.c:__sb_set_tstamp Unexecuted instantiation: inline_data.c:__sb_set_tstamp Unexecuted instantiation: inode.c:__sb_set_tstamp Unexecuted instantiation: io_manager.c:__sb_set_tstamp Unexecuted instantiation: mkjournal.c:__sb_set_tstamp Unexecuted instantiation: mmp.c:__sb_set_tstamp Unexecuted instantiation: openfs.c:__sb_set_tstamp Unexecuted instantiation: read_bb.c:__sb_set_tstamp Unexecuted instantiation: rw_bitmaps.c:__sb_set_tstamp Unexecuted instantiation: unix_io.c:__sb_set_tstamp Unexecuted instantiation: alloc.c:__sb_set_tstamp Unexecuted instantiation: alloc_sb.c:__sb_set_tstamp Unexecuted instantiation: alloc_stats.c:__sb_set_tstamp Unexecuted instantiation: badblocks.c:__sb_set_tstamp Unexecuted instantiation: bitmaps.c:__sb_set_tstamp Unexecuted instantiation: bitops.c:__sb_set_tstamp Unexecuted instantiation: blkmap64_ba.c:__sb_set_tstamp Unexecuted instantiation: blkmap64_rb.c:__sb_set_tstamp Unexecuted instantiation: block.c:__sb_set_tstamp Unexecuted instantiation: bmap.c:__sb_set_tstamp Unexecuted instantiation: crc32c.c:__sb_set_tstamp Unexecuted instantiation: dirblock.c:__sb_set_tstamp Unexecuted instantiation: ext_attr.c:__sb_set_tstamp Unexecuted instantiation: extent.c:__sb_set_tstamp Unexecuted instantiation: fallocate.c:__sb_set_tstamp Unexecuted instantiation: fileio.c:__sb_set_tstamp Unexecuted instantiation: gen_bitmap.c:__sb_set_tstamp Unexecuted instantiation: getsectsize.c:__sb_set_tstamp Unexecuted instantiation: i_block.c:__sb_set_tstamp Unexecuted instantiation: ind_block.c:__sb_set_tstamp Unexecuted instantiation: inline.c:__sb_set_tstamp Unexecuted instantiation: ismounted.c:__sb_set_tstamp Unexecuted instantiation: nls_utf8.c:__sb_set_tstamp Unexecuted instantiation: punch.c:__sb_set_tstamp Unexecuted instantiation: sha512.c:__sb_set_tstamp Unexecuted instantiation: symlink.c:__sb_set_tstamp Unexecuted instantiation: valid_blk.c:__sb_set_tstamp Unexecuted instantiation: link.c:__sb_set_tstamp Unexecuted instantiation: lookup.c:__sb_set_tstamp Unexecuted instantiation: dirhash.c:__sb_set_tstamp Unexecuted instantiation: expanddir.c:__sb_set_tstamp Unexecuted instantiation: newdir.c:__sb_set_tstamp Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:__sb_set_tstamp(unsigned int*, unsigned char*, long) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:__sb_set_tstamp(unsigned int*, unsigned char*, long) |
645 | | static inline time_t __sb_get_tstamp(__u32 *lo, __u8 *hi EXT2FS_ATTR((unused))) |
646 | 0 | { |
647 | 0 | #if (SIZEOF_TIME_T == 4) |
648 | 0 | return *lo; |
649 | 0 | #else |
650 | 0 | return ((time_t)(*hi) << 32) | *lo; |
651 | 0 | #endif |
652 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:__sb_get_tstamp(unsigned int*, unsigned char*) Unexecuted instantiation: imager.c:__sb_get_tstamp Unexecuted instantiation: blknum.c:__sb_get_tstamp Unexecuted instantiation: closefs.c:__sb_get_tstamp Unexecuted instantiation: csum.c:__sb_get_tstamp Unexecuted instantiation: dir_iterate.c:__sb_get_tstamp Unexecuted instantiation: freefs.c:__sb_get_tstamp Unexecuted instantiation: gen_bitmap64.c:__sb_get_tstamp Unexecuted instantiation: get_num_dirs.c:__sb_get_tstamp Unexecuted instantiation: getenv.c:__sb_get_tstamp Unexecuted instantiation: inline_data.c:__sb_get_tstamp Unexecuted instantiation: inode.c:__sb_get_tstamp Unexecuted instantiation: io_manager.c:__sb_get_tstamp Unexecuted instantiation: mkjournal.c:__sb_get_tstamp Unexecuted instantiation: mmp.c:__sb_get_tstamp Unexecuted instantiation: openfs.c:__sb_get_tstamp Unexecuted instantiation: read_bb.c:__sb_get_tstamp Unexecuted instantiation: rw_bitmaps.c:__sb_get_tstamp Unexecuted instantiation: unix_io.c:__sb_get_tstamp Unexecuted instantiation: alloc.c:__sb_get_tstamp Unexecuted instantiation: alloc_sb.c:__sb_get_tstamp Unexecuted instantiation: alloc_stats.c:__sb_get_tstamp Unexecuted instantiation: badblocks.c:__sb_get_tstamp Unexecuted instantiation: bitmaps.c:__sb_get_tstamp Unexecuted instantiation: bitops.c:__sb_get_tstamp Unexecuted instantiation: blkmap64_ba.c:__sb_get_tstamp Unexecuted instantiation: blkmap64_rb.c:__sb_get_tstamp Unexecuted instantiation: block.c:__sb_get_tstamp Unexecuted instantiation: bmap.c:__sb_get_tstamp Unexecuted instantiation: crc32c.c:__sb_get_tstamp Unexecuted instantiation: dirblock.c:__sb_get_tstamp Unexecuted instantiation: ext_attr.c:__sb_get_tstamp Unexecuted instantiation: extent.c:__sb_get_tstamp Unexecuted instantiation: fallocate.c:__sb_get_tstamp Unexecuted instantiation: fileio.c:__sb_get_tstamp Unexecuted instantiation: gen_bitmap.c:__sb_get_tstamp Unexecuted instantiation: getsectsize.c:__sb_get_tstamp Unexecuted instantiation: i_block.c:__sb_get_tstamp Unexecuted instantiation: ind_block.c:__sb_get_tstamp Unexecuted instantiation: inline.c:__sb_get_tstamp Unexecuted instantiation: ismounted.c:__sb_get_tstamp Unexecuted instantiation: nls_utf8.c:__sb_get_tstamp Unexecuted instantiation: punch.c:__sb_get_tstamp Unexecuted instantiation: sha512.c:__sb_get_tstamp Unexecuted instantiation: symlink.c:__sb_get_tstamp Unexecuted instantiation: valid_blk.c:__sb_get_tstamp Unexecuted instantiation: link.c:__sb_get_tstamp Unexecuted instantiation: lookup.c:__sb_get_tstamp Unexecuted instantiation: dirhash.c:__sb_get_tstamp Unexecuted instantiation: expanddir.c:__sb_get_tstamp Unexecuted instantiation: newdir.c:__sb_get_tstamp Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:__sb_get_tstamp(unsigned int*, unsigned char*) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:__sb_get_tstamp(unsigned int*, unsigned char*) |
653 | | #define ext2fs_set_tstamp(sb, field, seconds) \ |
654 | 0 | __sb_set_tstamp(&(sb)->field, &(sb)->field ## _hi, seconds) |
655 | | #define ext2fs_get_tstamp(sb, field) \ |
656 | | __sb_get_tstamp(&(sb)->field, &(sb)->field ## _hi) |
657 | | |
658 | | /* |
659 | | * ext2_icount_t abstraction |
660 | | */ |
661 | | #define EXT2_ICOUNT_OPT_INCREMENT 0x01 |
662 | | #define EXT2_ICOUNT_OPT_FULLMAP 0x02 |
663 | | |
664 | | typedef struct ext2_icount *ext2_icount_t; |
665 | | |
666 | | /* |
667 | | * Flags for ext2fs_bmap |
668 | | */ |
669 | 0 | #define BMAP_ALLOC 0x0001 |
670 | 0 | #define BMAP_SET 0x0002 |
671 | 0 | #define BMAP_UNINIT 0x0004 |
672 | 0 | #define BMAP_ZERO 0x0008 |
673 | | |
674 | | /* |
675 | | * Returned flags from ext2fs_bmap |
676 | | */ |
677 | 0 | #define BMAP_RET_UNINIT 0x0001 |
678 | | |
679 | | /* |
680 | | * Flags for ext2fs_read_inode2 |
681 | | */ |
682 | 0 | #define READ_INODE_NOCSUM 0x0001 |
683 | | |
684 | | /* |
685 | | * Flags for ext2fs_write_inode2 |
686 | | */ |
687 | 0 | #define WRITE_INODE_NOCSUM 0x0001 |
688 | | |
689 | | /* |
690 | | * Flags for imager.c functions |
691 | | */ |
692 | 163 | #define IMAGER_FLAG_INODEMAP 1 |
693 | 2.31k | #define IMAGER_FLAG_SPARSEWRITE 2 |
694 | | |
695 | | /* |
696 | | * For checking structure magic numbers... |
697 | | */ |
698 | | |
699 | | #define EXT2_CHECK_MAGIC(struct, code) \ |
700 | 18.2k | if ((struct)->magic != (code)) return (code) |
701 | | |
702 | | /* |
703 | | * Features supported by this version of the library |
704 | | */ |
705 | | #define EXT2_LIB_FEATURE_COMPAT_SUPP (EXT2_FEATURE_COMPAT_DIR_PREALLOC|\ |
706 | | EXT2_FEATURE_COMPAT_IMAGIC_INODES|\ |
707 | | EXT3_FEATURE_COMPAT_HAS_JOURNAL|\ |
708 | | EXT2_FEATURE_COMPAT_RESIZE_INODE|\ |
709 | | EXT2_FEATURE_COMPAT_DIR_INDEX|\ |
710 | | EXT2_FEATURE_COMPAT_EXT_ATTR|\ |
711 | | EXT4_FEATURE_COMPAT_SPARSE_SUPER2|\ |
712 | | EXT4_FEATURE_COMPAT_FAST_COMMIT|\ |
713 | | EXT4_FEATURE_COMPAT_STABLE_INODES|\ |
714 | | EXT4_FEATURE_COMPAT_ORPHAN_FILE) |
715 | | |
716 | | #ifdef CONFIG_MMP |
717 | 575 | #define EXT4_LIB_INCOMPAT_MMP EXT4_FEATURE_INCOMPAT_MMP |
718 | | #else |
719 | | #define EXT4_LIB_INCOMPAT_MMP (0) |
720 | | #endif |
721 | | |
722 | 575 | #define EXT2_LIB_FEATURE_INCOMPAT_SUPP (EXT2_FEATURE_INCOMPAT_FILETYPE|\ |
723 | 575 | EXT3_FEATURE_INCOMPAT_JOURNAL_DEV|\ |
724 | 575 | EXT2_FEATURE_INCOMPAT_META_BG|\ |
725 | 575 | EXT3_FEATURE_INCOMPAT_RECOVER|\ |
726 | 575 | EXT3_FEATURE_INCOMPAT_EXTENTS|\ |
727 | 575 | EXT4_FEATURE_INCOMPAT_FLEX_BG|\ |
728 | 575 | EXT4_FEATURE_INCOMPAT_EA_INODE|\ |
729 | 575 | EXT4_LIB_INCOMPAT_MMP|\ |
730 | 575 | EXT4_FEATURE_INCOMPAT_64BIT|\ |
731 | 575 | EXT4_FEATURE_INCOMPAT_INLINE_DATA|\ |
732 | 575 | EXT4_FEATURE_INCOMPAT_ENCRYPT|\ |
733 | 575 | EXT4_FEATURE_INCOMPAT_CASEFOLD|\ |
734 | 575 | EXT4_FEATURE_INCOMPAT_CSUM_SEED|\ |
735 | 575 | EXT4_FEATURE_INCOMPAT_LARGEDIR) |
736 | | |
737 | 0 | #define EXT2_LIB_FEATURE_RO_COMPAT_SUPP (EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER|\ |
738 | 0 | EXT4_FEATURE_RO_COMPAT_HUGE_FILE|\ |
739 | 0 | EXT2_FEATURE_RO_COMPAT_LARGE_FILE|\ |
740 | 0 | EXT4_FEATURE_RO_COMPAT_DIR_NLINK|\ |
741 | 0 | EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE|\ |
742 | 0 | EXT4_FEATURE_RO_COMPAT_GDT_CSUM|\ |
743 | 0 | EXT4_FEATURE_RO_COMPAT_BIGALLOC|\ |
744 | 0 | EXT4_FEATURE_RO_COMPAT_QUOTA|\ |
745 | 0 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM|\ |
746 | 0 | EXT4_FEATURE_RO_COMPAT_READONLY |\ |
747 | 0 | EXT4_FEATURE_RO_COMPAT_PROJECT |\ |
748 | 0 | EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS |\ |
749 | 0 | EXT4_FEATURE_RO_COMPAT_VERITY |\ |
750 | 0 | EXT4_FEATURE_RO_COMPAT_ORPHAN_PRESENT) |
751 | | |
752 | | /* |
753 | | * These features are only allowed if EXT2_FLAG_SOFTSUPP_FEATURES is passed |
754 | | * to ext2fs_openfs() |
755 | | */ |
756 | 0 | #define EXT2_LIB_SOFTSUPP_INCOMPAT (0) |
757 | 0 | #define EXT2_LIB_SOFTSUPP_RO_COMPAT (EXT4_FEATURE_RO_COMPAT_REPLICA) |
758 | | |
759 | | |
760 | | /* Translate a block number to a cluster number */ |
761 | 396 | #define EXT2FS_CLUSTER_RATIO(fs) (1 << (fs)->cluster_ratio_bits) |
762 | 0 | #define EXT2FS_CLUSTER_MASK(fs) (EXT2FS_CLUSTER_RATIO(fs) - 1) |
763 | 1.08k | #define EXT2FS_B2C(fs, blk) ((blk) >> (fs)->cluster_ratio_bits) |
764 | | /* Translate a cluster number to a block number */ |
765 | 0 | #define EXT2FS_C2B(fs, cluster) ((cluster) << (fs)->cluster_ratio_bits) |
766 | | /* Translate # of blks to # of clusters */ |
767 | 0 | #define EXT2FS_NUM_B2C(fs, blks) (((blks) + EXT2FS_CLUSTER_MASK(fs)) >> \ |
768 | 0 | (fs)->cluster_ratio_bits) |
769 | | |
770 | | #if defined(HAVE_FSTAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED) |
771 | | typedef struct stat64 ext2fs_struct_stat; |
772 | | #else |
773 | | typedef struct stat ext2fs_struct_stat; |
774 | | #endif |
775 | | |
776 | | /* |
777 | | * For ext2fs_close2() and ext2fs_flush2(), this flag allows you to |
778 | | * avoid the fsync call. |
779 | | */ |
780 | 0 | #define EXT2_FLAG_FLUSH_NO_SYNC 1 |
781 | | |
782 | | /* |
783 | | * Modify and iterate extended attributes |
784 | | */ |
785 | | struct ext2_xattr_handle; |
786 | 0 | #define XATTR_ABORT 1 |
787 | 0 | #define XATTR_CHANGED 2 |
788 | | |
789 | | /* |
790 | | * flags for ext2fs_rw_bitmaps() |
791 | | */ |
792 | 396 | #define EXT2FS_BITMAPS_WRITE 0x0001 |
793 | 1.52k | #define EXT2FS_BITMAPS_BLOCK 0x0002 |
794 | 1.21k | #define EXT2FS_BITMAPS_INODE 0x0004 |
795 | 396 | #define EXT2FS_BITMAPS_VALID_FLAGS 0x0007 |
796 | | |
797 | | /* |
798 | | * flags for ext2fs_unlink() |
799 | | */ |
800 | | |
801 | | /* Forcefully unlink even if the inode number doesn't match the dirent */ |
802 | | #define EXT2FS_UNLINK_FORCE 0x1 |
803 | | |
804 | | /* |
805 | | * flags for ext2fs_link() |
806 | | * |
807 | | */ |
808 | 0 | #define EXT2FS_LINK_FT_MASK 0x0007 |
809 | 0 | #define EXT2FS_LINK_APPEND 0x0010 |
810 | 0 | #define EXT2FS_LINK_EXPAND 0x0020 |
811 | | |
812 | | /* |
813 | | * function prototypes |
814 | | */ |
815 | | static inline int ext2fs_has_group_desc_csum(ext2_filsys fs) |
816 | 87.3k | { |
817 | 87.3k | return ext2fs_has_feature_metadata_csum(fs->super) || |
818 | 33.5k | ext2fs_has_feature_gdt_csum(fs->super); |
819 | 87.3k | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:ext2fs_has_group_desc_csum(struct_ext2_filsys*) Unexecuted instantiation: imager.c:ext2fs_has_group_desc_csum Unexecuted instantiation: blknum.c:ext2fs_has_group_desc_csum Unexecuted instantiation: closefs.c:ext2fs_has_group_desc_csum csum.c:ext2fs_has_group_desc_csum Line | Count | Source | 816 | 86.9k | { | 817 | 86.9k | return ext2fs_has_feature_metadata_csum(fs->super) || | 818 | 33.2k | ext2fs_has_feature_gdt_csum(fs->super); | 819 | 86.9k | } |
Unexecuted instantiation: dir_iterate.c:ext2fs_has_group_desc_csum Unexecuted instantiation: freefs.c:ext2fs_has_group_desc_csum Unexecuted instantiation: gen_bitmap64.c:ext2fs_has_group_desc_csum Unexecuted instantiation: get_num_dirs.c:ext2fs_has_group_desc_csum Unexecuted instantiation: getenv.c:ext2fs_has_group_desc_csum Unexecuted instantiation: inline_data.c:ext2fs_has_group_desc_csum Unexecuted instantiation: inode.c:ext2fs_has_group_desc_csum Unexecuted instantiation: io_manager.c:ext2fs_has_group_desc_csum Unexecuted instantiation: mkjournal.c:ext2fs_has_group_desc_csum Unexecuted instantiation: mmp.c:ext2fs_has_group_desc_csum Unexecuted instantiation: openfs.c:ext2fs_has_group_desc_csum Unexecuted instantiation: read_bb.c:ext2fs_has_group_desc_csum rw_bitmaps.c:ext2fs_has_group_desc_csum Line | Count | Source | 816 | 390 | { | 817 | 390 | return ext2fs_has_feature_metadata_csum(fs->super) || | 818 | 297 | ext2fs_has_feature_gdt_csum(fs->super); | 819 | 390 | } |
Unexecuted instantiation: unix_io.c:ext2fs_has_group_desc_csum Unexecuted instantiation: alloc.c:ext2fs_has_group_desc_csum Unexecuted instantiation: alloc_sb.c:ext2fs_has_group_desc_csum Unexecuted instantiation: alloc_stats.c:ext2fs_has_group_desc_csum Unexecuted instantiation: badblocks.c:ext2fs_has_group_desc_csum Unexecuted instantiation: bitmaps.c:ext2fs_has_group_desc_csum Unexecuted instantiation: bitops.c:ext2fs_has_group_desc_csum Unexecuted instantiation: blkmap64_ba.c:ext2fs_has_group_desc_csum Unexecuted instantiation: blkmap64_rb.c:ext2fs_has_group_desc_csum Unexecuted instantiation: block.c:ext2fs_has_group_desc_csum Unexecuted instantiation: bmap.c:ext2fs_has_group_desc_csum Unexecuted instantiation: crc32c.c:ext2fs_has_group_desc_csum Unexecuted instantiation: dirblock.c:ext2fs_has_group_desc_csum Unexecuted instantiation: ext_attr.c:ext2fs_has_group_desc_csum Unexecuted instantiation: extent.c:ext2fs_has_group_desc_csum Unexecuted instantiation: fallocate.c:ext2fs_has_group_desc_csum Unexecuted instantiation: fileio.c:ext2fs_has_group_desc_csum Unexecuted instantiation: gen_bitmap.c:ext2fs_has_group_desc_csum Unexecuted instantiation: getsectsize.c:ext2fs_has_group_desc_csum Unexecuted instantiation: i_block.c:ext2fs_has_group_desc_csum Unexecuted instantiation: ind_block.c:ext2fs_has_group_desc_csum Unexecuted instantiation: inline.c:ext2fs_has_group_desc_csum Unexecuted instantiation: ismounted.c:ext2fs_has_group_desc_csum Unexecuted instantiation: nls_utf8.c:ext2fs_has_group_desc_csum Unexecuted instantiation: punch.c:ext2fs_has_group_desc_csum Unexecuted instantiation: sha512.c:ext2fs_has_group_desc_csum Unexecuted instantiation: symlink.c:ext2fs_has_group_desc_csum Unexecuted instantiation: valid_blk.c:ext2fs_has_group_desc_csum Unexecuted instantiation: link.c:ext2fs_has_group_desc_csum Unexecuted instantiation: lookup.c:ext2fs_has_group_desc_csum Unexecuted instantiation: dirhash.c:ext2fs_has_group_desc_csum Unexecuted instantiation: expanddir.c:ext2fs_has_group_desc_csum Unexecuted instantiation: newdir.c:ext2fs_has_group_desc_csum Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:ext2fs_has_group_desc_csum(struct_ext2_filsys*) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:ext2fs_has_group_desc_csum(struct_ext2_filsys*) |
820 | | |
821 | | /* The LARGE_FILE feature should be set if we have stored files 2GB+ in size */ |
822 | | static inline int ext2fs_needs_large_file_feature(unsigned long long file_size) |
823 | 0 | { |
824 | 0 | return file_size >= 0x80000000ULL; |
825 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:ext2fs_needs_large_file_feature(unsigned long long) Unexecuted instantiation: imager.c:ext2fs_needs_large_file_feature Unexecuted instantiation: blknum.c:ext2fs_needs_large_file_feature Unexecuted instantiation: closefs.c:ext2fs_needs_large_file_feature Unexecuted instantiation: csum.c:ext2fs_needs_large_file_feature Unexecuted instantiation: dir_iterate.c:ext2fs_needs_large_file_feature Unexecuted instantiation: freefs.c:ext2fs_needs_large_file_feature Unexecuted instantiation: gen_bitmap64.c:ext2fs_needs_large_file_feature Unexecuted instantiation: get_num_dirs.c:ext2fs_needs_large_file_feature Unexecuted instantiation: getenv.c:ext2fs_needs_large_file_feature Unexecuted instantiation: inline_data.c:ext2fs_needs_large_file_feature Unexecuted instantiation: inode.c:ext2fs_needs_large_file_feature Unexecuted instantiation: io_manager.c:ext2fs_needs_large_file_feature Unexecuted instantiation: mkjournal.c:ext2fs_needs_large_file_feature Unexecuted instantiation: mmp.c:ext2fs_needs_large_file_feature Unexecuted instantiation: openfs.c:ext2fs_needs_large_file_feature Unexecuted instantiation: read_bb.c:ext2fs_needs_large_file_feature Unexecuted instantiation: rw_bitmaps.c:ext2fs_needs_large_file_feature Unexecuted instantiation: unix_io.c:ext2fs_needs_large_file_feature Unexecuted instantiation: alloc.c:ext2fs_needs_large_file_feature Unexecuted instantiation: alloc_sb.c:ext2fs_needs_large_file_feature Unexecuted instantiation: alloc_stats.c:ext2fs_needs_large_file_feature Unexecuted instantiation: badblocks.c:ext2fs_needs_large_file_feature Unexecuted instantiation: bitmaps.c:ext2fs_needs_large_file_feature Unexecuted instantiation: bitops.c:ext2fs_needs_large_file_feature Unexecuted instantiation: blkmap64_ba.c:ext2fs_needs_large_file_feature Unexecuted instantiation: blkmap64_rb.c:ext2fs_needs_large_file_feature Unexecuted instantiation: block.c:ext2fs_needs_large_file_feature Unexecuted instantiation: bmap.c:ext2fs_needs_large_file_feature Unexecuted instantiation: crc32c.c:ext2fs_needs_large_file_feature Unexecuted instantiation: dirblock.c:ext2fs_needs_large_file_feature Unexecuted instantiation: ext_attr.c:ext2fs_needs_large_file_feature Unexecuted instantiation: extent.c:ext2fs_needs_large_file_feature Unexecuted instantiation: fallocate.c:ext2fs_needs_large_file_feature Unexecuted instantiation: fileio.c:ext2fs_needs_large_file_feature Unexecuted instantiation: gen_bitmap.c:ext2fs_needs_large_file_feature Unexecuted instantiation: getsectsize.c:ext2fs_needs_large_file_feature Unexecuted instantiation: i_block.c:ext2fs_needs_large_file_feature Unexecuted instantiation: ind_block.c:ext2fs_needs_large_file_feature Unexecuted instantiation: inline.c:ext2fs_needs_large_file_feature Unexecuted instantiation: ismounted.c:ext2fs_needs_large_file_feature Unexecuted instantiation: nls_utf8.c:ext2fs_needs_large_file_feature Unexecuted instantiation: punch.c:ext2fs_needs_large_file_feature Unexecuted instantiation: sha512.c:ext2fs_needs_large_file_feature Unexecuted instantiation: symlink.c:ext2fs_needs_large_file_feature Unexecuted instantiation: valid_blk.c:ext2fs_needs_large_file_feature Unexecuted instantiation: link.c:ext2fs_needs_large_file_feature Unexecuted instantiation: lookup.c:ext2fs_needs_large_file_feature Unexecuted instantiation: dirhash.c:ext2fs_needs_large_file_feature Unexecuted instantiation: expanddir.c:ext2fs_needs_large_file_feature Unexecuted instantiation: newdir.c:ext2fs_needs_large_file_feature Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:ext2fs_needs_large_file_feature(unsigned long long) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:ext2fs_needs_large_file_feature(unsigned long long) |
826 | | |
827 | | /* alloc.c */ |
828 | | extern void ext2fs_clear_block_uninit(ext2_filsys fs, dgrp_t group); |
829 | | extern errcode_t ext2fs_new_inode(ext2_filsys fs, ext2_ino_t dir, int mode, |
830 | | ext2fs_inode_bitmap map, ext2_ino_t *ret); |
831 | | extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal, |
832 | | ext2fs_block_bitmap map, blk_t *ret); |
833 | | extern errcode_t ext2fs_new_block2(ext2_filsys fs, blk64_t goal, |
834 | | ext2fs_block_bitmap map, blk64_t *ret); |
835 | | extern errcode_t ext2fs_new_block3(ext2_filsys fs, blk64_t goal, |
836 | | ext2fs_block_bitmap map, blk64_t *ret, |
837 | | struct blk_alloc_ctx *ctx); |
838 | | extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start, |
839 | | blk_t finish, int num, |
840 | | ext2fs_block_bitmap map, |
841 | | blk_t *ret); |
842 | | extern errcode_t ext2fs_get_free_blocks2(ext2_filsys fs, blk64_t start, |
843 | | blk64_t finish, int num, |
844 | | ext2fs_block_bitmap map, |
845 | | blk64_t *ret); |
846 | | extern errcode_t ext2fs_alloc_block(ext2_filsys fs, blk_t goal, |
847 | | char *block_buf, blk_t *ret); |
848 | | extern errcode_t ext2fs_alloc_block2(ext2_filsys fs, blk64_t goal, |
849 | | char *block_buf, blk64_t *ret); |
850 | | extern errcode_t ext2fs_alloc_block3(ext2_filsys fs, blk64_t goal, |
851 | | char *block_buf, blk64_t *ret, |
852 | | struct blk_alloc_ctx *ctx); |
853 | | |
854 | | extern void ext2fs_set_alloc_block_callback(ext2_filsys fs, |
855 | | errcode_t (*func)(ext2_filsys fs, |
856 | | blk64_t goal, |
857 | | blk64_t *ret), |
858 | | errcode_t (**old)(ext2_filsys fs, |
859 | | blk64_t goal, |
860 | | blk64_t *ret)); |
861 | | blk64_t ext2fs_find_inode_goal(ext2_filsys fs, ext2_ino_t ino, |
862 | | struct ext2_inode *inode, blk64_t lblk); |
863 | | extern void ext2fs_set_new_range_callback(ext2_filsys fs, |
864 | | errcode_t (*func)(ext2_filsys fs, int flags, blk64_t goal, |
865 | | blk64_t len, blk64_t *pblk, blk64_t *plen), |
866 | | errcode_t (**old)(ext2_filsys fs, int flags, blk64_t goal, |
867 | | blk64_t len, blk64_t *pblk, blk64_t *plen)); |
868 | | extern void ext2fs_set_block_alloc_stats_range_callback(ext2_filsys fs, |
869 | | void (*func)(ext2_filsys fs, blk64_t blk, |
870 | | blk_t num, int inuse), |
871 | | void (**old)(ext2_filsys fs, blk64_t blk, |
872 | | blk_t num, int inuse)); |
873 | 0 | #define EXT2_NEWRANGE_FIXED_GOAL (0x1) |
874 | 0 | #define EXT2_NEWRANGE_MIN_LENGTH (0x2) |
875 | 0 | #define EXT2_NEWRANGE_ALL_FLAGS (0x3) |
876 | | errcode_t ext2fs_new_range(ext2_filsys fs, int flags, blk64_t goal, |
877 | | blk64_t len, ext2fs_block_bitmap map, blk64_t *pblk, |
878 | | blk64_t *plen); |
879 | 0 | #define EXT2_ALLOCRANGE_FIXED_GOAL (0x1) |
880 | 0 | #define EXT2_ALLOCRANGE_ZERO_BLOCKS (0x2) |
881 | 0 | #define EXT2_ALLOCRANGE_ALL_FLAGS (0x3) |
882 | | errcode_t ext2fs_alloc_range(ext2_filsys fs, int flags, blk64_t goal, |
883 | | blk_t len, blk64_t *ret); |
884 | | |
885 | | /* alloc_sb.c */ |
886 | | extern int ext2fs_reserve_super_and_bgd(ext2_filsys fs, |
887 | | dgrp_t group, |
888 | | ext2fs_block_bitmap bmap); |
889 | | extern errcode_t ext2fs_reserve_super_and_bgd2(ext2_filsys fs, |
890 | | dgrp_t group, |
891 | | ext2fs_block_bitmap bmap, |
892 | | blk_t *desc_blocks); |
893 | | extern void ext2fs_set_block_alloc_stats_callback(ext2_filsys fs, |
894 | | void (*func)(ext2_filsys fs, |
895 | | blk64_t blk, |
896 | | int inuse), |
897 | | void (**old)(ext2_filsys fs, |
898 | | blk64_t blk, |
899 | | int inuse)); |
900 | | |
901 | | /* alloc_stats.c */ |
902 | | void ext2fs_inode_alloc_stats(ext2_filsys fs, ext2_ino_t ino, int inuse); |
903 | | void ext2fs_inode_alloc_stats2(ext2_filsys fs, ext2_ino_t ino, |
904 | | int inuse, int isdir); |
905 | | void ext2fs_block_alloc_stats(ext2_filsys fs, blk_t blk, int inuse); |
906 | | void ext2fs_block_alloc_stats2(ext2_filsys fs, blk64_t blk, int inuse); |
907 | | void ext2fs_block_alloc_stats_range(ext2_filsys fs, blk64_t blk, |
908 | | blk_t num, int inuse); |
909 | | |
910 | | /* alloc_tables.c */ |
911 | | extern errcode_t ext2fs_allocate_tables(ext2_filsys fs); |
912 | | extern errcode_t ext2fs_allocate_group_table(ext2_filsys fs, dgrp_t group, |
913 | | ext2fs_block_bitmap bmap); |
914 | | |
915 | | /* badblocks.c */ |
916 | | extern errcode_t ext2fs_u32_list_create(ext2_u32_list *ret, int size); |
917 | | extern errcode_t ext2fs_u32_list_add(ext2_u32_list bb, __u32 blk); |
918 | | extern int ext2fs_u32_list_find(ext2_u32_list bb, __u32 blk); |
919 | | extern int ext2fs_u32_list_test(ext2_u32_list bb, blk_t blk); |
920 | | extern errcode_t ext2fs_u32_list_iterate_begin(ext2_u32_list bb, |
921 | | ext2_u32_iterate *ret); |
922 | | extern int ext2fs_u32_list_iterate(ext2_u32_iterate iter, blk_t *blk); |
923 | | extern void ext2fs_u32_list_iterate_end(ext2_u32_iterate iter); |
924 | | extern errcode_t ext2fs_u32_copy(ext2_u32_list src, ext2_u32_list *dest); |
925 | | extern int ext2fs_u32_list_equal(ext2_u32_list bb1, ext2_u32_list bb2); |
926 | | |
927 | | extern errcode_t ext2fs_badblocks_list_create(ext2_badblocks_list *ret, |
928 | | int size); |
929 | | extern errcode_t ext2fs_badblocks_list_add(ext2_badblocks_list bb, |
930 | | blk_t blk); |
931 | | extern int ext2fs_badblocks_list_test(ext2_badblocks_list bb, |
932 | | blk_t blk); |
933 | | extern int ext2fs_u32_list_del(ext2_u32_list bb, __u32 blk); |
934 | | extern void ext2fs_badblocks_list_del(ext2_u32_list bb, __u32 blk); |
935 | | extern errcode_t |
936 | | ext2fs_badblocks_list_iterate_begin(ext2_badblocks_list bb, |
937 | | ext2_badblocks_iterate *ret); |
938 | | extern int ext2fs_badblocks_list_iterate(ext2_badblocks_iterate iter, |
939 | | blk_t *blk); |
940 | | extern void ext2fs_badblocks_list_iterate_end(ext2_badblocks_iterate iter); |
941 | | extern errcode_t ext2fs_badblocks_copy(ext2_badblocks_list src, |
942 | | ext2_badblocks_list *dest); |
943 | | extern int ext2fs_badblocks_equal(ext2_badblocks_list bb1, |
944 | | ext2_badblocks_list bb2); |
945 | | extern int ext2fs_u32_list_count(ext2_u32_list bb); |
946 | | |
947 | | /* bb_compat */ |
948 | | extern errcode_t badblocks_list_create(badblocks_list *ret, int size); |
949 | | extern errcode_t badblocks_list_add(badblocks_list bb, blk_t blk); |
950 | | extern int badblocks_list_test(badblocks_list bb, blk_t blk); |
951 | | extern errcode_t badblocks_list_iterate_begin(badblocks_list bb, |
952 | | badblocks_iterate *ret); |
953 | | extern int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk); |
954 | | extern void badblocks_list_iterate_end(badblocks_iterate iter); |
955 | | extern void badblocks_list_free(badblocks_list bb); |
956 | | |
957 | | /* bb_inode.c */ |
958 | | extern errcode_t ext2fs_update_bb_inode(ext2_filsys fs, |
959 | | ext2_badblocks_list bb_list); |
960 | | |
961 | | /* bitmaps.c */ |
962 | | extern void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap); |
963 | | extern void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap); |
964 | | extern errcode_t ext2fs_copy_bitmap(ext2fs_generic_bitmap src, |
965 | | ext2fs_generic_bitmap *dest); |
966 | | extern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, |
967 | | const char *descr, |
968 | | ext2fs_block_bitmap *ret); |
969 | | extern errcode_t ext2fs_allocate_subcluster_bitmap(ext2_filsys fs, |
970 | | const char *descr, |
971 | | ext2fs_block_bitmap *ret); |
972 | | extern int ext2fs_get_bitmap_granularity(ext2fs_block_bitmap bitmap); |
973 | | extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, |
974 | | const char *descr, |
975 | | ext2fs_inode_bitmap *ret); |
976 | | extern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap, |
977 | | ext2_ino_t end, ext2_ino_t *oend); |
978 | | extern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap, |
979 | | blk_t end, blk_t *oend); |
980 | | extern errcode_t ext2fs_fudge_block_bitmap_end2(ext2fs_block_bitmap bitmap, |
981 | | blk64_t end, blk64_t *oend); |
982 | | extern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap); |
983 | | extern void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap); |
984 | | extern errcode_t ext2fs_resize_inode_bitmap(__u32 new_end, __u32 new_real_end, |
985 | | ext2fs_inode_bitmap bmap); |
986 | | extern errcode_t ext2fs_resize_inode_bitmap2(__u64 new_end, |
987 | | __u64 new_real_end, |
988 | | ext2fs_inode_bitmap bmap); |
989 | | extern errcode_t ext2fs_resize_block_bitmap(__u32 new_end, __u32 new_real_end, |
990 | | ext2fs_block_bitmap bmap); |
991 | | extern errcode_t ext2fs_resize_block_bitmap2(__u64 new_end, |
992 | | __u64 new_real_end, |
993 | | ext2fs_block_bitmap bmap); |
994 | | extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1, |
995 | | ext2fs_block_bitmap bm2); |
996 | | extern errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1, |
997 | | ext2fs_inode_bitmap bm2); |
998 | | extern errcode_t ext2fs_set_inode_bitmap_range(ext2fs_inode_bitmap bmap, |
999 | | ext2_ino_t start, unsigned int num, |
1000 | | void *in); |
1001 | | extern errcode_t ext2fs_set_inode_bitmap_range2(ext2fs_inode_bitmap bmap, |
1002 | | __u64 start, size_t num, |
1003 | | void *in); |
1004 | | extern errcode_t ext2fs_get_inode_bitmap_range(ext2fs_inode_bitmap bmap, |
1005 | | ext2_ino_t start, unsigned int num, |
1006 | | void *out); |
1007 | | extern errcode_t ext2fs_get_inode_bitmap_range2(ext2fs_inode_bitmap bmap, |
1008 | | __u64 start, size_t num, |
1009 | | void *out); |
1010 | | extern errcode_t ext2fs_set_block_bitmap_range(ext2fs_block_bitmap bmap, |
1011 | | blk_t start, unsigned int num, |
1012 | | void *in); |
1013 | | extern errcode_t ext2fs_set_block_bitmap_range2(ext2fs_block_bitmap bmap, |
1014 | | blk64_t start, size_t num, |
1015 | | void *in); |
1016 | | extern errcode_t ext2fs_get_block_bitmap_range(ext2fs_block_bitmap bmap, |
1017 | | blk_t start, unsigned int num, |
1018 | | void *out); |
1019 | | extern errcode_t ext2fs_get_block_bitmap_range2(ext2fs_block_bitmap bmap, |
1020 | | blk64_t start, size_t num, |
1021 | | void *out); |
1022 | | |
1023 | | /* blknum.c */ |
1024 | | extern __u32 ext2fs_inode_bitmap_checksum(ext2_filsys fs, dgrp_t group); |
1025 | | extern __u32 ext2fs_block_bitmap_checksum(ext2_filsys fs, dgrp_t group); |
1026 | | extern dgrp_t ext2fs_group_of_blk2(ext2_filsys fs, blk64_t); |
1027 | | extern blk64_t ext2fs_group_first_block2(ext2_filsys fs, dgrp_t group); |
1028 | | extern blk64_t ext2fs_group_last_block2(ext2_filsys fs, dgrp_t group); |
1029 | | extern int ext2fs_group_blocks_count(ext2_filsys fs, dgrp_t group); |
1030 | | extern blk64_t ext2fs_inode_data_blocks2(ext2_filsys fs, |
1031 | | struct ext2_inode *inode); |
1032 | | extern blk64_t ext2fs_inode_i_blocks(ext2_filsys fs, |
1033 | | struct ext2_inode *inode); |
1034 | | extern blk64_t ext2fs_get_stat_i_blocks(ext2_filsys fs, |
1035 | | struct ext2_inode *inode); |
1036 | | extern blk64_t ext2fs_blocks_count(struct ext2_super_block *super); |
1037 | | extern void ext2fs_blocks_count_set(struct ext2_super_block *super, |
1038 | | blk64_t blk); |
1039 | | extern void ext2fs_blocks_count_add(struct ext2_super_block *super, |
1040 | | blk64_t blk); |
1041 | | extern blk64_t ext2fs_r_blocks_count(struct ext2_super_block *super); |
1042 | | extern void ext2fs_r_blocks_count_set(struct ext2_super_block *super, |
1043 | | blk64_t blk); |
1044 | | extern void ext2fs_r_blocks_count_add(struct ext2_super_block *super, |
1045 | | blk64_t blk); |
1046 | | extern blk64_t ext2fs_free_blocks_count(struct ext2_super_block *super); |
1047 | | extern void ext2fs_free_blocks_count_set(struct ext2_super_block *super, |
1048 | | blk64_t blk); |
1049 | | extern void ext2fs_free_blocks_count_add(struct ext2_super_block *super, |
1050 | | blk64_t blk); |
1051 | | /* Block group descriptor accessor functions */ |
1052 | | extern struct ext2_group_desc *ext2fs_group_desc(ext2_filsys fs, |
1053 | | struct opaque_ext2_group_desc *gdp, |
1054 | | dgrp_t group); |
1055 | | extern blk64_t ext2fs_block_bitmap_csum(ext2_filsys fs, dgrp_t group); |
1056 | | extern blk64_t ext2fs_block_bitmap_loc(ext2_filsys fs, dgrp_t group); |
1057 | | extern void ext2fs_block_bitmap_loc_set(ext2_filsys fs, dgrp_t group, |
1058 | | blk64_t blk); |
1059 | | extern __u32 ext2fs_inode_bitmap_csum(ext2_filsys fs, dgrp_t group); |
1060 | | extern blk64_t ext2fs_inode_bitmap_loc(ext2_filsys fs, dgrp_t group); |
1061 | | extern void ext2fs_inode_bitmap_loc_set(ext2_filsys fs, dgrp_t group, |
1062 | | blk64_t blk); |
1063 | | extern blk64_t ext2fs_inode_table_loc(ext2_filsys fs, dgrp_t group); |
1064 | | extern void ext2fs_inode_table_loc_set(ext2_filsys fs, dgrp_t group, |
1065 | | blk64_t blk); |
1066 | | extern __u32 ext2fs_bg_free_blocks_count(ext2_filsys fs, dgrp_t group); |
1067 | | extern void ext2fs_bg_free_blocks_count_set(ext2_filsys fs, dgrp_t group, |
1068 | | __u32 n); |
1069 | | extern __u32 ext2fs_bg_free_inodes_count(ext2_filsys fs, dgrp_t group); |
1070 | | extern void ext2fs_bg_free_inodes_count_set(ext2_filsys fs, dgrp_t group, |
1071 | | __u32 n); |
1072 | | extern __u32 ext2fs_bg_used_dirs_count(ext2_filsys fs, dgrp_t group); |
1073 | | extern void ext2fs_bg_used_dirs_count_set(ext2_filsys fs, dgrp_t group, |
1074 | | __u32 n); |
1075 | | extern __u32 ext2fs_bg_itable_unused(ext2_filsys fs, dgrp_t group); |
1076 | | extern void ext2fs_bg_itable_unused_set(ext2_filsys fs, dgrp_t group, |
1077 | | __u32 n); |
1078 | | extern __u16 ext2fs_bg_flags(ext2_filsys fs, dgrp_t group); |
1079 | | extern void ext2fs_bg_flags_zap(ext2_filsys fs, dgrp_t group); |
1080 | | extern int ext2fs_bg_flags_test(ext2_filsys fs, dgrp_t group, __u16 bg_flag); |
1081 | | extern void ext2fs_bg_flags_set(ext2_filsys fs, dgrp_t group, __u16 bg_flags); |
1082 | | extern void ext2fs_bg_flags_clear(ext2_filsys fs, dgrp_t group, __u16 bg_flags); |
1083 | | extern __u16 ext2fs_bg_checksum(ext2_filsys fs, dgrp_t group); |
1084 | | extern void ext2fs_bg_checksum_set(ext2_filsys fs, dgrp_t group, __u16 checksum); |
1085 | | extern blk64_t ext2fs_file_acl_block(ext2_filsys fs, |
1086 | | const struct ext2_inode *inode); |
1087 | | extern void ext2fs_file_acl_block_set(ext2_filsys fs, |
1088 | | struct ext2_inode *inode, blk64_t blk); |
1089 | | extern errcode_t ext2fs_inode_size_set(ext2_filsys fs, struct ext2_inode *inode, |
1090 | | ext2_off64_t size); |
1091 | | |
1092 | | /* block.c */ |
1093 | | extern errcode_t ext2fs_block_iterate(ext2_filsys fs, |
1094 | | ext2_ino_t ino, |
1095 | | int flags, |
1096 | | char *block_buf, |
1097 | | int (*func)(ext2_filsys fs, |
1098 | | blk_t *blocknr, |
1099 | | int blockcnt, |
1100 | | void *priv_data), |
1101 | | void *priv_data); |
1102 | | errcode_t ext2fs_block_iterate2(ext2_filsys fs, |
1103 | | ext2_ino_t ino, |
1104 | | int flags, |
1105 | | char *block_buf, |
1106 | | int (*func)(ext2_filsys fs, |
1107 | | blk_t *blocknr, |
1108 | | e2_blkcnt_t blockcnt, |
1109 | | blk_t ref_blk, |
1110 | | int ref_offset, |
1111 | | void *priv_data), |
1112 | | void *priv_data); |
1113 | | errcode_t ext2fs_block_iterate3(ext2_filsys fs, |
1114 | | ext2_ino_t ino, |
1115 | | int flags, |
1116 | | char *block_buf, |
1117 | | int (*func)(ext2_filsys fs, |
1118 | | blk64_t *blocknr, |
1119 | | e2_blkcnt_t blockcnt, |
1120 | | blk64_t ref_blk, |
1121 | | int ref_offset, |
1122 | | void *priv_data), |
1123 | | void *priv_data); |
1124 | | |
1125 | | /* bmap.c */ |
1126 | | extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, |
1127 | | struct ext2_inode *inode, |
1128 | | char *block_buf, int bmap_flags, |
1129 | | blk_t block, blk_t *phys_blk); |
1130 | | extern errcode_t ext2fs_bmap2(ext2_filsys fs, ext2_ino_t ino, |
1131 | | struct ext2_inode *inode, |
1132 | | char *block_buf, int bmap_flags, blk64_t block, |
1133 | | int *ret_flags, blk64_t *phys_blk); |
1134 | | errcode_t ext2fs_map_cluster_block(ext2_filsys fs, ext2_ino_t ino, |
1135 | | struct ext2_inode *inode, blk64_t lblk, |
1136 | | blk64_t *pblk); |
1137 | | |
1138 | | #if 0 |
1139 | | /* bmove.c */ |
1140 | | extern errcode_t ext2fs_move_blocks(ext2_filsys fs, |
1141 | | ext2fs_block_bitmap reserve, |
1142 | | ext2fs_block_bitmap alloc_map, |
1143 | | int flags); |
1144 | | #endif |
1145 | | |
1146 | | /* check_desc.c */ |
1147 | | extern errcode_t ext2fs_check_desc(ext2_filsys fs); |
1148 | | |
1149 | | /* closefs.c */ |
1150 | | extern errcode_t ext2fs_close(ext2_filsys fs); |
1151 | | extern errcode_t ext2fs_close2(ext2_filsys fs, int flags); |
1152 | | extern errcode_t ext2fs_close_free(ext2_filsys *fs); |
1153 | | extern errcode_t ext2fs_flush(ext2_filsys fs); |
1154 | | extern errcode_t ext2fs_flush2(ext2_filsys fs, int flags); |
1155 | | extern int ext2fs_bg_has_super(ext2_filsys fs, dgrp_t group_block); |
1156 | | extern errcode_t ext2fs_super_and_bgd_loc2(ext2_filsys fs, |
1157 | | dgrp_t group, |
1158 | | blk64_t *ret_super_blk, |
1159 | | blk64_t *ret_old_desc_blk, |
1160 | | blk64_t *ret_new_desc_blk, |
1161 | | blk_t *ret_used_blks); |
1162 | | extern int ext2fs_super_and_bgd_loc(ext2_filsys fs, |
1163 | | dgrp_t group, |
1164 | | blk_t *ret_super_blk, |
1165 | | blk_t *ret_old_desc_blk, |
1166 | | blk_t *ret_new_desc_blk, |
1167 | | int *ret_meta_bg); |
1168 | | extern void ext2fs_update_dynamic_rev(ext2_filsys fs); |
1169 | | |
1170 | | /* crc32c.c */ |
1171 | | extern __u32 ext2fs_crc32_be(__u32 crc, unsigned char const *p, size_t len); |
1172 | | extern __u32 ext2fs_crc32c_le(__u32 crc, unsigned char const *p, size_t len); |
1173 | | |
1174 | | /* csum.c */ |
1175 | | extern void ext2fs_init_csum_seed(ext2_filsys fs); |
1176 | | extern errcode_t ext2fs_mmp_csum_set(ext2_filsys fs, struct mmp_struct *mmp); |
1177 | | extern int ext2fs_mmp_csum_verify(ext2_filsys, struct mmp_struct *mmp); |
1178 | | extern int ext2fs_verify_csum_type(ext2_filsys fs, struct ext2_super_block *sb); |
1179 | | extern errcode_t ext2fs_superblock_csum_set(ext2_filsys fs, |
1180 | | struct ext2_super_block *sb); |
1181 | | extern int ext2fs_superblock_csum_verify(ext2_filsys fs, |
1182 | | struct ext2_super_block *sb); |
1183 | | extern errcode_t ext2fs_ext_attr_block_csum_set(ext2_filsys fs, |
1184 | | ext2_ino_t inum, blk64_t block, |
1185 | | struct ext2_ext_attr_header *hdr); |
1186 | | extern int ext2fs_ext_attr_block_csum_verify(ext2_filsys fs, ext2_ino_t inum, |
1187 | | blk64_t block, |
1188 | | struct ext2_ext_attr_header *hdr); |
1189 | | #define EXT2_DIRENT_TAIL(block, blocksize) \ |
1190 | 0 | ((struct ext2_dir_entry_tail *)(((char *)(block)) + \ |
1191 | 0 | (blocksize) - sizeof(struct ext2_dir_entry_tail))) |
1192 | | |
1193 | | extern void ext2fs_initialize_dirent_tail(ext2_filsys fs, |
1194 | | struct ext2_dir_entry_tail *t); |
1195 | | extern int ext2fs_dirent_has_tail(ext2_filsys fs, |
1196 | | struct ext2_dir_entry *dirent); |
1197 | | extern int ext2fs_dirent_csum_verify(ext2_filsys fs, ext2_ino_t inum, |
1198 | | struct ext2_dir_entry *dirent); |
1199 | | extern int ext2fs_dir_block_csum_verify(ext2_filsys fs, ext2_ino_t inum, |
1200 | | struct ext2_dir_entry *dirent); |
1201 | | extern errcode_t ext2fs_dir_block_csum_set(ext2_filsys fs, ext2_ino_t inum, |
1202 | | struct ext2_dir_entry *dirent); |
1203 | | extern errcode_t ext2fs_get_dx_countlimit(ext2_filsys fs, |
1204 | | struct ext2_dir_entry *dirent, |
1205 | | struct ext2_dx_countlimit **cc, |
1206 | | int *offset); |
1207 | | extern errcode_t ext2fs_dx_csum(ext2_filsys fs, ext2_ino_t inum, |
1208 | | struct ext2_dir_entry *dirent, |
1209 | | __u32 *crc, struct ext2_dx_tail **ret_t); |
1210 | | extern errcode_t ext2fs_extent_block_csum_set(ext2_filsys fs, |
1211 | | ext2_ino_t inum, |
1212 | | struct ext3_extent_header *eh); |
1213 | | extern int ext2fs_extent_block_csum_verify(ext2_filsys fs, |
1214 | | ext2_ino_t inum, |
1215 | | struct ext3_extent_header *eh); |
1216 | | extern errcode_t ext2fs_block_bitmap_csum_set(ext2_filsys fs, dgrp_t group, |
1217 | | char *bitmap, int size); |
1218 | | extern int ext2fs_block_bitmap_csum_verify(ext2_filsys fs, dgrp_t group, |
1219 | | char *bitmap, int size); |
1220 | | extern errcode_t ext2fs_inode_bitmap_csum_set(ext2_filsys fs, dgrp_t group, |
1221 | | char *bitmap, int size); |
1222 | | extern int ext2fs_inode_bitmap_csum_verify(ext2_filsys fs, dgrp_t group, |
1223 | | char *bitmap, int size); |
1224 | | extern errcode_t ext2fs_inode_csum_set(ext2_filsys fs, ext2_ino_t inum, |
1225 | | struct ext2_inode_large *inode); |
1226 | | extern int ext2fs_inode_csum_verify(ext2_filsys fs, ext2_ino_t inum, |
1227 | | struct ext2_inode_large *inode); |
1228 | | extern void ext2fs_group_desc_csum_set(ext2_filsys fs, dgrp_t group); |
1229 | | extern int ext2fs_group_desc_csum_verify(ext2_filsys fs, dgrp_t group); |
1230 | | extern errcode_t ext2fs_set_gdt_csum(ext2_filsys fs); |
1231 | | extern __u16 ext2fs_group_desc_csum(ext2_filsys fs, dgrp_t group); |
1232 | | |
1233 | | /* dblist.c */ |
1234 | | extern errcode_t ext2fs_init_dblist(ext2_filsys fs, ext2_dblist *ret_dblist); |
1235 | | extern errcode_t ext2fs_add_dir_block(ext2_dblist dblist, ext2_ino_t ino, |
1236 | | blk_t blk, int blockcnt); |
1237 | | extern errcode_t ext2fs_add_dir_block2(ext2_dblist dblist, ext2_ino_t ino, |
1238 | | blk64_t blk, e2_blkcnt_t blockcnt); |
1239 | | extern void ext2fs_dblist_sort(ext2_dblist dblist, |
1240 | | EXT2_QSORT_TYPE (*sortfunc)(const void *, |
1241 | | const void *)); |
1242 | | extern void ext2fs_dblist_sort2(ext2_dblist dblist, |
1243 | | EXT2_QSORT_TYPE (*sortfunc)(const void *, |
1244 | | const void *)); |
1245 | | extern errcode_t ext2fs_dblist_iterate(ext2_dblist dblist, |
1246 | | int (*func)(ext2_filsys fs, struct ext2_db_entry *db_info, |
1247 | | void *priv_data), |
1248 | | void *priv_data); |
1249 | | extern errcode_t ext2fs_dblist_iterate2(ext2_dblist dblist, |
1250 | | int (*func)(ext2_filsys fs, struct ext2_db_entry2 *db_info, |
1251 | | void *priv_data), |
1252 | | void *priv_data); |
1253 | | extern errcode_t ext2fs_dblist_iterate3(ext2_dblist dblist, |
1254 | | int (*func)(ext2_filsys fs, struct ext2_db_entry2 *db_info, |
1255 | | void *priv_data), |
1256 | | unsigned long long start, |
1257 | | unsigned long long count, |
1258 | | void *priv_data); |
1259 | | extern errcode_t ext2fs_set_dir_block(ext2_dblist dblist, ext2_ino_t ino, |
1260 | | blk_t blk, int blockcnt); |
1261 | | extern errcode_t ext2fs_set_dir_block2(ext2_dblist dblist, ext2_ino_t ino, |
1262 | | blk64_t blk, e2_blkcnt_t blockcnt); |
1263 | | extern errcode_t ext2fs_copy_dblist(ext2_dblist src, |
1264 | | ext2_dblist *dest); |
1265 | | extern int ext2fs_dblist_count(ext2_dblist dblist); |
1266 | | extern blk64_t ext2fs_dblist_count2(ext2_dblist dblist); |
1267 | | extern errcode_t ext2fs_dblist_get_last(ext2_dblist dblist, |
1268 | | struct ext2_db_entry **entry); |
1269 | | extern errcode_t ext2fs_dblist_get_last2(ext2_dblist dblist, |
1270 | | struct ext2_db_entry2 **entry); |
1271 | | extern errcode_t ext2fs_dblist_drop_last(ext2_dblist dblist); |
1272 | | |
1273 | | /* dblist_dir.c */ |
1274 | | extern errcode_t |
1275 | | ext2fs_dblist_dir_iterate(ext2_dblist dblist, |
1276 | | int flags, |
1277 | | char *block_buf, |
1278 | | int (*func)(ext2_ino_t dir, |
1279 | | int entry, |
1280 | | struct ext2_dir_entry *dirent, |
1281 | | int offset, |
1282 | | int blocksize, |
1283 | | char *buf, |
1284 | | void *priv_data), |
1285 | | void *priv_data); |
1286 | | |
1287 | | #if 0 |
1288 | | /* digest_encode.c */ |
1289 | | #define EXT2FS_DIGEST_SIZE EXT2FS_SHA256_LENGTH |
1290 | | extern int ext2fs_digest_encode(const char *src, int len, char *dst); |
1291 | | extern int ext2fs_digest_decode(const char *src, int len, char *dst); |
1292 | | #endif |
1293 | | |
1294 | | /* dirblock.c */ |
1295 | | extern errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block, |
1296 | | void *buf); |
1297 | | extern errcode_t ext2fs_read_dir_block2(ext2_filsys fs, blk_t block, |
1298 | | void *buf, int flags); |
1299 | | extern errcode_t ext2fs_read_dir_block3(ext2_filsys fs, blk64_t block, |
1300 | | void *buf, int flags); |
1301 | | extern errcode_t ext2fs_read_dir_block4(ext2_filsys fs, blk64_t block, |
1302 | | void *buf, int flags, ext2_ino_t ino); |
1303 | | extern errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block, |
1304 | | void *buf); |
1305 | | extern errcode_t ext2fs_write_dir_block2(ext2_filsys fs, blk_t block, |
1306 | | void *buf, int flags); |
1307 | | extern errcode_t ext2fs_write_dir_block3(ext2_filsys fs, blk64_t block, |
1308 | | void *buf, int flags); |
1309 | | extern errcode_t ext2fs_write_dir_block4(ext2_filsys fs, blk64_t block, |
1310 | | void *buf, int flags, ext2_ino_t ino); |
1311 | | |
1312 | | /* dirhash.c */ |
1313 | | extern errcode_t ext2fs_dirhash(int version, const char *name, int len, |
1314 | | const __u32 *seed, |
1315 | | ext2_dirhash_t *ret_hash, |
1316 | | ext2_dirhash_t *ret_minor_hash); |
1317 | | |
1318 | | extern errcode_t ext2fs_dirhash2(int version, const char *name, int len, |
1319 | | const struct ext2fs_nls_table *charset, |
1320 | | int hash_flags, |
1321 | | const __u32 *seed, |
1322 | | ext2_dirhash_t *ret_hash, |
1323 | | ext2_dirhash_t *ret_minor_hash); |
1324 | | |
1325 | | /* dir_iterate.c */ |
1326 | | extern errcode_t ext2fs_get_rec_len(ext2_filsys fs, |
1327 | | struct ext2_dir_entry *dirent, |
1328 | | unsigned int *rec_len); |
1329 | | extern errcode_t ext2fs_set_rec_len(ext2_filsys fs, |
1330 | | unsigned int len, |
1331 | | struct ext2_dir_entry *dirent); |
1332 | | extern errcode_t ext2fs_dir_iterate(ext2_filsys fs, |
1333 | | ext2_ino_t dir, |
1334 | | int flags, |
1335 | | char *block_buf, |
1336 | | int (*func)(struct ext2_dir_entry *dirent, |
1337 | | int offset, |
1338 | | int blocksize, |
1339 | | char *buf, |
1340 | | void *priv_data), |
1341 | | void *priv_data); |
1342 | | extern errcode_t ext2fs_dir_iterate2(ext2_filsys fs, |
1343 | | ext2_ino_t dir, |
1344 | | int flags, |
1345 | | char *block_buf, |
1346 | | int (*func)(ext2_ino_t dir, |
1347 | | int entry, |
1348 | | struct ext2_dir_entry *dirent, |
1349 | | int offset, |
1350 | | int blocksize, |
1351 | | char *buf, |
1352 | | void *priv_data), |
1353 | | void *priv_data); |
1354 | | |
1355 | | /* dupfs.c */ |
1356 | | extern errcode_t ext2fs_dup_handle(ext2_filsys src, ext2_filsys *dest); |
1357 | | |
1358 | | /* expanddir.c */ |
1359 | | extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ext2_ino_t dir); |
1360 | | |
1361 | | /* ext_attr.c */ |
1362 | | extern __u32 ext2fs_ext_attr_hash_entry(struct ext2_ext_attr_entry *entry, |
1363 | | void *data); |
1364 | | extern __u32 ext2fs_ext_attr_hash_entry_signed(struct ext2_ext_attr_entry *entry, |
1365 | | void *data); |
1366 | | extern errcode_t ext2fs_ext_attr_hash_entry2(ext2_filsys fs, |
1367 | | struct ext2_ext_attr_entry *entry, |
1368 | | void *data, __u32 *hash); |
1369 | | extern errcode_t ext2fs_ext_attr_hash_entry3(ext2_filsys fs, |
1370 | | struct ext2_ext_attr_entry *entry, |
1371 | | void *data, __u32 *hash, |
1372 | | __u32 *signed_hash); |
1373 | | extern errcode_t ext2fs_read_ext_attr(ext2_filsys fs, blk_t block, void *buf); |
1374 | | extern errcode_t ext2fs_read_ext_attr2(ext2_filsys fs, blk64_t block, |
1375 | | void *buf); |
1376 | | extern errcode_t ext2fs_read_ext_attr3(ext2_filsys fs, blk64_t block, |
1377 | | void *buf, ext2_ino_t inum); |
1378 | | extern errcode_t ext2fs_write_ext_attr(ext2_filsys fs, blk_t block, |
1379 | | void *buf); |
1380 | | extern errcode_t ext2fs_write_ext_attr2(ext2_filsys fs, blk64_t block, |
1381 | | void *buf); |
1382 | | extern errcode_t ext2fs_write_ext_attr3(ext2_filsys fs, blk64_t block, |
1383 | | void *buf, ext2_ino_t inum); |
1384 | | extern errcode_t ext2fs_adjust_ea_refcount(ext2_filsys fs, blk_t blk, |
1385 | | char *block_buf, |
1386 | | int adjust, __u32 *newcount); |
1387 | | extern errcode_t ext2fs_adjust_ea_refcount2(ext2_filsys fs, blk64_t blk, |
1388 | | char *block_buf, |
1389 | | int adjust, __u32 *newcount); |
1390 | | extern errcode_t ext2fs_adjust_ea_refcount3(ext2_filsys fs, blk64_t blk, |
1391 | | char *block_buf, |
1392 | | int adjust, __u32 *newcount, |
1393 | | ext2_ino_t inum); |
1394 | | errcode_t ext2fs_xattrs_write(struct ext2_xattr_handle *handle); |
1395 | | errcode_t ext2fs_xattrs_read(struct ext2_xattr_handle *handle); |
1396 | | errcode_t ext2fs_xattrs_read_inode(struct ext2_xattr_handle *handle, |
1397 | | struct ext2_inode_large *inode); |
1398 | | errcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h, |
1399 | | int (*func)(char *name, char *value, |
1400 | | size_t value_len, void *data), |
1401 | | void *data); |
1402 | | errcode_t ext2fs_xattr_get(struct ext2_xattr_handle *h, const char *key, |
1403 | | void **value, size_t *value_len); |
1404 | | errcode_t ext2fs_xattr_set(struct ext2_xattr_handle *handle, |
1405 | | const char *key, |
1406 | | const void *value, |
1407 | | size_t value_len); |
1408 | | errcode_t ext2fs_xattr_remove(struct ext2_xattr_handle *handle, |
1409 | | const char *key); |
1410 | | errcode_t ext2fs_xattr_remove_all(struct ext2_xattr_handle *handle); |
1411 | | errcode_t ext2fs_xattrs_open(ext2_filsys fs, ext2_ino_t ino, |
1412 | | struct ext2_xattr_handle **handle); |
1413 | | errcode_t ext2fs_xattrs_close(struct ext2_xattr_handle **handle); |
1414 | | errcode_t ext2fs_free_ext_attr(ext2_filsys fs, ext2_ino_t ino, |
1415 | | struct ext2_inode_large *inode); |
1416 | | errcode_t ext2fs_xattrs_count(struct ext2_xattr_handle *handle, size_t *count); |
1417 | | errcode_t ext2fs_xattr_inode_max_size(ext2_filsys fs, ext2_ino_t ino, |
1418 | | size_t *size); |
1419 | 0 | #define XATTR_HANDLE_FLAG_RAW 0x0001 |
1420 | | errcode_t ext2fs_xattrs_flags(struct ext2_xattr_handle *handle, |
1421 | | unsigned int *new_flags, unsigned int *old_flags); |
1422 | | extern void ext2fs_ext_attr_block_rehash(struct ext2_ext_attr_header *header, |
1423 | | struct ext2_ext_attr_entry *end); |
1424 | | extern __u32 ext2fs_get_ea_inode_hash(struct ext2_inode *inode); |
1425 | | extern void ext2fs_set_ea_inode_hash(struct ext2_inode *inode, __u32 hash); |
1426 | | extern __u64 ext2fs_get_ea_inode_ref(struct ext2_inode *inode); |
1427 | | extern void ext2fs_set_ea_inode_ref(struct ext2_inode *inode, __u64 ref_count); |
1428 | | |
1429 | | /* extent.c */ |
1430 | | extern errcode_t ext2fs_extent_header_verify(void *ptr, int size); |
1431 | | extern errcode_t ext2fs_extent_open(ext2_filsys fs, ext2_ino_t ino, |
1432 | | ext2_extent_handle_t *handle); |
1433 | | extern errcode_t ext2fs_extent_open2(ext2_filsys fs, ext2_ino_t ino, |
1434 | | struct ext2_inode *inode, |
1435 | | ext2_extent_handle_t *ret_handle); |
1436 | | extern void ext2fs_extent_free(ext2_extent_handle_t handle); |
1437 | | extern errcode_t ext2fs_extent_get(ext2_extent_handle_t handle, |
1438 | | int flags, struct ext2fs_extent *extent); |
1439 | | extern errcode_t ext2fs_extent_node_split(ext2_extent_handle_t handle); |
1440 | | extern errcode_t ext2fs_extent_replace(ext2_extent_handle_t handle, int flags, |
1441 | | struct ext2fs_extent *extent); |
1442 | | extern errcode_t ext2fs_extent_insert(ext2_extent_handle_t handle, int flags, |
1443 | | struct ext2fs_extent *extent); |
1444 | | extern errcode_t ext2fs_extent_set_bmap(ext2_extent_handle_t handle, |
1445 | | blk64_t logical, blk64_t physical, |
1446 | | int flags); |
1447 | | extern errcode_t ext2fs_extent_delete(ext2_extent_handle_t handle, int flags); |
1448 | | extern errcode_t ext2fs_extent_get_info(ext2_extent_handle_t handle, |
1449 | | struct ext2_extent_info *info); |
1450 | | extern errcode_t ext2fs_extent_goto(ext2_extent_handle_t handle, |
1451 | | blk64_t blk); |
1452 | | extern errcode_t ext2fs_extent_goto2(ext2_extent_handle_t handle, |
1453 | | int leaf_level, blk64_t blk); |
1454 | | extern errcode_t ext2fs_extent_fix_parents(ext2_extent_handle_t handle); |
1455 | | extern size_t ext2fs_max_extent_depth(ext2_extent_handle_t handle); |
1456 | | extern errcode_t ext2fs_fix_extents_checksums(ext2_filsys fs, ext2_ino_t ino, |
1457 | | struct ext2_inode *inode); |
1458 | | extern errcode_t ext2fs_count_blocks(ext2_filsys fs, ext2_ino_t ino, |
1459 | | struct ext2_inode *inode, blk64_t *ret_count); |
1460 | | extern errcode_t ext2fs_decode_extent(struct ext2fs_extent *to, void *from, |
1461 | | int len); |
1462 | | |
1463 | | /* fallocate.c */ |
1464 | 0 | #define EXT2_FALLOCATE_ZERO_BLOCKS (0x1) |
1465 | 0 | #define EXT2_FALLOCATE_FORCE_INIT (0x2) |
1466 | 0 | #define EXT2_FALLOCATE_FORCE_UNINIT (0x4) |
1467 | 0 | #define EXT2_FALLOCATE_INIT_BEYOND_EOF (0x8) |
1468 | 0 | #define EXT2_FALLOCATE_ALL_FLAGS (0xF) |
1469 | | errcode_t ext2fs_fallocate(ext2_filsys fs, int flags, ext2_ino_t ino, |
1470 | | struct ext2_inode *inode, blk64_t goal, |
1471 | | blk64_t start, blk64_t len); |
1472 | | |
1473 | | /* fileio.c */ |
1474 | | extern errcode_t ext2fs_file_open2(ext2_filsys fs, ext2_ino_t ino, |
1475 | | struct ext2_inode *inode, |
1476 | | int flags, ext2_file_t *ret); |
1477 | | extern errcode_t ext2fs_file_open(ext2_filsys fs, ext2_ino_t ino, |
1478 | | int flags, ext2_file_t *ret); |
1479 | | extern ext2_filsys ext2fs_file_get_fs(ext2_file_t file); |
1480 | | struct ext2_inode *ext2fs_file_get_inode(ext2_file_t file); |
1481 | | extern ext2_ino_t ext2fs_file_get_inode_num(ext2_file_t file); |
1482 | | extern errcode_t ext2fs_file_close(ext2_file_t file); |
1483 | | extern errcode_t ext2fs_file_flush(ext2_file_t file); |
1484 | | extern errcode_t ext2fs_file_read(ext2_file_t file, void *buf, |
1485 | | unsigned int wanted, unsigned int *got); |
1486 | | extern errcode_t ext2fs_file_write(ext2_file_t file, const void *buf, |
1487 | | unsigned int nbytes, unsigned int *written); |
1488 | | extern errcode_t ext2fs_file_llseek(ext2_file_t file, __u64 offset, |
1489 | | int whence, __u64 *ret_pos); |
1490 | | extern errcode_t ext2fs_file_lseek(ext2_file_t file, ext2_off_t offset, |
1491 | | int whence, ext2_off_t *ret_pos); |
1492 | | errcode_t ext2fs_file_get_lsize(ext2_file_t file, __u64 *ret_size); |
1493 | | extern ext2_off_t ext2fs_file_get_size(ext2_file_t file); |
1494 | | extern errcode_t ext2fs_file_set_size(ext2_file_t file, ext2_off_t size); |
1495 | | extern errcode_t ext2fs_file_set_size2(ext2_file_t file, ext2_off64_t size); |
1496 | | |
1497 | | /* finddev.c */ |
1498 | | extern char *ext2fs_find_block_device(dev_t device); |
1499 | | |
1500 | | /* flushb.c */ |
1501 | | extern errcode_t ext2fs_sync_device(int fd, int flushb); |
1502 | | |
1503 | | /* freefs.c */ |
1504 | | extern void ext2fs_free(ext2_filsys fs); |
1505 | | extern void ext2fs_free_dblist(ext2_dblist dblist); |
1506 | | extern void ext2fs_badblocks_list_free(ext2_badblocks_list bb); |
1507 | | extern void ext2fs_u32_list_free(ext2_u32_list bb); |
1508 | | |
1509 | | /* gen_bitmap.c */ |
1510 | | extern void ext2fs_free_generic_bitmap(ext2fs_inode_bitmap bitmap); |
1511 | | extern errcode_t ext2fs_make_generic_bitmap(errcode_t magic, ext2_filsys fs, |
1512 | | __u32 start, __u32 end, |
1513 | | __u32 real_end, |
1514 | | const char *descr, char *init_map, |
1515 | | ext2fs_generic_bitmap *ret); |
1516 | | extern errcode_t ext2fs_allocate_generic_bitmap(__u32 start, |
1517 | | __u32 end, |
1518 | | __u32 real_end, |
1519 | | const char *descr, |
1520 | | ext2fs_generic_bitmap *ret); |
1521 | | extern errcode_t ext2fs_copy_generic_bitmap(ext2fs_generic_bitmap src, |
1522 | | ext2fs_generic_bitmap *dest); |
1523 | | extern void ext2fs_clear_generic_bitmap(ext2fs_generic_bitmap bitmap); |
1524 | | extern errcode_t ext2fs_fudge_generic_bitmap_end(ext2fs_inode_bitmap bitmap, |
1525 | | errcode_t magic, |
1526 | | errcode_t neq, |
1527 | | ext2_ino_t end, |
1528 | | ext2_ino_t *oend); |
1529 | | extern void ext2fs_set_generic_bitmap_padding(ext2fs_generic_bitmap map); |
1530 | | extern errcode_t ext2fs_resize_generic_bitmap(errcode_t magic, |
1531 | | __u32 new_end, |
1532 | | __u32 new_real_end, |
1533 | | ext2fs_generic_bitmap bmap); |
1534 | | extern errcode_t ext2fs_compare_generic_bitmap(errcode_t magic, errcode_t neq, |
1535 | | ext2fs_generic_bitmap bm1, |
1536 | | ext2fs_generic_bitmap bm2); |
1537 | | extern errcode_t ext2fs_get_generic_bitmap_range(ext2fs_generic_bitmap bmap, |
1538 | | errcode_t magic, |
1539 | | __u32 start, __u32 num, |
1540 | | void *out); |
1541 | | extern errcode_t ext2fs_set_generic_bitmap_range(ext2fs_generic_bitmap bmap, |
1542 | | errcode_t magic, |
1543 | | __u32 start, __u32 num, |
1544 | | void *in); |
1545 | | extern errcode_t ext2fs_find_first_zero_generic_bitmap(ext2fs_generic_bitmap bitmap, |
1546 | | __u32 start, __u32 end, |
1547 | | __u32 *out); |
1548 | | extern errcode_t ext2fs_find_first_set_generic_bitmap(ext2fs_generic_bitmap bitmap, |
1549 | | __u32 start, __u32 end, |
1550 | | __u32 *out); |
1551 | | |
1552 | | /* gen_bitmap64.c */ |
1553 | | void ext2fs_free_generic_bmap(ext2fs_generic_bitmap bmap); |
1554 | | errcode_t ext2fs_alloc_generic_bmap(ext2_filsys fs, errcode_t magic, |
1555 | | int type, __u64 start, __u64 end, |
1556 | | __u64 real_end, |
1557 | | const char *descr, |
1558 | | ext2fs_generic_bitmap *ret); |
1559 | | errcode_t ext2fs_copy_generic_bmap(ext2fs_generic_bitmap src, |
1560 | | ext2fs_generic_bitmap *dest); |
1561 | | void ext2fs_clear_generic_bmap(ext2fs_generic_bitmap bitmap); |
1562 | | errcode_t ext2fs_fudge_generic_bmap_end(ext2fs_generic_bitmap bitmap, |
1563 | | errcode_t neq, |
1564 | | __u64 end, __u64 *oend); |
1565 | | void ext2fs_set_generic_bmap_padding(ext2fs_generic_bitmap bmap); |
1566 | | errcode_t ext2fs_resize_generic_bmap(ext2fs_generic_bitmap bmap, |
1567 | | __u64 new_end, |
1568 | | __u64 new_real_end); |
1569 | | errcode_t ext2fs_compare_generic_bmap(errcode_t neq, |
1570 | | ext2fs_generic_bitmap bm1, |
1571 | | ext2fs_generic_bitmap bm2); |
1572 | | errcode_t ext2fs_get_generic_bmap_range(ext2fs_generic_bitmap bmap, |
1573 | | __u64 start, unsigned int num, |
1574 | | void *out); |
1575 | | errcode_t ext2fs_set_generic_bmap_range(ext2fs_generic_bitmap bmap, |
1576 | | __u64 start, unsigned int num, |
1577 | | void *in); |
1578 | | errcode_t ext2fs_convert_subcluster_bitmap(ext2_filsys fs, |
1579 | | ext2fs_block_bitmap *bitmap); |
1580 | | errcode_t ext2fs_count_used_clusters(ext2_filsys fs, blk64_t start, |
1581 | | blk64_t end, blk64_t *out); |
1582 | | errcode_t ext2fs_count_used_blocks(ext2_filsys fs, blk64_t start, |
1583 | | blk64_t end, blk64_t *out); |
1584 | | extern unsigned int ext2fs_list_backups(ext2_filsys fs, unsigned int *three, |
1585 | | unsigned int *five, unsigned int *seven); |
1586 | | |
1587 | | /* getenv.c */ |
1588 | | extern char *ext2fs_safe_getenv(const char *arg); |
1589 | | |
1590 | | /* get_num_dirs.c */ |
1591 | | extern errcode_t ext2fs_get_num_dirs(ext2_filsys fs, ext2_ino_t *ret_num_dirs); |
1592 | | |
1593 | | /* getsize.c */ |
1594 | | extern errcode_t ext2fs_get_device_size(const char *file, int blocksize, |
1595 | | blk_t *retblocks); |
1596 | | extern errcode_t ext2fs_get_device_size2(const char *file, int blocksize, |
1597 | | blk64_t *retblocks); |
1598 | | |
1599 | | /* getsectsize.c */ |
1600 | | extern int ext2fs_get_dio_alignment(int fd); |
1601 | | errcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize); |
1602 | | errcode_t ext2fs_get_device_phys_sectsize(const char *file, int *sectsize); |
1603 | | |
1604 | | /* i_block.c */ |
1605 | | errcode_t ext2fs_iblk_add_blocks(ext2_filsys fs, struct ext2_inode *inode, |
1606 | | blk64_t num_blocks); |
1607 | | errcode_t ext2fs_iblk_sub_blocks(ext2_filsys fs, struct ext2_inode *inode, |
1608 | | blk64_t num_blocks); |
1609 | | errcode_t ext2fs_iblk_set(ext2_filsys fs, struct ext2_inode *inode, blk64_t b); |
1610 | | |
1611 | | /* imager.c */ |
1612 | | extern errcode_t ext2fs_image_inode_write(ext2_filsys fs, int fd, int flags); |
1613 | | extern errcode_t ext2fs_image_inode_read(ext2_filsys fs, int fd, int flags); |
1614 | | extern errcode_t ext2fs_image_super_write(ext2_filsys fs, int fd, int flags); |
1615 | | extern errcode_t ext2fs_image_super_read(ext2_filsys fs, int fd, int flags); |
1616 | | extern errcode_t ext2fs_image_bitmap_write(ext2_filsys fs, int fd, int flags); |
1617 | | extern errcode_t ext2fs_image_bitmap_read(ext2_filsys fs, int fd, int flags); |
1618 | | |
1619 | | /* ind_block.c */ |
1620 | | errcode_t ext2fs_read_ind_block(ext2_filsys fs, blk_t blk, void *buf); |
1621 | | errcode_t ext2fs_write_ind_block(ext2_filsys fs, blk_t blk, void *buf); |
1622 | | |
1623 | | /* initialize.c */ |
1624 | | extern errcode_t ext2fs_initialize(const char *name, int flags, |
1625 | | struct ext2_super_block *param, |
1626 | | io_manager manager, ext2_filsys *ret_fs); |
1627 | | extern errcode_t ext2fs_calculate_summary_stats(ext2_filsys fs, int super_only); |
1628 | | |
1629 | | /* icount.c */ |
1630 | | extern void ext2fs_free_icount(ext2_icount_t icount); |
1631 | | extern errcode_t ext2fs_create_icount_tdb(ext2_filsys fs, char *tdb_dir, |
1632 | | int flags, ext2_icount_t *ret); |
1633 | | extern errcode_t ext2fs_create_icount2(ext2_filsys fs, int flags, |
1634 | | unsigned int size, |
1635 | | ext2_icount_t hint, ext2_icount_t *ret); |
1636 | | extern errcode_t ext2fs_create_icount(ext2_filsys fs, int flags, |
1637 | | unsigned int size, |
1638 | | ext2_icount_t *ret); |
1639 | | extern errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino, |
1640 | | __u16 *ret); |
1641 | | extern errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino, |
1642 | | __u16 *ret); |
1643 | | extern errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ext2_ino_t ino, |
1644 | | __u16 *ret); |
1645 | | extern errcode_t ext2fs_icount_store(ext2_icount_t icount, ext2_ino_t ino, |
1646 | | __u16 count); |
1647 | | extern ext2_ino_t ext2fs_get_icount_size(ext2_icount_t icount); |
1648 | | errcode_t ext2fs_icount_validate(ext2_icount_t icount, FILE *); |
1649 | | |
1650 | | /* inline.c */ |
1651 | | |
1652 | | extern errcode_t ext2fs_get_memalign(unsigned long size, |
1653 | | unsigned long align, void *ptr); |
1654 | | |
1655 | | /* inline_data.c */ |
1656 | | extern errcode_t ext2fs_inline_data_init(ext2_filsys fs, ext2_ino_t ino); |
1657 | | extern errcode_t ext2fs_inline_data_size(ext2_filsys fs, ext2_ino_t ino, |
1658 | | size_t *size); |
1659 | | extern errcode_t ext2fs_inline_data_get(ext2_filsys fs, ext2_ino_t ino, |
1660 | | struct ext2_inode *inode, |
1661 | | void *buf, size_t *size); |
1662 | | extern errcode_t ext2fs_inline_data_set(ext2_filsys fs, ext2_ino_t ino, |
1663 | | struct ext2_inode *inode, |
1664 | | void *buf, size_t size); |
1665 | | |
1666 | | /* inode.c */ |
1667 | | extern errcode_t ext2fs_create_inode_cache(ext2_filsys fs, |
1668 | | unsigned int cache_size); |
1669 | | extern void ext2fs_free_inode_cache(struct ext2_inode_cache *icache); |
1670 | | extern errcode_t ext2fs_flush_icache(ext2_filsys fs); |
1671 | | extern errcode_t ext2fs_get_next_inode_full(ext2_inode_scan scan, |
1672 | | ext2_ino_t *ino, |
1673 | | struct ext2_inode *inode, |
1674 | | int bufsize); |
1675 | 0 | #define EXT2_INODE_SCAN_DEFAULT_BUFFER_BLOCKS 8 |
1676 | | extern errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks, |
1677 | | ext2_inode_scan *ret_scan); |
1678 | | extern void ext2fs_close_inode_scan(ext2_inode_scan scan); |
1679 | | extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ext2_ino_t *ino, |
1680 | | struct ext2_inode *inode); |
1681 | | extern errcode_t ext2fs_inode_scan_goto_blockgroup(ext2_inode_scan scan, |
1682 | | int group); |
1683 | | extern void ext2fs_set_inode_callback |
1684 | | (ext2_inode_scan scan, |
1685 | | errcode_t (*done_group)(ext2_filsys fs, |
1686 | | ext2_inode_scan scan, |
1687 | | dgrp_t group, |
1688 | | void * priv_data), |
1689 | | void *done_group_data); |
1690 | | extern int ext2fs_inode_scan_flags(ext2_inode_scan scan, int set_flags, |
1691 | | int clear_flags); |
1692 | | extern errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino, |
1693 | | struct ext2_inode * inode, |
1694 | | int bufsize); |
1695 | | extern errcode_t ext2fs_read_inode(ext2_filsys fs, ext2_ino_t ino, |
1696 | | struct ext2_inode * inode); |
1697 | | extern errcode_t ext2fs_read_inode2(ext2_filsys fs, ext2_ino_t ino, |
1698 | | struct ext2_inode * inode, |
1699 | | int bufsize, int flags); |
1700 | | extern errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino, |
1701 | | struct ext2_inode * inode, |
1702 | | int bufsize); |
1703 | | extern errcode_t ext2fs_write_inode(ext2_filsys fs, ext2_ino_t ino, |
1704 | | struct ext2_inode * inode); |
1705 | | extern errcode_t ext2fs_write_inode2(ext2_filsys fs, ext2_ino_t ino, |
1706 | | struct ext2_inode * inode, |
1707 | | int bufsize, int flags); |
1708 | | extern errcode_t ext2fs_write_new_inode(ext2_filsys fs, ext2_ino_t ino, |
1709 | | struct ext2_inode * inode); |
1710 | | extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ext2_ino_t ino, blk_t *blocks); |
1711 | | extern errcode_t ext2fs_check_directory(ext2_filsys fs, ext2_ino_t ino); |
1712 | | |
1713 | | /* inode_io.c */ |
1714 | | extern io_manager inode_io_manager; |
1715 | | extern errcode_t ext2fs_inode_io_intern(ext2_filsys fs, ext2_ino_t ino, |
1716 | | char **name); |
1717 | | extern errcode_t ext2fs_inode_io_intern2(ext2_filsys fs, ext2_ino_t ino, |
1718 | | struct ext2_inode *inode, |
1719 | | char **name); |
1720 | | |
1721 | | /* ismounted.c */ |
1722 | | extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags); |
1723 | | extern errcode_t ext2fs_check_mount_point(const char *device, int *mount_flags, |
1724 | | char *mtpt, int mtlen); |
1725 | | |
1726 | | /* punch.c */ |
1727 | | /* |
1728 | | * NOTE: This function removes from an inode the blocks "start", "end", and |
1729 | | * every block in between. |
1730 | | */ |
1731 | | extern errcode_t ext2fs_punch(ext2_filsys fs, ext2_ino_t ino, |
1732 | | struct ext2_inode *inode, |
1733 | | char *block_buf, blk64_t start, |
1734 | | blk64_t end); |
1735 | | |
1736 | | /* namei.c */ |
1737 | | extern errcode_t ext2fs_lookup(ext2_filsys fs, ext2_ino_t dir, const char *name, |
1738 | | int namelen, char *buf, ext2_ino_t *inode); |
1739 | | extern errcode_t ext2fs_namei(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, |
1740 | | const char *name, ext2_ino_t *inode); |
1741 | | errcode_t ext2fs_namei_follow(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, |
1742 | | const char *name, ext2_ino_t *inode); |
1743 | | extern errcode_t ext2fs_follow_link(ext2_filsys fs, ext2_ino_t root, ext2_ino_t cwd, |
1744 | | ext2_ino_t inode, ext2_ino_t *res_inode); |
1745 | | |
1746 | | /* native.c */ |
1747 | | int ext2fs_native_flag(void); |
1748 | | |
1749 | | /* newdir.c */ |
1750 | | extern errcode_t ext2fs_new_dir_block(ext2_filsys fs, ext2_ino_t dir_ino, |
1751 | | ext2_ino_t parent_ino, char **block); |
1752 | | extern errcode_t ext2fs_new_dir_inline_data(ext2_filsys fs, ext2_ino_t dir_ino, |
1753 | | ext2_ino_t parent_ino, __u32 *iblock); |
1754 | | |
1755 | | /* nls_utf8.c */ |
1756 | | extern const struct ext2fs_nls_table *ext2fs_load_nls_table(int encoding); |
1757 | | extern int ext2fs_check_encoded_name(const struct ext2fs_nls_table *table, |
1758 | | char *s, size_t len, char **pos); |
1759 | | extern int ext2fs_casefold_cmp(const struct ext2fs_nls_table *table, |
1760 | | const unsigned char *str1, size_t len1, |
1761 | | const unsigned char *str2, size_t len2); |
1762 | | |
1763 | | /* mkdir.c */ |
1764 | | extern errcode_t ext2fs_mkdir(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t inum, |
1765 | | const char *name); |
1766 | | extern errcode_t ext2fs_mkdir2(ext2_filsys fs, ext2_ino_t parent, |
1767 | | ext2_ino_t ino, unsigned long flags, |
1768 | | int link_flags, const char *name, |
1769 | | ext2_ino_t *ret_ino); |
1770 | | |
1771 | | /* mkjournal.c */ |
1772 | | struct ext2fs_journal_params { |
1773 | | blk_t num_journal_blocks; |
1774 | | blk_t num_fc_blocks; |
1775 | | }; |
1776 | | extern errcode_t ext2fs_get_journal_params( |
1777 | | struct ext2fs_journal_params *params, ext2_filsys fs); |
1778 | | extern errcode_t ext2fs_zero_blocks(ext2_filsys fs, blk_t blk, int num, |
1779 | | blk_t *ret_blk, int *ret_count); |
1780 | | extern errcode_t ext2fs_zero_blocks2(ext2_filsys fs, blk64_t blk, int num, |
1781 | | blk64_t *ret_blk, int *ret_count); |
1782 | | extern errcode_t ext2fs_create_journal_superblock(ext2_filsys fs, |
1783 | | __u32 num_blocks, int flags, |
1784 | | char **ret_jsb); |
1785 | | extern errcode_t ext2fs_create_journal_superblock2(ext2_filsys fs, |
1786 | | struct ext2fs_journal_params *params, |
1787 | | int flags, char **ret_jsb); |
1788 | | extern errcode_t ext2fs_add_journal_device(ext2_filsys fs, |
1789 | | ext2_filsys journal_dev); |
1790 | | extern errcode_t ext2fs_add_journal_inode(ext2_filsys fs, blk_t num_blocks, |
1791 | | int flags); |
1792 | | extern errcode_t ext2fs_add_journal_inode2(ext2_filsys fs, blk_t num_blocks, |
1793 | | blk64_t goal, int flags); |
1794 | | extern errcode_t ext2fs_add_journal_inode3(ext2_filsys fs, |
1795 | | struct ext2fs_journal_params *params, |
1796 | | blk64_t goal, int flags); |
1797 | | extern int ext2fs_default_journal_size(__u64 num_blocks); |
1798 | | extern int ext2fs_journal_sb_start(int blocksize); |
1799 | | |
1800 | | /* openfs.c */ |
1801 | | extern errcode_t ext2fs_open(const char *name, int flags, int superblock, |
1802 | | unsigned int block_size, io_manager manager, |
1803 | | ext2_filsys *ret_fs); |
1804 | | extern errcode_t ext2fs_open2(const char *name, const char *io_options, |
1805 | | int flags, int superblock, |
1806 | | unsigned int block_size, io_manager manager, |
1807 | | ext2_filsys *ret_fs); |
1808 | | /* |
1809 | | * The dgrp_t argument to these two functions is not actually a group number |
1810 | | * but a block number offset within a group table! Convert with the formula |
1811 | | * (group_number / groups_per_block). |
1812 | | */ |
1813 | | extern blk64_t ext2fs_descriptor_block_loc2(ext2_filsys fs, |
1814 | | blk64_t group_block, dgrp_t i); |
1815 | | extern blk_t ext2fs_descriptor_block_loc(ext2_filsys fs, blk_t group_block, |
1816 | | dgrp_t i); |
1817 | | errcode_t ext2fs_get_data_io(ext2_filsys fs, io_channel *old_io); |
1818 | | errcode_t ext2fs_set_data_io(ext2_filsys fs, io_channel new_io); |
1819 | | errcode_t ext2fs_rewrite_to_io(ext2_filsys fs, io_channel new_io); |
1820 | | |
1821 | | /* orphan.c */ |
1822 | | #define EXT4_MAX_ORPHAN_FILE_SIZE 8 << 20 |
1823 | | #define EXT4_DEFAULT_ORPHAN_FILE_SIZE 2 << 20 |
1824 | | extern errcode_t ext2fs_create_orphan_file(ext2_filsys fs, blk_t num_blocks); |
1825 | | extern errcode_t ext2fs_truncate_orphan_file(ext2_filsys fs); |
1826 | | extern e2_blkcnt_t ext2fs_default_orphan_file_blocks(ext2_filsys fs); |
1827 | | extern __u32 ext2fs_do_orphan_file_block_csum(ext2_filsys fs, ext2_ino_t ino, |
1828 | | __u32 gen, blk64_t blk, |
1829 | | char *buf); |
1830 | | extern errcode_t ext2fs_orphan_file_block_csum_set(ext2_filsys fs, |
1831 | | ext2_ino_t ino, blk64_t blk, |
1832 | | char *buf); |
1833 | | extern int ext2fs_orphan_file_block_csum_verify(ext2_filsys fs, ext2_ino_t ino, |
1834 | | blk64_t blk, char *buf); |
1835 | | |
1836 | | /* get_pathname.c */ |
1837 | | extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ext2_ino_t dir, ext2_ino_t ino, |
1838 | | char **name); |
1839 | | |
1840 | | /* link.c */ |
1841 | | errcode_t ext2fs_link(ext2_filsys fs, ext2_ino_t dir, const char *name, |
1842 | | ext2_ino_t ino, int flags); |
1843 | | errcode_t ext2fs_unlink(ext2_filsys fs, ext2_ino_t dir, const char *name, |
1844 | | ext2_ino_t ino, int flags); |
1845 | | |
1846 | | /* symlink.c */ |
1847 | | errcode_t ext2fs_symlink(ext2_filsys fs, ext2_ino_t parent, ext2_ino_t ino, |
1848 | | const char *name, const char *target); |
1849 | | int ext2fs_is_fast_symlink(struct ext2_inode *inode); |
1850 | | |
1851 | | /* mmp.c */ |
1852 | | errcode_t ext2fs_mmp_read(ext2_filsys fs, blk64_t mmp_blk, void *buf); |
1853 | | errcode_t ext2fs_mmp_write(ext2_filsys fs, blk64_t mmp_blk, void *buf); |
1854 | | errcode_t ext2fs_mmp_clear(ext2_filsys fs); |
1855 | | errcode_t ext2fs_mmp_init(ext2_filsys fs); |
1856 | | errcode_t ext2fs_mmp_start(ext2_filsys fs); |
1857 | | errcode_t ext2fs_mmp_update(ext2_filsys fs); |
1858 | | errcode_t ext2fs_mmp_update2(ext2_filsys fs, int immediately); |
1859 | | errcode_t ext2fs_mmp_stop(ext2_filsys fs); |
1860 | | unsigned ext2fs_mmp_new_seq(void); |
1861 | | |
1862 | | /* read_bb.c */ |
1863 | | extern errcode_t ext2fs_read_bb_inode(ext2_filsys fs, |
1864 | | ext2_badblocks_list *bb_list); |
1865 | | |
1866 | | /* read_bb_file.c */ |
1867 | | extern errcode_t ext2fs_read_bb_FILE2(ext2_filsys fs, FILE *f, |
1868 | | ext2_badblocks_list *bb_list, |
1869 | | void *priv_data, |
1870 | | void (*invalid)(ext2_filsys fs, |
1871 | | blk_t blk, |
1872 | | char *badstr, |
1873 | | void *priv_data)); |
1874 | | extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, |
1875 | | ext2_badblocks_list *bb_list, |
1876 | | void (*invalid)(ext2_filsys fs, |
1877 | | blk_t blk)); |
1878 | | |
1879 | | /* res_gdt.c */ |
1880 | | extern errcode_t ext2fs_create_resize_inode(ext2_filsys fs); |
1881 | | |
1882 | | /* rw_bitmaps.c */ |
1883 | | extern errcode_t ext2fs_rw_bitmaps(ext2_filsys fs, int flags, int num_threads); |
1884 | | extern errcode_t ext2fs_read_bitmaps(ext2_filsys fs); |
1885 | | extern errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs); |
1886 | | extern errcode_t ext2fs_read_block_bitmap(ext2_filsys fs); |
1887 | | extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs); |
1888 | | extern errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs); |
1889 | | extern errcode_t ext2fs_write_block_bitmap (ext2_filsys fs); |
1890 | | |
1891 | | /*sha256.c */ |
1892 | | #define EXT2FS_SHA256_LENGTH 32 |
1893 | | #if 0 |
1894 | | extern void ext2fs_sha256(const unsigned char *in, unsigned long in_size, |
1895 | | unsigned char out[EXT2FS_SHA256_LENGTH]); |
1896 | | #endif |
1897 | | |
1898 | | /* sha512.c */ |
1899 | | #define EXT2FS_SHA512_LENGTH 64 |
1900 | | extern void ext2fs_sha512(const unsigned char *in, unsigned long in_size, |
1901 | | unsigned char out[EXT2FS_SHA512_LENGTH]); |
1902 | | |
1903 | | /* swapfs.c */ |
1904 | | extern errcode_t ext2fs_dirent_swab_in2(ext2_filsys fs, char *buf, size_t size, |
1905 | | int flags); |
1906 | | extern errcode_t ext2fs_dirent_swab_in(ext2_filsys fs, char *buf, int flags); |
1907 | | extern errcode_t ext2fs_dirent_swab_out2(ext2_filsys fs, char *buf, size_t size, |
1908 | | int flags); |
1909 | | extern errcode_t ext2fs_dirent_swab_out(ext2_filsys fs, char *buf, int flags); |
1910 | | extern void ext2fs_swap_ext_attr(char *to, char *from, int bufsize, |
1911 | | int has_header); |
1912 | | extern void ext2fs_swap_ext_attr_header(struct ext2_ext_attr_header *to_header, |
1913 | | struct ext2_ext_attr_header *from_hdr); |
1914 | | extern void ext2fs_swap_ext_attr_entry(struct ext2_ext_attr_entry *to_entry, |
1915 | | struct ext2_ext_attr_entry *from_entry); |
1916 | | extern void ext2fs_swap_super(struct ext2_super_block * super); |
1917 | | extern void ext2fs_swap_group_desc(struct ext2_group_desc *gdp); |
1918 | | extern void ext2fs_swap_group_desc2(ext2_filsys, struct ext2_group_desc *gdp); |
1919 | | extern void ext2fs_swap_inode_full(ext2_filsys fs, struct ext2_inode_large *t, |
1920 | | struct ext2_inode_large *f, int hostorder, |
1921 | | int bufsize); |
1922 | | extern void ext2fs_swap_inode(ext2_filsys fs,struct ext2_inode *t, |
1923 | | struct ext2_inode *f, int hostorder); |
1924 | | extern void ext2fs_swap_mmp(struct mmp_struct *mmp); |
1925 | | |
1926 | | /* unix_io.c */ |
1927 | | extern int ext2fs_open_file(const char *pathname, int flags, mode_t mode); |
1928 | | extern int ext2fs_stat(const char *path, ext2fs_struct_stat *buf); |
1929 | | extern int ext2fs_fstat(int fd, ext2fs_struct_stat *buf); |
1930 | | |
1931 | | /* valid_blk.c */ |
1932 | | extern int ext2fs_inode_has_valid_blocks(struct ext2_inode *inode); |
1933 | | extern int ext2fs_inode_has_valid_blocks2(ext2_filsys fs, |
1934 | | struct ext2_inode *inode); |
1935 | | |
1936 | | /* version.c */ |
1937 | | extern int ext2fs_parse_version_string(const char *ver_string); |
1938 | | extern int ext2fs_get_library_version(const char **ver_string, |
1939 | | const char **date_string); |
1940 | | |
1941 | | /* write_bb_file.c */ |
1942 | | extern errcode_t ext2fs_write_bb_FILE(ext2_badblocks_list bb_list, |
1943 | | unsigned int flags, |
1944 | | FILE *f); |
1945 | | |
1946 | | |
1947 | | /* inline functions */ |
1948 | | #ifdef NO_INLINE_FUNCS |
1949 | | extern errcode_t ext2fs_get_mem(unsigned long size, void *ptr); |
1950 | | extern errcode_t ext2fs_get_memzero(unsigned long size, void *ptr); |
1951 | | extern errcode_t ext2fs_get_array(unsigned long count, |
1952 | | unsigned long size, void *ptr); |
1953 | | extern errcode_t ext2fs_get_arrayzero(unsigned long count, |
1954 | | unsigned long size, void *ptr); |
1955 | | extern errcode_t ext2fs_free_mem(void *ptr); |
1956 | | extern errcode_t ext2fs_resize_mem(unsigned long old_size, |
1957 | | unsigned long size, void *ptr); |
1958 | | extern errcode_t ext2fs_resize_array(unsigned long old_count, unsigned long count, |
1959 | | unsigned long size, void *ptr); |
1960 | | extern void ext2fs_mark_super_dirty(ext2_filsys fs); |
1961 | | extern void ext2fs_mark_changed(ext2_filsys fs); |
1962 | | extern int ext2fs_test_changed(ext2_filsys fs); |
1963 | | extern void ext2fs_mark_valid(ext2_filsys fs); |
1964 | | extern void ext2fs_unmark_valid(ext2_filsys fs); |
1965 | | extern int ext2fs_test_valid(ext2_filsys fs); |
1966 | | extern void ext2fs_mark_ib_dirty(ext2_filsys fs); |
1967 | | extern void ext2fs_mark_bb_dirty(ext2_filsys fs); |
1968 | | extern int ext2fs_test_ib_dirty(ext2_filsys fs); |
1969 | | extern int ext2fs_test_bb_dirty(ext2_filsys fs); |
1970 | | extern dgrp_t ext2fs_group_of_blk(ext2_filsys fs, blk_t blk); |
1971 | | extern dgrp_t ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino); |
1972 | | extern blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group); |
1973 | | extern blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group); |
1974 | | extern blk_t ext2fs_inode_data_blocks(ext2_filsys fs, |
1975 | | struct ext2_inode *inode); |
1976 | | extern int ext2fs_htree_intnode_maxrecs(ext2_filsys fs, int blocks); |
1977 | | extern int ext2fs_log2_u32(__u32 arg); |
1978 | | extern int ext2fs_log2_u64(__u64 arg); |
1979 | | extern int ext2fs_log10_u32(__u32 arg); |
1980 | | extern int ext2fs_log10_u64(__u64 arg); |
1981 | | extern unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b); |
1982 | | extern __u64 ext2fs_div64_ceil(__u64 a, __u64 b); |
1983 | | extern int ext2fs_dirent_name_len(const struct ext2_dir_entry *entry); |
1984 | | extern void ext2fs_dirent_set_name_len(struct ext2_dir_entry *entry, int len); |
1985 | | extern int ext2fs_dirent_file_type(const struct ext2_dir_entry *entry); |
1986 | | extern void ext2fs_dirent_set_file_type(struct ext2_dir_entry *entry, int type); |
1987 | | extern struct ext2_inode *ext2fs_inode(struct ext2_inode_large * large_inode); |
1988 | | extern const struct ext2_inode *ext2fs_const_inode(const struct ext2_inode_large * large_inode); |
1989 | | extern int ext2fs_inodes_per_orphan_block(ext2_filsys fs); |
1990 | | extern struct ext4_orphan_block_tail *ext2fs_orphan_block_tail(ext2_filsys fs, |
1991 | | char *buf); |
1992 | | #endif |
1993 | | |
1994 | | /* |
1995 | | * The actual inlined functions definitions themselves... |
1996 | | * |
1997 | | * If NO_INLINE_FUNCS is defined, then we won't try to do inline |
1998 | | * functions at all! |
1999 | | */ |
2000 | | #if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) |
2001 | | #ifdef INCLUDE_INLINE_FUNCS |
2002 | | #define _INLINE_ extern |
2003 | | #else |
2004 | | #if (__STDC_VERSION__ >= 199901L) |
2005 | | #define _INLINE_ inline |
2006 | | #else |
2007 | | #ifdef __GNUC__ |
2008 | | #define _INLINE_ extern __inline__ |
2009 | | #else /* For Watcom C */ |
2010 | | #define _INLINE_ extern inline |
2011 | | #endif /* __GNUC__ */ |
2012 | | #endif /* __STDC_VERSION__ >= 199901L */ |
2013 | | #endif |
2014 | | |
2015 | | #ifndef EXT2_CUSTOM_MEMORY_ROUTINES |
2016 | | #include <string.h> |
2017 | | /* |
2018 | | * Allocate memory. The 'ptr' arg must point to a pointer. |
2019 | | */ |
2020 | | _INLINE_ errcode_t ext2fs_get_mem(unsigned long size, void *ptr) |
2021 | 11.7k | { |
2022 | 11.7k | void *pp; |
2023 | | |
2024 | 11.7k | pp = malloc(size); |
2025 | 11.7k | if (!pp) |
2026 | 0 | return EXT2_ET_NO_MEMORY; |
2027 | 11.7k | memcpy(ptr, &pp, sizeof (pp)); |
2028 | 11.7k | return 0; |
2029 | 11.7k | } |
2030 | | |
2031 | | _INLINE_ errcode_t ext2fs_get_memzero(unsigned long size, void *ptr) |
2032 | 0 | { |
2033 | 0 | void *pp; |
2034 | |
|
2035 | 0 | pp = malloc(size); |
2036 | 0 | if (!pp) |
2037 | 0 | return EXT2_ET_NO_MEMORY; |
2038 | 0 | memset(pp, 0, size); |
2039 | 0 | memcpy(ptr, &pp, sizeof(pp)); |
2040 | 0 | return 0; |
2041 | 0 | } |
2042 | | |
2043 | | _INLINE_ errcode_t ext2fs_get_array(unsigned long count, unsigned long size, |
2044 | | void *ptr) |
2045 | 555 | { |
2046 | 555 | if (count && (~0UL)/count < size) |
2047 | 0 | return EXT2_ET_NO_MEMORY; |
2048 | 555 | return ext2fs_get_mem(count*size, ptr); |
2049 | 555 | } |
2050 | | |
2051 | | _INLINE_ errcode_t ext2fs_get_arrayzero(unsigned long count, |
2052 | | unsigned long size, void *ptr) |
2053 | 0 | { |
2054 | 0 | if (count && (~0UL)/count < size) |
2055 | 0 | return EXT2_ET_NO_MEMORY; |
2056 | | |
2057 | 0 | return ext2fs_get_memzero((size_t)count * size, ptr); |
2058 | 0 | } |
2059 | | |
2060 | | /* |
2061 | | * Free memory. The 'ptr' arg must point to a pointer. |
2062 | | */ |
2063 | | _INLINE_ errcode_t ext2fs_free_mem(void *ptr) |
2064 | 11.7k | { |
2065 | 11.7k | void *p; |
2066 | | |
2067 | 11.7k | memcpy(&p, ptr, sizeof(p)); |
2068 | 11.7k | free(p); |
2069 | 11.7k | p = 0; |
2070 | 11.7k | memcpy(ptr, &p, sizeof(p)); |
2071 | 11.7k | return 0; |
2072 | 11.7k | } |
2073 | | |
2074 | | /* |
2075 | | * Resize memory. The 'ptr' arg must point to a pointer. |
2076 | | */ |
2077 | | _INLINE_ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size, |
2078 | | unsigned long size, void *ptr) |
2079 | 0 | { |
2080 | 0 | void *p; |
2081 | | |
2082 | | /* Use "memcpy" for pointer assignments here to avoid problems |
2083 | | * with C99 strict type aliasing rules. */ |
2084 | 0 | memcpy(&p, ptr, sizeof(p)); |
2085 | 0 | p = realloc(p, size); |
2086 | 0 | if (!p) |
2087 | 0 | return EXT2_ET_NO_MEMORY; |
2088 | 0 | memcpy(ptr, &p, sizeof(p)); |
2089 | 0 | return 0; |
2090 | 0 | } |
2091 | | |
2092 | | /* |
2093 | | * Resize array. The 'ptr' arg must point to a pointer. |
2094 | | */ |
2095 | | _INLINE_ errcode_t ext2fs_resize_array(unsigned long size, |
2096 | | unsigned long old_count, |
2097 | | unsigned long count, void *ptr) |
2098 | 0 | { |
2099 | 0 | unsigned long old_size; |
2100 | 0 | errcode_t retval; |
2101 | |
|
2102 | 0 | if (count && (~0UL)/count < size) |
2103 | 0 | return EXT2_ET_NO_MEMORY; |
2104 | | |
2105 | 0 | size *= count; |
2106 | 0 | old_size = size * old_count; |
2107 | 0 | retval = ext2fs_resize_mem(old_size, size, ptr); |
2108 | 0 | if (retval) |
2109 | 0 | return retval; |
2110 | | |
2111 | 0 | if (size > old_size) { |
2112 | 0 | void *p; |
2113 | |
|
2114 | 0 | memcpy(&p, ptr, sizeof(p)); |
2115 | 0 | memset((char *)p + old_size, 0, size - old_size); |
2116 | 0 | memcpy(ptr, &p, sizeof(p)); |
2117 | 0 | } |
2118 | |
|
2119 | 0 | return 0; |
2120 | 0 | } |
2121 | | #endif /* Custom memory routines */ |
2122 | | |
2123 | | /* |
2124 | | * Mark a filesystem superblock as dirty |
2125 | | */ |
2126 | | _INLINE_ void ext2fs_mark_super_dirty(ext2_filsys fs) |
2127 | 0 | { |
2128 | 0 | fs->flags |= EXT2_FLAG_DIRTY | EXT2_FLAG_CHANGED; |
2129 | 0 | } |
2130 | | |
2131 | | /* |
2132 | | * Mark a filesystem as changed |
2133 | | */ |
2134 | | _INLINE_ void ext2fs_mark_changed(ext2_filsys fs) |
2135 | 0 | { |
2136 | 0 | fs->flags |= EXT2_FLAG_CHANGED; |
2137 | 0 | } |
2138 | | |
2139 | | /* |
2140 | | * Check to see if a filesystem has changed |
2141 | | */ |
2142 | | _INLINE_ int ext2fs_test_changed(ext2_filsys fs) |
2143 | 0 | { |
2144 | 0 | return (fs->flags & EXT2_FLAG_CHANGED); |
2145 | 0 | } |
2146 | | |
2147 | | /* |
2148 | | * Mark a filesystem as valid |
2149 | | */ |
2150 | | _INLINE_ void ext2fs_mark_valid(ext2_filsys fs) |
2151 | 0 | { |
2152 | 0 | fs->flags |= EXT2_FLAG_VALID; |
2153 | 0 | } |
2154 | | |
2155 | | /* |
2156 | | * Mark a filesystem as NOT valid |
2157 | | */ |
2158 | | _INLINE_ void ext2fs_unmark_valid(ext2_filsys fs) |
2159 | 0 | { |
2160 | 0 | fs->flags &= ~EXT2_FLAG_VALID; |
2161 | 0 | } |
2162 | | |
2163 | | /* |
2164 | | * Check to see if a filesystem is valid |
2165 | | */ |
2166 | | _INLINE_ int ext2fs_test_valid(ext2_filsys fs) |
2167 | 0 | { |
2168 | 0 | return (fs->flags & EXT2_FLAG_VALID); |
2169 | 0 | } |
2170 | | |
2171 | | /* |
2172 | | * Mark the inode bitmap as dirty |
2173 | | */ |
2174 | | _INLINE_ void ext2fs_mark_ib_dirty(ext2_filsys fs) |
2175 | 0 | { |
2176 | 0 | fs->flags |= EXT2_FLAG_IB_DIRTY | EXT2_FLAG_CHANGED; |
2177 | 0 | } |
2178 | | |
2179 | | /* |
2180 | | * Mark the block bitmap as dirty |
2181 | | */ |
2182 | | _INLINE_ void ext2fs_mark_bb_dirty(ext2_filsys fs) |
2183 | 0 | { |
2184 | 0 | fs->flags |= EXT2_FLAG_BB_DIRTY | EXT2_FLAG_CHANGED; |
2185 | 0 | } |
2186 | | |
2187 | | /* |
2188 | | * Check to see if a filesystem's inode bitmap is dirty |
2189 | | */ |
2190 | | _INLINE_ int ext2fs_test_ib_dirty(ext2_filsys fs) |
2191 | 17 | { |
2192 | 17 | return (fs->flags & EXT2_FLAG_IB_DIRTY); |
2193 | 17 | } |
2194 | | |
2195 | | /* |
2196 | | * Check to see if a filesystem's block bitmap is dirty |
2197 | | */ |
2198 | | _INLINE_ int ext2fs_test_bb_dirty(ext2_filsys fs) |
2199 | 285 | { |
2200 | 285 | return (fs->flags & EXT2_FLAG_BB_DIRTY); |
2201 | 285 | } |
2202 | | |
2203 | | /* |
2204 | | * Return the group # of a block |
2205 | | */ |
2206 | | _INLINE_ dgrp_t ext2fs_group_of_blk(ext2_filsys fs, blk_t blk) |
2207 | 0 | { |
2208 | 0 | return ext2fs_group_of_blk2(fs, blk); |
2209 | 0 | } |
2210 | | /* |
2211 | | * Return the group # of an inode number |
2212 | | */ |
2213 | | _INLINE_ dgrp_t ext2fs_group_of_ino(ext2_filsys fs, ext2_ino_t ino) |
2214 | 0 | { |
2215 | 0 | return (ino - 1) / fs->super->s_inodes_per_group; |
2216 | 0 | } |
2217 | | |
2218 | | /* |
2219 | | * Return the first block (inclusive) in a group |
2220 | | */ |
2221 | | _INLINE_ blk_t ext2fs_group_first_block(ext2_filsys fs, dgrp_t group) |
2222 | 0 | { |
2223 | 0 | return (blk_t) ext2fs_group_first_block2(fs, group); |
2224 | 0 | } |
2225 | | |
2226 | | /* |
2227 | | * Return the last block (inclusive) in a group |
2228 | | */ |
2229 | | _INLINE_ blk_t ext2fs_group_last_block(ext2_filsys fs, dgrp_t group) |
2230 | 0 | { |
2231 | 0 | return (blk_t) ext2fs_group_last_block2(fs, group); |
2232 | 0 | } |
2233 | | |
2234 | | _INLINE_ blk_t ext2fs_inode_data_blocks(ext2_filsys fs, |
2235 | | struct ext2_inode *inode) |
2236 | 0 | { |
2237 | 0 | return (blk_t) ext2fs_inode_data_blocks2(fs, inode); |
2238 | 0 | } |
2239 | | |
2240 | | _INLINE_ int ext2fs_htree_intnode_maxrecs(ext2_filsys fs, int blocks) |
2241 | 0 | { |
2242 | 0 | int csum_size = 0; |
2243 | |
|
2244 | 0 | if ((EXT2_SB(fs->super)->s_feature_ro_compat & |
2245 | 0 | EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) != 0) |
2246 | 0 | csum_size = sizeof(struct ext2_dx_tail); |
2247 | 0 | return blocks * ((fs->blocksize - (8 + csum_size)) / |
2248 | 0 | sizeof(struct ext2_dx_entry)); |
2249 | 0 | } |
2250 | | |
2251 | | /* |
2252 | | * log base 2, rounded down |
2253 | | */ |
2254 | | _INLINE_ int ext2fs_log2_u32(__u32 arg) |
2255 | 0 | { |
2256 | 0 | int l = 0; |
2257 | |
|
2258 | 0 | arg >>= 1; |
2259 | 0 | while (arg) { |
2260 | 0 | l++; |
2261 | 0 | arg >>= 1; |
2262 | 0 | } |
2263 | 0 | return l; |
2264 | 0 | } |
2265 | | |
2266 | | /* |
2267 | | * log base 2, rounded down |
2268 | | */ |
2269 | | _INLINE_ int ext2fs_log2_u64(__u64 arg) |
2270 | 0 | { |
2271 | 0 | int l = 0; |
2272 | |
|
2273 | 0 | arg >>= 1; |
2274 | 0 | while (arg) { |
2275 | 0 | l++; |
2276 | 0 | arg >>= 1; |
2277 | 0 | } |
2278 | 0 | return l; |
2279 | 0 | } |
2280 | | |
2281 | | /* |
2282 | | * log base 10, rounded down |
2283 | | */ |
2284 | | _INLINE_ int ext2fs_log10_u32(__u32 arg) |
2285 | 0 | { |
2286 | 0 | int l = 0; |
2287 | |
|
2288 | 0 | arg /= 10; |
2289 | 0 | while (arg) { |
2290 | 0 | l++; |
2291 | 0 | arg /= 10; |
2292 | 0 | } |
2293 | 0 | return l; |
2294 | 0 | } |
2295 | | |
2296 | | /* |
2297 | | * log base 10, rounded down |
2298 | | */ |
2299 | | _INLINE_ int ext2fs_log10_u64(__u64 arg) |
2300 | 0 | { |
2301 | 0 | int l = 0; |
2302 | |
|
2303 | 0 | arg /= 10; |
2304 | 0 | while (arg) { |
2305 | 0 | l++; |
2306 | 0 | arg /= 10; |
2307 | 0 | } |
2308 | 0 | return l; |
2309 | 0 | } |
2310 | | |
2311 | | /* |
2312 | | * This is an efficient, overflow safe way of calculating ceil((1.0 * a) / b) |
2313 | | */ |
2314 | | _INLINE_ unsigned int ext2fs_div_ceil(unsigned int a, unsigned int b) |
2315 | 557 | { |
2316 | 557 | if (!a) |
2317 | 0 | return 0; |
2318 | 557 | return ((a - 1) / b) + 1; |
2319 | 557 | } |
2320 | | |
2321 | | _INLINE_ __u64 ext2fs_div64_ceil(__u64 a, __u64 b) |
2322 | 561 | { |
2323 | 561 | if (!a) |
2324 | 0 | return 0; |
2325 | 561 | return ((a - 1) / b) + 1; |
2326 | 561 | } |
2327 | | |
2328 | | _INLINE_ int ext2fs_dirent_name_len(const struct ext2_dir_entry *entry) |
2329 | 0 | { |
2330 | 0 | return entry->name_len & 0xff; |
2331 | 0 | } |
2332 | | |
2333 | | _INLINE_ void ext2fs_dirent_set_name_len(struct ext2_dir_entry *entry, int len) |
2334 | 0 | { |
2335 | 0 | entry->name_len = (entry->name_len & 0xff00) | (len & 0xff); |
2336 | 0 | } |
2337 | | |
2338 | | _INLINE_ int ext2fs_dirent_file_type(const struct ext2_dir_entry *entry) |
2339 | 0 | { |
2340 | 0 | return entry->name_len >> 8; |
2341 | 0 | } |
2342 | | |
2343 | | _INLINE_ void ext2fs_dirent_set_file_type(struct ext2_dir_entry *entry, int type) |
2344 | 0 | { |
2345 | 0 | entry->name_len = (entry->name_len & 0xff) | (type << 8); |
2346 | 0 | } |
2347 | | |
2348 | | _INLINE_ struct ext2_inode *ext2fs_inode(struct ext2_inode_large * large_inode) |
2349 | 0 | { |
2350 | | /* It is always safe to convert large inode to a small inode */ |
2351 | 0 | return (struct ext2_inode *) large_inode; |
2352 | 0 | } |
2353 | | |
2354 | | _INLINE_ const struct ext2_inode * |
2355 | | ext2fs_const_inode(const struct ext2_inode_large * large_inode) |
2356 | 0 | { |
2357 | | /* It is always safe to convert large inode to a small inode */ |
2358 | 0 | return (const struct ext2_inode *) large_inode; |
2359 | 0 | } |
2360 | | |
2361 | | _INLINE_ int ext2fs_inodes_per_orphan_block(ext2_filsys fs) |
2362 | 0 | { |
2363 | 0 | return (fs->blocksize - sizeof(struct ext4_orphan_block_tail)) / |
2364 | 0 | sizeof(__u32); |
2365 | 0 | } |
2366 | | |
2367 | | _INLINE_ struct ext4_orphan_block_tail * |
2368 | | ext2fs_orphan_block_tail(ext2_filsys fs, char *buf) |
2369 | 0 | { |
2370 | 0 | return (struct ext4_orphan_block_tail *)(buf + fs->blocksize - |
2371 | 0 | sizeof(struct ext4_orphan_block_tail)); |
2372 | 0 | } |
2373 | | |
2374 | | #undef _INLINE_ |
2375 | | #endif |
2376 | | |
2377 | | /* htree levels for ext4 */ |
2378 | 0 | #define EXT4_HTREE_LEVEL_COMPAT 2 |
2379 | 0 | #define EXT4_HTREE_LEVEL 3 |
2380 | | |
2381 | | static inline unsigned int ext2_dir_htree_level(ext2_filsys fs) |
2382 | 0 | { |
2383 | 0 | if (ext2fs_has_feature_largedir(fs->super)) |
2384 | 0 | return EXT4_HTREE_LEVEL; |
2385 | | |
2386 | 0 | return EXT4_HTREE_LEVEL_COMPAT; |
2387 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:ext2_dir_htree_level(struct_ext2_filsys*) Unexecuted instantiation: imager.c:ext2_dir_htree_level Unexecuted instantiation: blknum.c:ext2_dir_htree_level Unexecuted instantiation: closefs.c:ext2_dir_htree_level Unexecuted instantiation: csum.c:ext2_dir_htree_level Unexecuted instantiation: dir_iterate.c:ext2_dir_htree_level Unexecuted instantiation: freefs.c:ext2_dir_htree_level Unexecuted instantiation: gen_bitmap64.c:ext2_dir_htree_level Unexecuted instantiation: get_num_dirs.c:ext2_dir_htree_level Unexecuted instantiation: getenv.c:ext2_dir_htree_level Unexecuted instantiation: inline_data.c:ext2_dir_htree_level Unexecuted instantiation: inode.c:ext2_dir_htree_level Unexecuted instantiation: io_manager.c:ext2_dir_htree_level Unexecuted instantiation: mkjournal.c:ext2_dir_htree_level Unexecuted instantiation: mmp.c:ext2_dir_htree_level Unexecuted instantiation: openfs.c:ext2_dir_htree_level Unexecuted instantiation: read_bb.c:ext2_dir_htree_level Unexecuted instantiation: rw_bitmaps.c:ext2_dir_htree_level Unexecuted instantiation: unix_io.c:ext2_dir_htree_level Unexecuted instantiation: alloc.c:ext2_dir_htree_level Unexecuted instantiation: alloc_sb.c:ext2_dir_htree_level Unexecuted instantiation: alloc_stats.c:ext2_dir_htree_level Unexecuted instantiation: badblocks.c:ext2_dir_htree_level Unexecuted instantiation: bitmaps.c:ext2_dir_htree_level Unexecuted instantiation: bitops.c:ext2_dir_htree_level Unexecuted instantiation: blkmap64_ba.c:ext2_dir_htree_level Unexecuted instantiation: blkmap64_rb.c:ext2_dir_htree_level Unexecuted instantiation: block.c:ext2_dir_htree_level Unexecuted instantiation: bmap.c:ext2_dir_htree_level Unexecuted instantiation: crc32c.c:ext2_dir_htree_level Unexecuted instantiation: dirblock.c:ext2_dir_htree_level Unexecuted instantiation: ext_attr.c:ext2_dir_htree_level Unexecuted instantiation: extent.c:ext2_dir_htree_level Unexecuted instantiation: fallocate.c:ext2_dir_htree_level Unexecuted instantiation: fileio.c:ext2_dir_htree_level Unexecuted instantiation: gen_bitmap.c:ext2_dir_htree_level Unexecuted instantiation: getsectsize.c:ext2_dir_htree_level Unexecuted instantiation: i_block.c:ext2_dir_htree_level Unexecuted instantiation: ind_block.c:ext2_dir_htree_level Unexecuted instantiation: inline.c:ext2_dir_htree_level Unexecuted instantiation: ismounted.c:ext2_dir_htree_level Unexecuted instantiation: nls_utf8.c:ext2_dir_htree_level Unexecuted instantiation: punch.c:ext2_dir_htree_level Unexecuted instantiation: sha512.c:ext2_dir_htree_level Unexecuted instantiation: symlink.c:ext2_dir_htree_level Unexecuted instantiation: valid_blk.c:ext2_dir_htree_level Unexecuted instantiation: link.c:ext2_dir_htree_level Unexecuted instantiation: lookup.c:ext2_dir_htree_level Unexecuted instantiation: dirhash.c:ext2_dir_htree_level Unexecuted instantiation: expanddir.c:ext2_dir_htree_level Unexecuted instantiation: newdir.c:ext2_dir_htree_level Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:ext2_dir_htree_level(struct_ext2_filsys*) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:ext2_dir_htree_level(struct_ext2_filsys*) |
2388 | | |
2389 | | /* |
2390 | | * We explicitly decided not to reserve space for a 64-bit dtime, |
2391 | | * since it's never displayed or exposed to userspace. The dtime |
2392 | | * field is used a linked list for the ophan list, and for forensic |
2393 | | * purposes when trying to determine when an inode was deleted. So |
2394 | | * right after the 2038 epoch, a deleted inode might end up with a |
2395 | | * dtime which is zero or smaller than the number of inodes, which |
2396 | | * will result in e2fsck reporting a potential problems. So when we |
2397 | | * set the dtime, make sure that the dtime won't be mistaken for an |
2398 | | * inode number. |
2399 | | */ |
2400 | | static inline void ext2fs_set_dtime(ext2_filsys fs, struct ext2_inode *inode) |
2401 | 0 | { |
2402 | 0 | __u32 t; |
2403 | |
|
2404 | 0 | if (fs->now || (fs->flags2 & EXT2_FLAG2_USE_FAKE_TIME)) |
2405 | 0 | t = fs->now & 0xFFFFFFFF; |
2406 | 0 | else |
2407 | 0 | t = time(NULL) & 0xFFFFFFFF; |
2408 | 0 | if (t < fs->super->s_inodes_count) |
2409 | 0 | t = fs->super->s_inodes_count; |
2410 | 0 | inode->i_dtime = t; |
2411 | 0 | } Unexecuted instantiation: ext2fs_image_read_write_fuzzer.cc:ext2fs_set_dtime(struct_ext2_filsys*, ext2_inode*) Unexecuted instantiation: imager.c:ext2fs_set_dtime Unexecuted instantiation: blknum.c:ext2fs_set_dtime Unexecuted instantiation: closefs.c:ext2fs_set_dtime Unexecuted instantiation: csum.c:ext2fs_set_dtime Unexecuted instantiation: dir_iterate.c:ext2fs_set_dtime Unexecuted instantiation: freefs.c:ext2fs_set_dtime Unexecuted instantiation: gen_bitmap64.c:ext2fs_set_dtime Unexecuted instantiation: get_num_dirs.c:ext2fs_set_dtime Unexecuted instantiation: getenv.c:ext2fs_set_dtime Unexecuted instantiation: inline_data.c:ext2fs_set_dtime Unexecuted instantiation: inode.c:ext2fs_set_dtime Unexecuted instantiation: io_manager.c:ext2fs_set_dtime Unexecuted instantiation: mkjournal.c:ext2fs_set_dtime Unexecuted instantiation: mmp.c:ext2fs_set_dtime Unexecuted instantiation: openfs.c:ext2fs_set_dtime Unexecuted instantiation: read_bb.c:ext2fs_set_dtime Unexecuted instantiation: rw_bitmaps.c:ext2fs_set_dtime Unexecuted instantiation: unix_io.c:ext2fs_set_dtime Unexecuted instantiation: alloc.c:ext2fs_set_dtime Unexecuted instantiation: alloc_sb.c:ext2fs_set_dtime Unexecuted instantiation: alloc_stats.c:ext2fs_set_dtime Unexecuted instantiation: badblocks.c:ext2fs_set_dtime Unexecuted instantiation: bitmaps.c:ext2fs_set_dtime Unexecuted instantiation: bitops.c:ext2fs_set_dtime Unexecuted instantiation: blkmap64_ba.c:ext2fs_set_dtime Unexecuted instantiation: blkmap64_rb.c:ext2fs_set_dtime Unexecuted instantiation: block.c:ext2fs_set_dtime Unexecuted instantiation: bmap.c:ext2fs_set_dtime Unexecuted instantiation: crc32c.c:ext2fs_set_dtime Unexecuted instantiation: dirblock.c:ext2fs_set_dtime Unexecuted instantiation: ext_attr.c:ext2fs_set_dtime Unexecuted instantiation: extent.c:ext2fs_set_dtime Unexecuted instantiation: fallocate.c:ext2fs_set_dtime Unexecuted instantiation: fileio.c:ext2fs_set_dtime Unexecuted instantiation: gen_bitmap.c:ext2fs_set_dtime Unexecuted instantiation: getsectsize.c:ext2fs_set_dtime Unexecuted instantiation: i_block.c:ext2fs_set_dtime Unexecuted instantiation: ind_block.c:ext2fs_set_dtime Unexecuted instantiation: inline.c:ext2fs_set_dtime Unexecuted instantiation: ismounted.c:ext2fs_set_dtime Unexecuted instantiation: nls_utf8.c:ext2fs_set_dtime Unexecuted instantiation: punch.c:ext2fs_set_dtime Unexecuted instantiation: sha512.c:ext2fs_set_dtime Unexecuted instantiation: symlink.c:ext2fs_set_dtime Unexecuted instantiation: valid_blk.c:ext2fs_set_dtime Unexecuted instantiation: link.c:ext2fs_set_dtime Unexecuted instantiation: lookup.c:ext2fs_set_dtime Unexecuted instantiation: dirhash.c:ext2fs_set_dtime Unexecuted instantiation: expanddir.c:ext2fs_set_dtime Unexecuted instantiation: newdir.c:ext2fs_set_dtime Unexecuted instantiation: ext2fs_check_directory_fuzzer.cc:ext2fs_set_dtime(struct_ext2_filsys*, ext2_inode*) Unexecuted instantiation: ext2fs_read_bitmap_fuzzer.cc:ext2fs_set_dtime(struct_ext2_filsys*, ext2_inode*) |
2412 | | |
2413 | | #ifdef __cplusplus |
2414 | | } |
2415 | | #endif |
2416 | | |
2417 | | #endif /* _EXT2FS_EXT2FS_H */ |