Lines Matching refs:brel
28 #include "brel.h"
30 static errcode_t bma_put(ext2_brel brel, blk64_t old,
32 static errcode_t bma_get(ext2_brel brel, blk64_t old,
34 static errcode_t bma_start_iter(ext2_brel brel);
35 static errcode_t bma_next(ext2_brel brel, blk64_t *old,
37 static errcode_t bma_move(ext2_brel brel, blk64_t old, blk64_t new);
38 static errcode_t bma_delete(ext2_brel brel, blk64_t old);
39 static errcode_t bma_free(ext2_brel brel);
50 ext2_brel brel = 0;
61 &brel);
64 memset(brel, 0, sizeof(struct ext2_block_relocation_table));
66 retval = ext2fs_get_mem(strlen(name)+1, &brel->name);
69 strcpy(brel->name, name);
75 brel->priv_data = ma;
87 * Fill in the brel data structure
89 brel->put = bma_put;
90 brel->get = bma_get;
91 brel->start_iter = bma_start_iter;
92 brel->next = bma_next;
93 brel->move = bma_move;
94 brel->delete = bma_delete;
95 brel->free = bma_free;
97 *new_brel = brel;
101 bma_free(brel);
105 static errcode_t bma_put(ext2_brel brel, blk64_t old,
110 ma = brel->priv_data;
117 static errcode_t bma_get(ext2_brel brel, blk64_t old,
122 ma = brel->priv_data;
131 static errcode_t bma_start_iter(ext2_brel brel)
133 brel->current = 0;
137 static errcode_t bma_next(ext2_brel brel, blk64_t *old,
142 ma = brel->priv_data;
143 while (++brel->current < ma->max_block) {
144 if (ma->entries[(unsigned)brel->current].new == 0)
146 *old = brel->current;
147 *ent = ma->entries[(unsigned)brel->current];
154 static errcode_t bma_move(ext2_brel brel, blk64_t old, blk64_t new)
158 ma = brel->priv_data;
168 static errcode_t bma_delete(ext2_brel brel, blk64_t old)
172 ma = brel->priv_data;
181 static errcode_t bma_free(ext2_brel brel)
185 if (!brel)
188 ma = brel->priv_data;
195 if (brel->name)
196 ext2fs_free_mem(&brel->name);
197 ext2fs_free_mem(&brel);