Lines Matching refs:es1

262 	struct extent_status *es1 = NULL;  in __es_find_extent_range()  local
273 es1 = tree->cache_es; in __es_find_extent_range()
274 if (in_range(lblk, es1->es_lblk, es1->es_len)) { in __es_find_extent_range()
276 lblk, es1->es_lblk, es1->es_len, in __es_find_extent_range()
277 ext4_es_pblock(es1), ext4_es_status(es1)); in __es_find_extent_range()
282 es1 = __es_tree_search(&tree->root, lblk); in __es_find_extent_range()
285 if (es1 && !matching_fn(es1)) { in __es_find_extent_range()
286 while ((node = rb_next(&es1->rb_node)) != NULL) { in __es_find_extent_range()
287 es1 = rb_entry(node, struct extent_status, rb_node); in __es_find_extent_range()
288 if (es1->es_lblk > end) { in __es_find_extent_range()
289 es1 = NULL; in __es_find_extent_range()
292 if (matching_fn(es1)) in __es_find_extent_range()
297 if (es1 && matching_fn(es1)) { in __es_find_extent_range()
298 tree->cache_es = es1; in __es_find_extent_range()
299 es->es_lblk = es1->es_lblk; in __es_find_extent_range()
300 es->es_len = es1->es_len; in __es_find_extent_range()
301 es->es_pblk = es1->es_pblk; in __es_find_extent_range()
505 static int ext4_es_can_be_merged(struct extent_status *es1, in ext4_es_can_be_merged() argument
508 if (ext4_es_type(es1) != ext4_es_type(es2)) in ext4_es_can_be_merged()
511 if (((__u64) es1->es_len) + es2->es_len > EXT_MAX_BLOCKS) { in ext4_es_can_be_merged()
515 es1->es_len, es2->es_len, EXT_MAX_BLOCKS); in ext4_es_can_be_merged()
520 if (((__u64) es1->es_lblk) + es1->es_len != es2->es_lblk) in ext4_es_can_be_merged()
523 if ((ext4_es_is_written(es1) || ext4_es_is_unwritten(es1)) && in ext4_es_can_be_merged()
524 (ext4_es_pblock(es1) + es1->es_len == ext4_es_pblock(es2))) in ext4_es_can_be_merged()
527 if (ext4_es_is_hole(es1)) in ext4_es_can_be_merged()
531 if (ext4_es_is_delayed(es1) && !ext4_es_is_unwritten(es1)) in ext4_es_can_be_merged()
541 struct extent_status *es1; in ext4_es_try_to_merge_left() local
548 es1 = rb_entry(node, struct extent_status, rb_node); in ext4_es_try_to_merge_left()
549 if (ext4_es_can_be_merged(es1, es)) { in ext4_es_try_to_merge_left()
550 es1->es_len += es->es_len; in ext4_es_try_to_merge_left()
552 ext4_es_set_referenced(es1); in ext4_es_try_to_merge_left()
555 es = es1; in ext4_es_try_to_merge_left()
565 struct extent_status *es1; in ext4_es_try_to_merge_right() local
572 es1 = rb_entry(node, struct extent_status, rb_node); in ext4_es_try_to_merge_right()
573 if (ext4_es_can_be_merged(es, es1)) { in ext4_es_try_to_merge_right()
574 es->es_len += es1->es_len; in ext4_es_try_to_merge_right()
575 if (ext4_es_is_referenced(es1)) in ext4_es_try_to_merge_right()
578 ext4_es_free_extent(inode, es1); in ext4_es_try_to_merge_right()
921 struct extent_status *es1 = NULL; in ext4_es_lookup_extent() local
937 es1 = tree->cache_es; in ext4_es_lookup_extent()
938 if (in_range(lblk, es1->es_lblk, es1->es_len)) { in ext4_es_lookup_extent()
940 lblk, es1->es_lblk, es1->es_len); in ext4_es_lookup_extent()
948 es1 = rb_entry(node, struct extent_status, rb_node); in ext4_es_lookup_extent()
949 if (lblk < es1->es_lblk) in ext4_es_lookup_extent()
951 else if (lblk > ext4_es_end(es1)) in ext4_es_lookup_extent()
962 BUG_ON(!es1); in ext4_es_lookup_extent()
963 es->es_lblk = es1->es_lblk; in ext4_es_lookup_extent()
964 es->es_len = es1->es_len; in ext4_es_lookup_extent()
965 es->es_pblk = es1->es_pblk; in ext4_es_lookup_extent()
966 if (!ext4_es_is_referenced(es1)) in ext4_es_lookup_extent()
967 ext4_es_set_referenced(es1); in ext4_es_lookup_extent()
970 node = rb_next(&es1->rb_node); in ext4_es_lookup_extent()
972 es1 = rb_entry(node, struct extent_status, in ext4_es_lookup_extent()
974 *next_lblk = es1->es_lblk; in ext4_es_lookup_extent()