• Home
  • Raw
  • Download

Lines Matching refs:ma

68 	struct irel_ma 	*ma = 0;  in ext2fs_irel_memarray_create()  local
87 retval = ext2fs_get_mem(sizeof(struct irel_ma), &ma); in ext2fs_irel_memarray_create()
90 memset(ma, 0, sizeof(struct irel_ma)); in ext2fs_irel_memarray_create()
91 irel->priv_data = ma; in ext2fs_irel_memarray_create()
95 &ma->orig_map); in ext2fs_irel_memarray_create()
98 memset(ma->orig_map, 0, size); in ext2fs_irel_memarray_create()
103 sizeof(struct ext2_inode_relocate_entry), &ma->entries); in ext2fs_irel_memarray_create()
106 memset(ma->entries, 0, size); in ext2fs_irel_memarray_create()
111 sizeof(struct inode_reference_entry), &ma->ref_entries); in ext2fs_irel_memarray_create()
114 memset(ma->ref_entries, 0, size); in ext2fs_irel_memarray_create()
115 ma->max_inode = max_inode; in ext2fs_irel_memarray_create()
144 struct irel_ma *ma;
148 ma = irel->priv_data;
149 if (old > ma->max_inode)
156 if (ma->entries[(unsigned) old].new == 0)
159 ent->orig = ma->entries[(unsigned) old].orig;
164 ref_ent = ma->ref_entries + (unsigned) old;
166 ma->entries[(unsigned) old].max_refs) {
169 ma->entries[(unsigned) old].max_refs);
175 ma->entries[(unsigned) old] = *ent;
176 ma->orig_map[(unsigned) ent->orig] = old;
183 struct irel_ma *ma;
185 ma = irel->priv_data;
186 if (old > ma->max_inode)
188 if (ma->entries[(unsigned) old].new == 0)
190 *ent = ma->entries[(unsigned) old];
197 struct irel_ma *ma;
200 ma = irel->priv_data;
201 if (orig > ma->max_inode)
203 ino = ma->orig_map[(unsigned) orig];
207 *ent = ma->entries[(unsigned) ino];
220 struct irel_ma *ma;
222 ma = irel->priv_data;
223 while (++irel->current < ma->max_inode) {
224 if (ma->entries[(unsigned) irel->current].new == 0)
227 *ent = ma->entries[(unsigned) irel->current];
237 struct irel_ma *ma;
243 ma = irel->priv_data;
244 if (ino > ma->max_inode)
247 ref_ent = ma->ref_entries + (unsigned) ino;
248 ent = ma->entries + (unsigned) ino;
273 struct irel_ma *ma;
275 ma = irel->priv_data;
276 if (ino > ma->max_inode)
278 if (ma->entries[(unsigned) ino].new == 0)
280 ma->ref_current = ino;
281 ma->ref_iter = 0;
288 struct irel_ma *ma;
291 ma = irel->priv_data;
293 ref_ent = ma->ref_entries + ma->ref_current;
296 (ma->ref_iter >= ref_ent->num)) {
301 *ref = ref_ent->refs[ma->ref_iter++];
308 struct irel_ma *ma;
310 ma = irel->priv_data;
311 if ((old > ma->max_inode) || (new > ma->max_inode))
313 if (ma->entries[(unsigned) old].new == 0)
316 ma->entries[(unsigned) new] = ma->entries[(unsigned) old];
317 if (ma->ref_entries[(unsigned) new].refs)
318 ext2fs_free_mem(&ma->ref_entries[(unsigned) new].refs);
319 ma->ref_entries[(unsigned) new] = ma->ref_entries[(unsigned) old];
321 ma->entries[(unsigned) old].new = 0;
322 ma->ref_entries[(unsigned) old].num = 0;
323 ma->ref_entries[(unsigned) old].refs = 0;
325 ma->orig_map[ma->entries[new].orig] = new;
331 struct irel_ma *ma;
333 ma = irel->priv_data;
334 if (old > ma->max_inode)
336 if (ma->entries[(unsigned) old].new == 0)
339 ma->entries[old].new = 0;
340 if (ma->ref_entries[(unsigned) old].refs)
341 ext2fs_free_mem(&ma->ref_entries[(unsigned) old].refs);
342 ma->orig_map[ma->entries[(unsigned) old].orig] = 0;
344 ma->ref_entries[(unsigned) old].num = 0;
345 ma->ref_entries[(unsigned) old].refs = 0;
351 struct irel_ma *ma;
357 ma = irel->priv_data;
359 if (ma) {
360 if (ma->orig_map)
361 ext2fs_free_mem(&ma->orig_map);
362 if (ma->entries)
363 ext2fs_free_mem(&ma->entries);
364 if (ma->ref_entries) {
365 for (ino = 0; ino <= ma->max_inode; ino++) {
366 if (ma->ref_entries[(unsigned) ino].refs)
367 ext2fs_free_mem(&ma->ref_entries[(unsigned) ino].refs);
369 ext2fs_free_mem(&ma->ref_entries);
371 ext2fs_free_mem(&ma);