Lines Matching full:en
105 struct extent_node *en) in __try_update_largest_extent() argument
109 if (en->ei.len <= et->largest.len) in __try_update_largest_extent()
112 et->largest = en->ei; in __try_update_largest_extent()
153 struct extent_node *en; in __lookup_extent_node() local
162 en = rb_entry(node, struct extent_node, rb_node); in __lookup_extent_node()
164 if (fofs < en->ei.fofs) in __lookup_extent_node()
166 else if (fofs >= en->ei.fofs + en->ei.len) in __lookup_extent_node()
169 return en; in __lookup_extent_node()
194 struct extent_node *en = cached_en; in __lookup_extent_node_ret() local
204 if (en && en->ei.fofs <= fofs && en->ei.fofs + en->ei.len > fofs) in __lookup_extent_node_ret()
211 en = rb_entry(*pnode, struct extent_node, rb_node); in __lookup_extent_node_ret()
213 if (fofs < en->ei.fofs) { in __lookup_extent_node_ret()
215 } else if (fofs >= en->ei.fofs + en->ei.len) { in __lookup_extent_node_ret()
226 en = rb_entry(parent, struct extent_node, rb_node); in __lookup_extent_node_ret()
228 if (parent && fofs > en->ei.fofs) in __lookup_extent_node_ret()
233 if (parent && fofs < en->ei.fofs) in __lookup_extent_node_ret()
239 if (fofs == en->ei.fofs) { in __lookup_extent_node_ret()
241 tmp_node = rb_prev(&en->rb_node); in __lookup_extent_node_ret()
245 if (fofs == en->ei.fofs + en->ei.len - 1) { in __lookup_extent_node_ret()
247 tmp_node = rb_next(&en->rb_node); in __lookup_extent_node_ret()
251 return en; in __lookup_extent_node_ret()
263 struct extent_node *en; in __attach_extent_node() local
265 en = f2fs_kmem_cache_alloc(extent_node_slab, GFP_ATOMIC, false, sbi); in __attach_extent_node()
266 if (!en) in __attach_extent_node()
269 en->ei = *ei; in __attach_extent_node()
270 INIT_LIST_HEAD(&en->list); in __attach_extent_node()
271 en->et = et; in __attach_extent_node()
273 rb_link_node(&en->rb_node, parent, p); in __attach_extent_node()
274 rb_insert_color_cached(&en->rb_node, &et->root, leftmost); in __attach_extent_node()
277 return en; in __attach_extent_node()
281 struct extent_tree *et, struct extent_node *en) in __detach_extent_node() argument
285 rb_erase_cached(&en->rb_node, &et->root); in __detach_extent_node()
289 if (et->cached_en == en) in __detach_extent_node()
291 kmem_cache_free(extent_node_slab, en); in __detach_extent_node()
301 struct extent_tree *et, struct extent_node *en) in __release_extent_node() argument
306 f2fs_bug_on(sbi, list_empty(&en->list)); in __release_extent_node()
307 list_del_init(&en->list); in __release_extent_node()
310 __detach_extent_node(sbi, et, en); in __release_extent_node()
352 struct extent_node *en; in __free_extent_tree() local
358 en = rb_entry(node, struct extent_node, rb_node); in __free_extent_tree()
359 __release_extent_node(sbi, et, en); in __free_extent_tree()
382 struct extent_node *en; in f2fs_init_read_extent_tree() local
404 en = __attach_extent_node(sbi, et, &ei, NULL, in f2fs_init_read_extent_tree()
406 if (en) { in f2fs_init_read_extent_tree()
407 et->largest = en->ei; in f2fs_init_read_extent_tree()
408 et->cached_en = en; in f2fs_init_read_extent_tree()
411 list_add_tail(&en->list, &eti->extent_list); in f2fs_init_read_extent_tree()
447 struct extent_node *en; in __lookup_extent_tree() local
466 en = __lookup_extent_node(&et->root, et->cached_en, pgofs); in __lookup_extent_tree()
467 if (!en) in __lookup_extent_tree()
470 if (en == et->cached_en) in __lookup_extent_tree()
475 *ei = en->ei; in __lookup_extent_tree()
477 if (!list_empty(&en->list)) { in __lookup_extent_tree()
478 list_move_tail(&en->list, &eti->extent_list); in __lookup_extent_tree()
479 et->cached_en = en; in __lookup_extent_tree()
500 struct extent_node *en = NULL; in __try_merge_extent_node() local
505 en = prev_ex; in __try_merge_extent_node()
513 if (en) in __try_merge_extent_node()
516 en = next_ex; in __try_merge_extent_node()
519 if (!en) in __try_merge_extent_node()
522 __try_update_largest_extent(et, en); in __try_merge_extent_node()
525 if (!list_empty(&en->list)) { in __try_merge_extent_node()
526 list_move_tail(&en->list, &eti->extent_list); in __try_merge_extent_node()
527 et->cached_en = en; in __try_merge_extent_node()
530 return en; in __try_merge_extent_node()
542 struct extent_node *en = NULL; in __insert_extent_tree() local
555 en = rb_entry(parent, struct extent_node, rb_node); in __insert_extent_tree()
557 if (ei->fofs < en->ei.fofs) { in __insert_extent_tree()
559 } else if (ei->fofs >= en->ei.fofs + en->ei.len) { in __insert_extent_tree()
568 en = __attach_extent_node(sbi, et, ei, parent, p, leftmost); in __insert_extent_tree()
569 if (!en) in __insert_extent_tree()
572 __try_update_largest_extent(et, en); in __insert_extent_tree()
576 list_add_tail(&en->list, &eti->extent_list); in __insert_extent_tree()
577 et->cached_en = en; in __insert_extent_tree()
579 return en; in __insert_extent_tree()
587 struct extent_node *en = NULL, *en1 = NULL; in __update_extent_tree_range() local
625 en = __lookup_extent_node_ret(&et->root, in __update_extent_tree_range()
630 if (!en) in __update_extent_tree_range()
631 en = next_en; in __update_extent_tree_range()
634 while (en && en->ei.fofs < end) { in __update_extent_tree_range()
640 dei = en->ei; in __update_extent_tree_range()
646 en->ei.len = fofs - en->ei.fofs; in __update_extent_tree_range()
647 prev_en = en; in __update_extent_tree_range()
663 __set_extent_info(&en->ei, in __update_extent_tree_range()
664 end, en->ei.len - (end - dei.fofs), in __update_extent_tree_range()
665 en->ei.blk + (end - dei.fofs), true, in __update_extent_tree_range()
668 next_en = en; in __update_extent_tree_range()
674 struct rb_node *node = rb_next(&en->rb_node); in __update_extent_tree_range()
681 __try_update_largest_extent(et, en); in __update_extent_tree_range()
683 __release_extent_node(sbi, et, en); in __update_extent_tree_range()
694 en = next_en; in __update_extent_tree_range()
751 struct extent_node *en = NULL; in f2fs_update_read_extent_tree_range_compressed() local
766 en = __lookup_extent_node_ret(&et->root, in f2fs_update_read_extent_tree_range_compressed()
771 if (en) in f2fs_update_read_extent_tree_range_compressed()
888 struct extent_node *en; in __shrink_extent_tree() local
930 en = list_first_entry(&eti->extent_list, in __shrink_extent_tree()
932 et = en->et; in __shrink_extent_tree()
935 list_move_tail(&en->list, &eti->extent_list); in __shrink_extent_tree()
939 list_del_init(&en->list); in __shrink_extent_tree()
942 __detach_extent_node(sbi, et, en); in __shrink_extent_tree()