Lines Matching refs:prealloc

158 static struct extent_state *alloc_extent_state_atomic(struct extent_state *prealloc)  in alloc_extent_state_atomic()  argument
160 if (!prealloc) in alloc_extent_state_atomic()
161 prealloc = alloc_extent_state(GFP_ATOMIC); in alloc_extent_state_atomic()
163 return prealloc; in alloc_extent_state_atomic()
460 struct extent_state *prealloc, u64 split) in split_state() argument
468 prealloc->start = orig->start; in split_state()
469 prealloc->end = split - 1; in split_state()
470 prealloc->state = orig->state; in split_state()
481 if (prealloc->end < entry->start) { in split_state()
483 } else if (prealloc->end > entry->end) { in split_state()
486 free_extent_state(prealloc); in split_state()
491 rb_link_node(&prealloc->rb_node, parent, node); in split_state()
492 rb_insert_color(&prealloc->rb_node, &tree->state); in split_state()
555 struct extent_state *prealloc = NULL; in __clear_extent_bit() local
575 if (!prealloc && gfpflags_allow_blocking(mask)) { in __clear_extent_bit()
583 prealloc = alloc_extent_state(mask); in __clear_extent_bit()
638 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
639 BUG_ON(!prealloc); in __clear_extent_bit()
640 err = split_state(tree, state, prealloc, start); in __clear_extent_bit()
644 prealloc = NULL; in __clear_extent_bit()
659 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
660 BUG_ON(!prealloc); in __clear_extent_bit()
661 err = split_state(tree, state, prealloc, end + 1); in __clear_extent_bit()
668 clear_state_bit(tree, prealloc, bits, wake, changeset); in __clear_extent_bit()
670 prealloc = NULL; in __clear_extent_bit()
692 if (prealloc) in __clear_extent_bit()
693 free_extent_state(prealloc); in __clear_extent_bit()
953 struct extent_state *prealloc = NULL; in __set_extent_bit() local
969 if (!prealloc && gfpflags_allow_blocking(mask)) { in __set_extent_bit()
977 prealloc = alloc_extent_state(mask); in __set_extent_bit()
993 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
994 BUG_ON(!prealloc); in __set_extent_bit()
995 prealloc->start = start; in __set_extent_bit()
996 prealloc->end = end; in __set_extent_bit()
997 insert_state_fast(tree, prealloc, p, parent, bits, changeset); in __set_extent_bit()
998 cache_state(prealloc, cached_state); in __set_extent_bit()
999 prealloc = NULL; in __set_extent_bit()
1064 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1065 BUG_ON(!prealloc); in __set_extent_bit()
1066 err = split_state(tree, state, prealloc, start); in __set_extent_bit()
1070 prealloc = NULL; in __set_extent_bit()
1101 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1102 BUG_ON(!prealloc); in __set_extent_bit()
1108 prealloc->start = start; in __set_extent_bit()
1109 prealloc->end = this_end; in __set_extent_bit()
1110 err = insert_state(tree, prealloc, bits, changeset); in __set_extent_bit()
1114 cache_state(prealloc, cached_state); in __set_extent_bit()
1115 prealloc = NULL; in __set_extent_bit()
1132 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1133 BUG_ON(!prealloc); in __set_extent_bit()
1134 err = split_state(tree, state, prealloc, end + 1); in __set_extent_bit()
1138 set_state_bits(tree, prealloc, bits, changeset); in __set_extent_bit()
1139 cache_state(prealloc, cached_state); in __set_extent_bit()
1140 merge_state(tree, prealloc); in __set_extent_bit()
1141 prealloc = NULL; in __set_extent_bit()
1155 if (prealloc) in __set_extent_bit()
1156 free_extent_state(prealloc); in __set_extent_bit()
1192 struct extent_state *prealloc = NULL; in convert_extent_bit() local
1205 if (!prealloc) { in convert_extent_bit()
1213 prealloc = alloc_extent_state(GFP_NOFS); in convert_extent_bit()
1214 if (!prealloc && !first_iteration) in convert_extent_bit()
1232 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1233 if (!prealloc) { in convert_extent_bit()
1237 prealloc->start = start; in convert_extent_bit()
1238 prealloc->end = end; in convert_extent_bit()
1239 insert_state_fast(tree, prealloc, p, parent, bits, NULL); in convert_extent_bit()
1240 cache_state(prealloc, cached_state); in convert_extent_bit()
1241 prealloc = NULL; in convert_extent_bit()
1283 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1284 if (!prealloc) { in convert_extent_bit()
1288 err = split_state(tree, state, prealloc, start); in convert_extent_bit()
1291 prealloc = NULL; in convert_extent_bit()
1321 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1322 if (!prealloc) { in convert_extent_bit()
1331 prealloc->start = start; in convert_extent_bit()
1332 prealloc->end = this_end; in convert_extent_bit()
1333 err = insert_state(tree, prealloc, bits, NULL); in convert_extent_bit()
1336 cache_state(prealloc, cached_state); in convert_extent_bit()
1337 prealloc = NULL; in convert_extent_bit()
1348 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1349 if (!prealloc) { in convert_extent_bit()
1354 err = split_state(tree, state, prealloc, end + 1); in convert_extent_bit()
1358 set_state_bits(tree, prealloc, bits, NULL); in convert_extent_bit()
1359 cache_state(prealloc, cached_state); in convert_extent_bit()
1360 clear_state_bit(tree, prealloc, clear_bits, 0, NULL); in convert_extent_bit()
1361 prealloc = NULL; in convert_extent_bit()
1375 if (prealloc) in convert_extent_bit()
1376 free_extent_state(prealloc); in convert_extent_bit()