Lines Matching refs:prealloc
158 static struct extent_state *alloc_extent_state_atomic(struct extent_state *prealloc)
160 if (!prealloc)
161 prealloc = alloc_extent_state(GFP_ATOMIC);
163 return prealloc;
445 * struct 'prealloc' as the newly created second half. 'split' indicates an
451 * prealloc: [orig->start, split - 1]
458 struct extent_state *prealloc, u64 split)
466 prealloc->start = orig->start;
467 prealloc->end = split - 1;
468 prealloc->state = orig->state;
479 if (prealloc->end < entry->start) {
481 } else if (prealloc->end > entry->end) {
484 free_extent_state(prealloc);
489 rb_link_node(&prealloc->rb_node, parent, node);
490 rb_insert_color(&prealloc->rb_node, &tree->state);
563 struct extent_state *prealloc = NULL;
585 if (!prealloc) {
593 prealloc = alloc_extent_state(mask);
648 prealloc = alloc_extent_state_atomic(prealloc);
649 if (!prealloc)
651 err = split_state(tree, state, prealloc, start);
655 prealloc = NULL;
670 prealloc = alloc_extent_state_atomic(prealloc);
671 if (!prealloc)
673 err = split_state(tree, state, prealloc, end + 1);
680 clear_state_bit(tree, prealloc, bits, wake, changeset);
682 prealloc = NULL;
704 if (prealloc)
705 free_extent_state(prealloc);
987 struct extent_state *prealloc = NULL;
1005 if (!prealloc) {
1013 prealloc = alloc_extent_state(mask);
1029 prealloc = alloc_extent_state_atomic(prealloc);
1030 if (!prealloc)
1032 prealloc->start = start;
1033 prealloc->end = end;
1034 insert_state_fast(tree, prealloc, p, parent, bits, changeset);
1035 cache_state(prealloc, cached_state);
1036 prealloc = NULL;
1103 prealloc = alloc_extent_state_atomic(prealloc);
1104 if (!prealloc)
1106 err = split_state(tree, state, prealloc, start);
1110 prealloc = NULL;
1141 prealloc = alloc_extent_state_atomic(prealloc);
1142 if (!prealloc)
1146 * Avoid to free 'prealloc' if it can be merged with the later
1149 prealloc->start = start;
1150 prealloc->end = this_end;
1151 err = insert_state(tree, prealloc, bits, changeset);
1155 cache_state(prealloc, cached_state);
1156 prealloc = NULL;
1174 prealloc = alloc_extent_state_atomic(prealloc);
1175 if (!prealloc)
1177 err = split_state(tree, state, prealloc, end + 1);
1181 set_state_bits(tree, prealloc, bits, changeset);
1182 cache_state(prealloc, cached_state);
1183 merge_state(tree, prealloc);
1184 prealloc = NULL;
1198 if (prealloc)
1199 free_extent_state(prealloc);
1235 struct extent_state *prealloc = NULL;
1248 if (!prealloc) {
1256 prealloc = alloc_extent_state(GFP_NOFS);
1257 if (!prealloc && !first_iteration)
1275 prealloc = alloc_extent_state_atomic(prealloc);
1276 if (!prealloc) {
1280 prealloc->start = start;
1281 prealloc->end = end;
1282 insert_state_fast(tree, prealloc, p, parent, bits, NULL);
1283 cache_state(prealloc, cached_state);
1284 prealloc = NULL;
1326 prealloc = alloc_extent_state_atomic(prealloc);
1327 if (!prealloc) {
1331 err = split_state(tree, state, prealloc, start);
1334 prealloc = NULL;
1364 prealloc = alloc_extent_state_atomic(prealloc);
1365 if (!prealloc) {
1371 * Avoid to free 'prealloc' if it can be merged with the later
1374 prealloc->start = start;
1375 prealloc->end = this_end;
1376 err = insert_state(tree, prealloc, bits, NULL);
1379 cache_state(prealloc, cached_state);
1380 prealloc = NULL;
1391 prealloc = alloc_extent_state_atomic(prealloc);
1392 if (!prealloc) {
1397 err = split_state(tree, state, prealloc, end + 1);
1401 set_state_bits(tree, prealloc, bits, NULL);
1402 cache_state(prealloc, cached_state);
1403 clear_state_bit(tree, prealloc, clear_bits, 0, NULL);
1404 prealloc = NULL;
1418 if (prealloc)
1419 free_extent_state(prealloc);