• Home
  • Raw
  • Download

Lines Matching refs:emi

67 	struct ocfs2_extent_map_item *emi;  in __ocfs2_extent_map_lookup()  local
71 list_for_each_entry(emi, &em->em_list, ei_list) { in __ocfs2_extent_map_lookup()
72 range = emi->ei_cpos + emi->ei_clusters; in __ocfs2_extent_map_lookup()
74 if (cpos >= emi->ei_cpos && cpos < range) { in __ocfs2_extent_map_lookup()
75 list_move(&emi->ei_list, &em->em_list); in __ocfs2_extent_map_lookup()
77 *ret_emi = emi; in __ocfs2_extent_map_lookup()
89 struct ocfs2_extent_map_item *emi; in ocfs2_extent_map_lookup() local
93 __ocfs2_extent_map_lookup(&oi->ip_extent_map, cpos, &emi); in ocfs2_extent_map_lookup()
94 if (emi) { in ocfs2_extent_map_lookup()
95 coff = cpos - emi->ei_cpos; in ocfs2_extent_map_lookup()
96 *phys = emi->ei_phys + coff; in ocfs2_extent_map_lookup()
98 *len = emi->ei_clusters - coff; in ocfs2_extent_map_lookup()
100 *flags = emi->ei_flags; in ocfs2_extent_map_lookup()
105 if (emi == NULL) in ocfs2_extent_map_lookup()
116 struct ocfs2_extent_map_item *emi, *n; in ocfs2_extent_map_trunc() local
123 list_for_each_entry_safe(emi, n, &em->em_list, ei_list) { in ocfs2_extent_map_trunc()
124 if (emi->ei_cpos >= cpos) { in ocfs2_extent_map_trunc()
126 list_move(&emi->ei_list, &tmp_list); in ocfs2_extent_map_trunc()
132 range = emi->ei_cpos + emi->ei_clusters; in ocfs2_extent_map_trunc()
135 emi->ei_clusters = cpos - emi->ei_cpos; in ocfs2_extent_map_trunc()
140 list_for_each_entry_safe(emi, n, &tmp_list, ei_list) { in ocfs2_extent_map_trunc()
141 list_del(&emi->ei_list); in ocfs2_extent_map_trunc()
142 kfree(emi); in ocfs2_extent_map_trunc()
184 static int ocfs2_try_to_merge_extent_map(struct ocfs2_extent_map_item *emi, in ocfs2_try_to_merge_extent_map() argument
190 if (ins->ei_phys == (emi->ei_phys + emi->ei_clusters) && in ocfs2_try_to_merge_extent_map()
191 ins->ei_cpos == (emi->ei_cpos + emi->ei_clusters) && in ocfs2_try_to_merge_extent_map()
192 ins->ei_flags == emi->ei_flags) { in ocfs2_try_to_merge_extent_map()
193 emi->ei_clusters += ins->ei_clusters; in ocfs2_try_to_merge_extent_map()
195 } else if ((ins->ei_phys + ins->ei_clusters) == emi->ei_phys && in ocfs2_try_to_merge_extent_map()
196 (ins->ei_cpos + ins->ei_clusters) == emi->ei_cpos && in ocfs2_try_to_merge_extent_map()
197 ins->ei_flags == emi->ei_flags) { in ocfs2_try_to_merge_extent_map()
198 emi->ei_phys = ins->ei_phys; in ocfs2_try_to_merge_extent_map()
199 emi->ei_cpos = ins->ei_cpos; in ocfs2_try_to_merge_extent_map()
200 emi->ei_clusters += ins->ei_clusters; in ocfs2_try_to_merge_extent_map()
209 if (ocfs2_ei_is_contained(emi, ins) || in ocfs2_try_to_merge_extent_map()
210 ocfs2_ei_is_contained(ins, emi)) { in ocfs2_try_to_merge_extent_map()
211 ocfs2_copy_emi_fields(emi, ins); in ocfs2_try_to_merge_extent_map()
232 struct ocfs2_extent_map_item *emi, *new_emi = NULL; in ocfs2_extent_map_insert_rec() local
244 list_for_each_entry(emi, &em->em_list, ei_list) { in ocfs2_extent_map_insert_rec()
245 if (ocfs2_try_to_merge_extent_map(emi, &ins)) { in ocfs2_extent_map_insert_rec()
246 list_move(&emi->ei_list, &em->em_list); in ocfs2_extent_map_insert_rec()
276 emi = list_entry(em->em_list.prev, in ocfs2_extent_map_insert_rec()
278 list_move(&emi->ei_list, &em->em_list); in ocfs2_extent_map_insert_rec()
279 ocfs2_copy_emi_fields(emi, &ins); in ocfs2_extent_map_insert_rec()