blob: c666faaff2df434b5f4f4da90986c0e57f3b0a49 [file] [log] [blame]
Theodore Ts'o19c78dc1997-04-29 16:17:09 +00001/*
2 * ext2fsP.h --- private header file for ext2 library
Theodore Ts'oefc6f622008-08-27 23:07:54 -04003 *
Theodore Ts'o19c78dc1997-04-29 16:17:09 +00004 * 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 */
Theodore Ts'ob7a00562002-07-20 00:28:07 -040017struct ext2_struct_u32_list {
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000018 int magic;
19 int num;
20 int size;
Theodore Ts'ob7a00562002-07-20 00:28:07 -040021 __u32 *list;
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000022 int badblocks_flags;
23};
24
Theodore Ts'ob7a00562002-07-20 00:28:07 -040025struct ext2_struct_u32_iterate {
26 int magic;
27 ext2_u32_list bb;
28 int ptr;
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000029};
30
31
32/*
33 * Directory block iterator definition
34 */
35struct ext2_struct_dblist {
36 int magic;
37 ext2_filsys fs;
Theodore Ts'o31dbecd2001-01-11 04:54:39 +000038 ext2_ino_t size;
39 ext2_ino_t count;
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000040 int sorted;
41 struct ext2_db_entry * list;
42};
43
44/*
45 * For directory iterators
46 */
47struct dir_context {
Theodore Ts'o31dbecd2001-01-11 04:54:39 +000048 ext2_ino_t dir;
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000049 int flags;
50 char *buf;
Theodore Ts'o8bd0c952002-01-03 03:29:19 -050051 int (*func)(ext2_ino_t dir,
52 int entry,
53 struct ext2_dir_entry *dirent,
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000054 int offset,
55 int blocksize,
56 char *buf,
Theodore Ts'ob5abe6f1998-01-19 14:47:53 +000057 void *priv_data);
Theodore Ts'ob5abe6f1998-01-19 14:47:53 +000058 void *priv_data;
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000059 errcode_t errcode;
60};
61
Theodore Ts'oa29f4d31997-04-29 21:26:48 +000062/*
63 * Inode cache structure
64 */
65struct ext2_inode_cache {
66 void * buffer;
67 blk_t buffer_blk;
68 int cache_last;
69 int cache_size;
70 int refcount;
71 struct ext2_inode_cache_ent *cache;
72};
73
74struct ext2_inode_cache_ent {
Theodore Ts'o31dbecd2001-01-11 04:54:39 +000075 ext2_ino_t ino;
76 struct ext2_inode inode;
Theodore Ts'oa29f4d31997-04-29 21:26:48 +000077};
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000078
79/* Function prototypes */
80
Theodore Ts'o36a43d61998-03-24 16:17:51 +000081extern int ext2fs_process_dir_block(ext2_filsys fs,
82 blk_t *blocknr,
Theodore Ts'o03673db1998-06-10 20:39:43 +000083 e2_blkcnt_t blockcnt,
Theodore Ts'o36a43d61998-03-24 16:17:51 +000084 blk_t ref_block,
85 int ref_offset,
86 void *priv_data);
87
Theodore Ts'o19c78dc1997-04-29 16:17:09 +000088