Lines Matching refs:es1
249 struct extent_status *es1 = NULL; in ext4_es_find_delayed_extent_range() local
262 es1 = tree->cache_es; in ext4_es_find_delayed_extent_range()
263 if (in_range(lblk, es1->es_lblk, es1->es_len)) { in ext4_es_find_delayed_extent_range()
265 lblk, es1->es_lblk, es1->es_len, in ext4_es_find_delayed_extent_range()
266 ext4_es_pblock(es1), ext4_es_status(es1)); in ext4_es_find_delayed_extent_range()
271 es1 = __es_tree_search(&tree->root, lblk); in ext4_es_find_delayed_extent_range()
274 if (es1 && !ext4_es_is_delayed(es1)) { in ext4_es_find_delayed_extent_range()
275 while ((node = rb_next(&es1->rb_node)) != NULL) { in ext4_es_find_delayed_extent_range()
276 es1 = rb_entry(node, struct extent_status, rb_node); in ext4_es_find_delayed_extent_range()
277 if (es1->es_lblk > end) { in ext4_es_find_delayed_extent_range()
278 es1 = NULL; in ext4_es_find_delayed_extent_range()
281 if (ext4_es_is_delayed(es1)) in ext4_es_find_delayed_extent_range()
286 if (es1 && ext4_es_is_delayed(es1)) { in ext4_es_find_delayed_extent_range()
287 tree->cache_es = es1; in ext4_es_find_delayed_extent_range()
288 es->es_lblk = es1->es_lblk; in ext4_es_find_delayed_extent_range()
289 es->es_len = es1->es_len; in ext4_es_find_delayed_extent_range()
290 es->es_pblk = es1->es_pblk; in ext4_es_find_delayed_extent_range()
380 static int ext4_es_can_be_merged(struct extent_status *es1, in ext4_es_can_be_merged() argument
383 if (ext4_es_type(es1) != ext4_es_type(es2)) in ext4_es_can_be_merged()
386 if (((__u64) es1->es_len) + es2->es_len > EXT_MAX_BLOCKS) { in ext4_es_can_be_merged()
390 es1->es_len, es2->es_len, EXT_MAX_BLOCKS); in ext4_es_can_be_merged()
395 if (((__u64) es1->es_lblk) + es1->es_len != es2->es_lblk) in ext4_es_can_be_merged()
398 if ((ext4_es_is_written(es1) || ext4_es_is_unwritten(es1)) && in ext4_es_can_be_merged()
399 (ext4_es_pblock(es1) + es1->es_len == ext4_es_pblock(es2))) in ext4_es_can_be_merged()
402 if (ext4_es_is_hole(es1)) in ext4_es_can_be_merged()
406 if (ext4_es_is_delayed(es1) && !ext4_es_is_unwritten(es1)) in ext4_es_can_be_merged()
416 struct extent_status *es1; in ext4_es_try_to_merge_left() local
423 es1 = rb_entry(node, struct extent_status, rb_node); in ext4_es_try_to_merge_left()
424 if (ext4_es_can_be_merged(es1, es)) { in ext4_es_try_to_merge_left()
425 es1->es_len += es->es_len; in ext4_es_try_to_merge_left()
427 ext4_es_set_referenced(es1); in ext4_es_try_to_merge_left()
430 es = es1; in ext4_es_try_to_merge_left()
440 struct extent_status *es1; in ext4_es_try_to_merge_right() local
447 es1 = rb_entry(node, struct extent_status, rb_node); in ext4_es_try_to_merge_right()
448 if (ext4_es_can_be_merged(es, es1)) { in ext4_es_try_to_merge_right()
449 es->es_len += es1->es_len; in ext4_es_try_to_merge_right()
450 if (ext4_es_is_referenced(es1)) in ext4_es_try_to_merge_right()
453 ext4_es_free_extent(inode, es1); in ext4_es_try_to_merge_right()
784 struct extent_status *es1 = NULL; in ext4_es_lookup_extent() local
797 es1 = tree->cache_es; in ext4_es_lookup_extent()
798 if (in_range(lblk, es1->es_lblk, es1->es_len)) { in ext4_es_lookup_extent()
800 lblk, es1->es_lblk, es1->es_len); in ext4_es_lookup_extent()
808 es1 = rb_entry(node, struct extent_status, rb_node); in ext4_es_lookup_extent()
809 if (lblk < es1->es_lblk) in ext4_es_lookup_extent()
811 else if (lblk > ext4_es_end(es1)) in ext4_es_lookup_extent()
822 BUG_ON(!es1); in ext4_es_lookup_extent()
823 es->es_lblk = es1->es_lblk; in ext4_es_lookup_extent()
824 es->es_len = es1->es_len; in ext4_es_lookup_extent()
825 es->es_pblk = es1->es_pblk; in ext4_es_lookup_extent()
826 if (!ext4_es_is_referenced(es1)) in ext4_es_lookup_extent()
827 ext4_es_set_referenced(es1); in ext4_es_lookup_extent()