Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | * ext2fsP.h --- private header file for ext2 library |
| 3 | * |
| 4 | * Copyright (C) 1997 Theodore Ts'o. |
| 5 | * |
| 6 | * %Begin-Header% |
| 7 | * This file may be redistributed under the terms of the GNU Public |
| 8 | * License. |
| 9 | * %End-Header% |
| 10 | */ |
| 11 | |
| 12 | #include "ext2fs.h" |
| 13 | |
| 14 | /* |
| 15 | * Badblocks list |
| 16 | */ |
| 17 | struct ext2_struct_badblocks_list { |
| 18 | int magic; |
| 19 | int num; |
| 20 | int size; |
| 21 | blk_t *list; |
| 22 | int badblocks_flags; |
| 23 | }; |
| 24 | |
| 25 | struct ext2_struct_badblocks_iterate { |
| 26 | int magic; |
| 27 | badblocks_list bb; |
| 28 | int ptr; |
| 29 | }; |
| 30 | |
| 31 | |
| 32 | /* |
| 33 | * Directory block iterator definition |
| 34 | */ |
| 35 | struct ext2_struct_dblist { |
| 36 | int magic; |
| 37 | ext2_filsys fs; |
| 38 | ino_t size; |
| 39 | ino_t count; |
| 40 | int sorted; |
| 41 | struct ext2_db_entry * list; |
| 42 | }; |
| 43 | |
| 44 | /* |
| 45 | * For directory iterators |
| 46 | */ |
| 47 | struct dir_context { |
| 48 | ino_t dir; |
| 49 | int flags; |
| 50 | char *buf; |
| 51 | int (*func)(struct ext2_dir_entry *dirent, |
| 52 | int offset, |
| 53 | int blocksize, |
| 54 | char *buf, |
Theodore Ts'o | b5abe6f | 1998-01-19 14:47:53 +0000 | [diff] [blame] | 55 | void *priv_data); |
Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 56 | int (*func2)(ino_t dir, |
| 57 | int entry, |
| 58 | struct ext2_dir_entry *dirent, |
| 59 | int offset, |
| 60 | int blocksize, |
| 61 | char *buf, |
Theodore Ts'o | b5abe6f | 1998-01-19 14:47:53 +0000 | [diff] [blame] | 62 | void *priv_data); |
| 63 | void *priv_data; |
Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 64 | errcode_t errcode; |
| 65 | }; |
| 66 | |
Theodore Ts'o | a29f4d3 | 1997-04-29 21:26:48 +0000 | [diff] [blame] | 67 | /* |
| 68 | * Inode cache structure |
| 69 | */ |
| 70 | struct ext2_inode_cache { |
| 71 | void * buffer; |
| 72 | blk_t buffer_blk; |
| 73 | int cache_last; |
| 74 | int cache_size; |
| 75 | int refcount; |
| 76 | struct ext2_inode_cache_ent *cache; |
| 77 | }; |
| 78 | |
| 79 | struct ext2_inode_cache_ent { |
| 80 | ino_t ino; |
| 81 | struct ext2_inode inode; |
| 82 | }; |
Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 83 | |
| 84 | /* Function prototypes */ |
| 85 | |
Theodore Ts'o | 36a43d6 | 1998-03-24 16:17:51 +0000 | [diff] [blame] | 86 | extern int ext2fs_process_dir_block(ext2_filsys fs, |
| 87 | blk_t *blocknr, |
Theodore Ts'o | 03673db | 1998-06-10 20:39:43 +0000 | [diff] [blame] | 88 | e2_blkcnt_t blockcnt, |
Theodore Ts'o | 36a43d6 | 1998-03-24 16:17:51 +0000 | [diff] [blame] | 89 | blk_t ref_block, |
| 90 | int ref_offset, |
| 91 | void *priv_data); |
| 92 | |
Theodore Ts'o | 19c78dc | 1997-04-29 16:17:09 +0000 | [diff] [blame] | 93 | |