Lines Matching refs:en

201 	struct extent_node *en;  in __attach_extent_node()  local
203 en = kmem_cache_alloc(extent_node_slab, GFP_ATOMIC); in __attach_extent_node()
204 if (!en) in __attach_extent_node()
207 en->ei = *ei; in __attach_extent_node()
208 INIT_LIST_HEAD(&en->list); in __attach_extent_node()
209 en->et = et; in __attach_extent_node()
211 rb_link_node(&en->rb_node, parent, p); in __attach_extent_node()
212 rb_insert_color(&en->rb_node, &et->root); in __attach_extent_node()
215 return en; in __attach_extent_node()
219 struct extent_tree *et, struct extent_node *en) in __detach_extent_node() argument
221 rb_erase(&en->rb_node, &et->root); in __detach_extent_node()
225 if (et->cached_en == en) in __detach_extent_node()
227 kmem_cache_free(extent_node_slab, en); in __detach_extent_node()
237 struct extent_tree *et, struct extent_node *en) in __release_extent_node() argument
240 f2fs_bug_on(sbi, list_empty(&en->list)); in __release_extent_node()
241 list_del_init(&en->list); in __release_extent_node()
244 __detach_extent_node(sbi, et, en); in __release_extent_node()
282 struct extent_node *en; in __init_extent_tree() local
284 en = __attach_extent_node(sbi, et, ei, NULL, p); in __init_extent_tree()
285 if (!en) in __init_extent_tree()
288 et->largest = en->ei; in __init_extent_tree()
289 et->cached_en = en; in __init_extent_tree()
290 return en; in __init_extent_tree()
297 struct extent_node *en; in __free_extent_tree() local
303 en = rb_entry(node, struct extent_node, rb_node); in __free_extent_tree()
304 __release_extent_node(sbi, et, en); in __free_extent_tree()
326 struct extent_node *en; in __f2fs_init_extent_tree() local
349 en = __init_extent_tree(sbi, et, &ei); in __f2fs_init_extent_tree()
350 if (en) { in __f2fs_init_extent_tree()
352 list_add_tail(&en->list, &sbi->extent_list); in __f2fs_init_extent_tree()
375 struct extent_node *en; in f2fs_lookup_extent_tree() local
393 en = (struct extent_node *)f2fs_lookup_rb_tree(&et->root, in f2fs_lookup_extent_tree()
395 if (!en) in f2fs_lookup_extent_tree()
398 if (en == et->cached_en) in f2fs_lookup_extent_tree()
403 *ei = en->ei; in f2fs_lookup_extent_tree()
405 if (!list_empty(&en->list)) { in f2fs_lookup_extent_tree()
406 list_move_tail(&en->list, &sbi->extent_list); in f2fs_lookup_extent_tree()
407 et->cached_en = en; in f2fs_lookup_extent_tree()
424 struct extent_node *en = NULL; in __try_merge_extent_node() local
429 en = prev_ex; in __try_merge_extent_node()
436 if (en) in __try_merge_extent_node()
439 en = next_ex; in __try_merge_extent_node()
442 if (!en) in __try_merge_extent_node()
445 __try_update_largest_extent(et, en); in __try_merge_extent_node()
448 if (!list_empty(&en->list)) { in __try_merge_extent_node()
449 list_move_tail(&en->list, &sbi->extent_list); in __try_merge_extent_node()
450 et->cached_en = en; in __try_merge_extent_node()
453 return en; in __try_merge_extent_node()
463 struct extent_node *en = NULL; in __insert_extent_tree() local
473 en = __attach_extent_node(sbi, et, ei, parent, p); in __insert_extent_tree()
474 if (!en) in __insert_extent_tree()
477 __try_update_largest_extent(et, en); in __insert_extent_tree()
481 list_add_tail(&en->list, &sbi->extent_list); in __insert_extent_tree()
482 et->cached_en = en; in __insert_extent_tree()
484 return en; in __insert_extent_tree()
492 struct extent_node *en = NULL, *en1 = NULL; in f2fs_update_extent_tree_range() local
522 en = (struct extent_node *)f2fs_lookup_rb_tree_ret(&et->root, in f2fs_update_extent_tree_range()
527 if (!en) in f2fs_update_extent_tree_range()
528 en = next_en; in f2fs_update_extent_tree_range()
531 while (en && en->ei.fofs < end) { in f2fs_update_extent_tree_range()
537 dei = en->ei; in f2fs_update_extent_tree_range()
542 en->ei.len = pos - en->ei.fofs; in f2fs_update_extent_tree_range()
543 prev_en = en; in f2fs_update_extent_tree_range()
556 en->ei.fofs = end; in f2fs_update_extent_tree_range()
557 en->ei.blk += end - dei.fofs; in f2fs_update_extent_tree_range()
558 en->ei.len -= end - dei.fofs; in f2fs_update_extent_tree_range()
559 next_en = en; in f2fs_update_extent_tree_range()
565 struct rb_node *node = rb_next(&en->rb_node); in f2fs_update_extent_tree_range()
572 __try_update_largest_extent(et, en); in f2fs_update_extent_tree_range()
574 __release_extent_node(sbi, et, en); in f2fs_update_extent_tree_range()
585 en = next_en; in f2fs_update_extent_tree_range()
623 struct extent_node *en; in f2fs_shrink_extent_tree() local
668 en = list_first_entry(&sbi->extent_list, in f2fs_shrink_extent_tree()
670 et = en->et; in f2fs_shrink_extent_tree()
673 list_move_tail(&en->list, &sbi->extent_list); in f2fs_shrink_extent_tree()
677 list_del_init(&en->list); in f2fs_shrink_extent_tree()
680 __detach_extent_node(sbi, et, en); in f2fs_shrink_extent_tree()