Lines Matching defs:ma
67 struct irel_ma *ma = 0;
86 retval = ext2fs_get_mem(sizeof(struct irel_ma), &ma);
89 memset(ma, 0, sizeof(struct irel_ma));
90 irel->priv_data = ma;
94 &ma->orig_map);
97 memset(ma->orig_map, 0, size);
102 sizeof(struct ext2_inode_relocate_entry), &ma->entries);
105 memset(ma->entries, 0, size);
110 sizeof(struct inode_reference_entry), &ma->ref_entries);
113 memset(ma->ref_entries, 0, size);
114 ma->max_inode = max_inode;
143 struct irel_ma *ma;
147 ma = irel->priv_data;
148 if (old > ma->max_inode)
155 if (ma->entries[(unsigned) old].new == 0)
158 ent->orig = ma->entries[(unsigned) old].orig;
163 ref_ent = ma->ref_entries + (unsigned) old;
165 ma->entries[(unsigned) old].max_refs) {
168 ma->entries[(unsigned) old].max_refs);
174 ma->entries[(unsigned) old] = *ent;
175 ma->orig_map[(unsigned) ent->orig] = old;
182 struct irel_ma *ma;
184 ma = irel->priv_data;
185 if (old > ma->max_inode)
187 if (ma->entries[(unsigned) old].new == 0)
189 *ent = ma->entries[(unsigned) old];
196 struct irel_ma *ma;
199 ma = irel->priv_data;
200 if (orig > ma->max_inode)
202 ino = ma->orig_map[(unsigned) orig];
206 *ent = ma->entries[(unsigned) ino];
219 struct irel_ma *ma;
221 ma = irel->priv_data;
222 while (++irel->current < ma->max_inode) {
223 if (ma->entries[(unsigned) irel->current].new == 0)
226 *ent = ma->entries[(unsigned) irel->current];
236 struct irel_ma *ma;
242 ma = irel->priv_data;
243 if (ino > ma->max_inode)
246 ref_ent = ma->ref_entries + (unsigned) ino;
247 ent = ma->entries + (unsigned) ino;
272 struct irel_ma *ma;
274 ma = irel->priv_data;
275 if (ino > ma->max_inode)
277 if (ma->entries[(unsigned) ino].new == 0)
279 ma->ref_current = ino;
280 ma->ref_iter = 0;
287 struct irel_ma *ma;
290 ma = irel->priv_data;
292 ref_ent = ma->ref_entries + ma->ref_current;
295 (ma->ref_iter >= ref_ent->num)) {
300 *ref = ref_ent->refs[ma->ref_iter++];
307 struct irel_ma *ma;
309 ma = irel->priv_data;
310 if ((old > ma->max_inode) || (new > ma->max_inode))
312 if (ma->entries[(unsigned) old].new == 0)
315 ma->entries[(unsigned) new] = ma->entries[(unsigned) old];
316 if (ma->ref_entries[(unsigned) new].refs)
317 ext2fs_free_mem(&ma->ref_entries[(unsigned) new].refs);
318 ma->ref_entries[(unsigned) new] = ma->ref_entries[(unsigned) old];
320 ma->entries[(unsigned) old].new = 0;
321 ma->ref_entries[(unsigned) old].num = 0;
322 ma->ref_entries[(unsigned) old].refs = 0;
324 ma->orig_map[ma->entries[new].orig] = new;
330 struct irel_ma *ma;
332 ma = irel->priv_data;
333 if (old > ma->max_inode)
335 if (ma->entries[(unsigned) old].new == 0)
338 ma->entries[old].new = 0;
339 if (ma->ref_entries[(unsigned) old].refs)
340 ext2fs_free_mem(&ma->ref_entries[(unsigned) old].refs);
341 ma->orig_map[ma->entries[(unsigned) old].orig] = 0;
343 ma->ref_entries[(unsigned) old].num = 0;
344 ma->ref_entries[(unsigned) old].refs = 0;
350 struct irel_ma *ma;
356 ma = irel->priv_data;
358 if (ma) {
359 if (ma->orig_map)
360 ext2fs_free_mem(&ma->orig_map);
361 if (ma->entries)
362 ext2fs_free_mem(&ma->entries);
363 if (ma->ref_entries) {
364 for (ino = 0; ino <= ma->max_inode; ino++) {
365 if (ma->ref_entries[(unsigned) ino].refs)
366 ext2fs_free_mem(&ma->ref_entries[(unsigned) ino].refs);
368 ext2fs_free_mem(&ma->ref_entries);
370 ext2fs_free_mem(&ma);