Lines Matching refs:prealloc

182 static struct extent_state *alloc_extent_state_atomic(struct extent_state *prealloc)
184 if (!prealloc)
185 prealloc = alloc_extent_state(GFP_ATOMIC);
187 return prealloc;
511 * struct 'prealloc' as the newly created second half. 'split' indicates an
517 * prealloc: [orig->start, split - 1]
524 struct extent_state *prealloc, u64 split)
533 prealloc->start = orig->start;
534 prealloc->end = split - 1;
535 prealloc->state = orig->state;
546 if (prealloc->end < entry->start) {
548 } else if (prealloc->end > entry->end) {
551 free_extent_state(prealloc);
556 rb_link_node(&prealloc->rb_node, parent, node);
557 rb_insert_color(&prealloc->rb_node, &tree->state);
631 struct extent_state *prealloc = NULL;
653 if (!prealloc) {
661 prealloc = alloc_extent_state(mask);
716 prealloc = alloc_extent_state_atomic(prealloc);
717 if (!prealloc)
719 err = split_state(tree, state, prealloc, start);
723 prealloc = NULL;
738 prealloc = alloc_extent_state_atomic(prealloc);
739 if (!prealloc)
741 err = split_state(tree, state, prealloc, end + 1);
748 clear_state_bit(tree, prealloc, bits, wake, changeset);
750 prealloc = NULL;
772 if (prealloc)
773 free_extent_state(prealloc);
1059 struct extent_state *prealloc = NULL;
1077 if (!prealloc) {
1085 prealloc = alloc_extent_state(mask);
1101 prealloc = alloc_extent_state_atomic(prealloc);
1102 if (!prealloc)
1104 prealloc->start = start;
1105 prealloc->end = end;
1106 insert_state_fast(tree, prealloc, p, parent, bits, changeset);
1107 cache_state(prealloc, cached_state);
1108 prealloc = NULL;
1175 prealloc = alloc_extent_state_atomic(prealloc);
1176 if (!prealloc)
1178 err = split_state(tree, state, prealloc, start);
1182 prealloc = NULL;
1215 prealloc = alloc_extent_state_atomic(prealloc);
1216 if (!prealloc)
1220 * Avoid to free 'prealloc' if it can be merged with the later
1223 prealloc->start = start;
1224 prealloc->end = this_end;
1225 inserted_state = insert_state(tree, prealloc, bits, changeset);
1228 extent_io_tree_panic(tree, prealloc, "insert", err);
1232 if (inserted_state == prealloc)
1233 prealloc = NULL;
1251 prealloc = alloc_extent_state_atomic(prealloc);
1252 if (!prealloc)
1254 err = split_state(tree, state, prealloc, end + 1);
1258 set_state_bits(tree, prealloc, bits, changeset);
1259 cache_state(prealloc, cached_state);
1260 merge_state(tree, prealloc);
1261 prealloc = NULL;
1275 if (prealloc)
1276 free_extent_state(prealloc);
1312 struct extent_state *prealloc = NULL;
1325 if (!prealloc) {
1333 prealloc = alloc_extent_state(GFP_NOFS);
1334 if (!prealloc && !first_iteration)
1352 prealloc = alloc_extent_state_atomic(prealloc);
1353 if (!prealloc) {
1357 prealloc->start = start;
1358 prealloc->end = end;
1359 insert_state_fast(tree, prealloc, p, parent, bits, NULL);
1360 cache_state(prealloc, cached_state);
1361 prealloc = NULL;
1403 prealloc = alloc_extent_state_atomic(prealloc);
1404 if (!prealloc) {
1408 err = split_state(tree, state, prealloc, start);
1411 prealloc = NULL;
1443 prealloc = alloc_extent_state_atomic(prealloc);
1444 if (!prealloc) {
1450 * Avoid to free 'prealloc' if it can be merged with the later
1453 prealloc->start = start;
1454 prealloc->end = this_end;
1455 inserted_state = insert_state(tree, prealloc, bits, NULL);
1458 extent_io_tree_panic(tree, prealloc, "insert", err);
1461 if (inserted_state == prealloc)
1462 prealloc = NULL;
1473 prealloc = alloc_extent_state_atomic(prealloc);
1474 if (!prealloc) {
1479 err = split_state(tree, state, prealloc, end + 1);
1483 set_state_bits(tree, prealloc, bits, NULL);
1484 cache_state(prealloc, cached_state);
1485 clear_state_bit(tree, prealloc, clear_bits, 0, NULL);
1486 prealloc = NULL;
1500 if (prealloc)
1501 free_extent_state(prealloc);