blob: b2b593db42a838dfb8c7333930ad1798620098db [file] [log] [blame]
Theodore Ts'o19c78dc1997-04-29 16:17:09 +00001/*
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 */
17struct ext2_struct_badblocks_list {
18 int magic;
19 int num;
20 int size;
21 blk_t *list;
22 int badblocks_flags;
23};
24
25struct ext2_struct_badblocks_iterate {
26 int magic;
27 badblocks_list bb;
28 int ptr;
29};
30
31
32/*
33 * Directory block iterator definition
34 */
35struct 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 */
47struct 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'ob5abe6f1998-01-19 14:47:53 +000055 void *priv_data);
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000056 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'ob5abe6f1998-01-19 14:47:53 +000062 void *priv_data);
63 void *priv_data;
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000064 errcode_t errcode;
65};
66
Theodore Ts'oa29f4d31997-04-29 21:26:48 +000067/*
68 * Inode cache structure
69 */
70struct 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
79struct ext2_inode_cache_ent {
80 ino_t ino;
81 struct ext2_inode inode;
82};
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000083
84/* Function prototypes */
85
Theodore Ts'o36a43d61998-03-24 16:17:51 +000086extern int ext2fs_process_dir_block(ext2_filsys fs,
87 blk_t *blocknr,
Theodore Ts'o03673db1998-06-10 20:39:43 +000088 e2_blkcnt_t blockcnt,
Theodore Ts'o36a43d61998-03-24 16:17:51 +000089 blk_t ref_block,
90 int ref_offset,
91 void *priv_data);
92
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000093