Lines Matching refs:prealloc

183 static struct extent_state *alloc_extent_state_atomic(struct extent_state *prealloc)  in alloc_extent_state_atomic()  argument
185 if (!prealloc) in alloc_extent_state_atomic()
186 prealloc = alloc_extent_state(GFP_ATOMIC); in alloc_extent_state_atomic()
188 return prealloc; in alloc_extent_state_atomic()
525 struct extent_state *prealloc, u64 split) in split_state() argument
534 prealloc->start = orig->start; in split_state()
535 prealloc->end = split - 1; in split_state()
536 prealloc->state = orig->state; in split_state()
547 if (prealloc->end < entry->start) { in split_state()
549 } else if (prealloc->end > entry->end) { in split_state()
552 free_extent_state(prealloc); in split_state()
557 rb_link_node(&prealloc->rb_node, parent, node); in split_state()
558 rb_insert_color(&prealloc->rb_node, &tree->state); in split_state()
629 struct extent_state *prealloc = NULL; in __clear_extent_bit() local
651 if (!prealloc) { in __clear_extent_bit()
659 prealloc = alloc_extent_state(mask); in __clear_extent_bit()
714 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
715 if (!prealloc) in __clear_extent_bit()
717 err = split_state(tree, state, prealloc, start); in __clear_extent_bit()
721 prealloc = NULL; in __clear_extent_bit()
736 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
737 if (!prealloc) in __clear_extent_bit()
739 err = split_state(tree, state, prealloc, end + 1); in __clear_extent_bit()
746 clear_state_bit(tree, prealloc, bits, wake, changeset); in __clear_extent_bit()
748 prealloc = NULL; in __clear_extent_bit()
770 if (prealloc) in __clear_extent_bit()
771 free_extent_state(prealloc); in __clear_extent_bit()
1056 struct extent_state *prealloc = NULL; in __set_extent_bit() local
1074 if (!prealloc) { in __set_extent_bit()
1082 prealloc = alloc_extent_state(mask); in __set_extent_bit()
1101 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1102 if (!prealloc) in __set_extent_bit()
1104 prealloc->start = start; in __set_extent_bit()
1105 prealloc->end = end; in __set_extent_bit()
1106 insert_state_fast(tree, prealloc, p, parent, bits, changeset); in __set_extent_bit()
1107 cache_state(prealloc, cached_state); in __set_extent_bit()
1108 prealloc = NULL; in __set_extent_bit()
1175 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1176 if (!prealloc) in __set_extent_bit()
1178 ret = split_state(tree, state, prealloc, start); in __set_extent_bit()
1182 prealloc = NULL; in __set_extent_bit()
1215 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1216 if (!prealloc) in __set_extent_bit()
1223 prealloc->start = start; in __set_extent_bit()
1224 prealloc->end = this_end; in __set_extent_bit()
1225 inserted_state = insert_state(tree, prealloc, bits, changeset); in __set_extent_bit()
1228 extent_io_tree_panic(tree, prealloc, "insert", ret); in __set_extent_bit()
1232 if (inserted_state == prealloc) in __set_extent_bit()
1233 prealloc = NULL; in __set_extent_bit()
1251 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1252 if (!prealloc) in __set_extent_bit()
1254 ret = split_state(tree, state, prealloc, end + 1); in __set_extent_bit()
1258 set_state_bits(tree, prealloc, bits, changeset); in __set_extent_bit()
1259 cache_state(prealloc, cached_state); in __set_extent_bit()
1260 merge_state(tree, prealloc); in __set_extent_bit()
1261 prealloc = NULL; in __set_extent_bit()
1275 if (prealloc) in __set_extent_bit()
1276 free_extent_state(prealloc); in __set_extent_bit()
1312 struct extent_state *prealloc = NULL; in convert_extent_bit() local
1325 if (!prealloc) { in convert_extent_bit()
1333 prealloc = alloc_extent_state(GFP_NOFS); in convert_extent_bit()
1334 if (!prealloc && !first_iteration) in convert_extent_bit()
1352 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1353 if (!prealloc) { in convert_extent_bit()
1357 prealloc->start = start; in convert_extent_bit()
1358 prealloc->end = end; in convert_extent_bit()
1359 insert_state_fast(tree, prealloc, p, parent, bits, NULL); in convert_extent_bit()
1360 cache_state(prealloc, cached_state); in convert_extent_bit()
1361 prealloc = NULL; in convert_extent_bit()
1403 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1404 if (!prealloc) { in convert_extent_bit()
1408 ret = split_state(tree, state, prealloc, start); in convert_extent_bit()
1411 prealloc = NULL; in convert_extent_bit()
1443 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1444 if (!prealloc) { in convert_extent_bit()
1453 prealloc->start = start; in convert_extent_bit()
1454 prealloc->end = this_end; in convert_extent_bit()
1455 inserted_state = insert_state(tree, prealloc, bits, NULL); in convert_extent_bit()
1458 extent_io_tree_panic(tree, prealloc, "insert", ret); in convert_extent_bit()
1461 if (inserted_state == prealloc) in convert_extent_bit()
1462 prealloc = NULL; in convert_extent_bit()
1473 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1474 if (!prealloc) { in convert_extent_bit()
1479 ret = split_state(tree, state, prealloc, end + 1); in convert_extent_bit()
1483 set_state_bits(tree, prealloc, bits, NULL); in convert_extent_bit()
1484 cache_state(prealloc, cached_state); in convert_extent_bit()
1485 clear_state_bit(tree, prealloc, clear_bits, 0, NULL); in convert_extent_bit()
1486 prealloc = NULL; in convert_extent_bit()
1500 if (prealloc) in convert_extent_bit()
1501 free_extent_state(prealloc); in convert_extent_bit()