4 * Copyright (C) 1996, 1997 Theodore Ts'o.
7 * This file may be redistributed under the terms of the GNU Library
8 * General Public License, version 2.
12 struct ext2_block_relocate_entry {
22 #define RELOCATE_TYPE_REF 0x0007
23 #define RELOCATE_BLOCK_REF 0x0001
24 #define RELOCATE_INODE_REF 0x0002
26 typedef struct ext2_block_relocation_table *ext2_brel;
28 struct ext2_block_relocation_table {
35 * Add a block relocation entry.
37 errcode_t (*put)(ext2_brel brel, blk_t old,
38 struct ext2_block_relocate_entry *ent);
41 * Get a block relocation entry.
43 errcode_t (*get)(ext2_brel brel, blk_t old,
44 struct ext2_block_relocate_entry *ent);
47 * Initialize for iterating over the block relocation entries.
49 errcode_t (*start_iter)(ext2_brel brel);
52 * The iterator function for the inode relocation entries.
53 * Returns an inode number of 0 when out of entries.
55 errcode_t (*next)(ext2_brel brel, blk_t *old,
56 struct ext2_block_relocate_entry *ent);
59 * Move the inode relocation table from one block number to
62 errcode_t (*move)(ext2_brel brel, blk_t old, blk_t new);
65 * Remove a block relocation entry.
67 errcode_t (*delete)(ext2_brel brel, blk_t old);
71 * Free the block relocation table.
73 errcode_t (*free)(ext2_brel brel);
76 errcode_t ext2fs_brel_memarray_create(char *name, blk_t max_block,
79 #define ext2fs_brel_put(brel, old, ent) ((brel)->put((brel), old, ent))
80 #define ext2fs_brel_get(brel, old, ent) ((brel)->get((brel), old, ent))
81 #define ext2fs_brel_start_iter(brel) ((brel)->start_iter((brel)))
82 #define ext2fs_brel_next(brel, old, ent) ((brel)->next((brel), old, ent))
83 #define ext2fs_brel_move(brel, old, new) ((brel)->move((brel), old, new))
84 #define ext2fs_brel_delete(brel, old) ((brel)->delete((brel), old))
85 #define ext2fs_brel_free(brel) ((brel)->free((brel)))