Lines Matching refs:prealloc
476 struct extent_state *prealloc, u64 split) in split_state() argument
482 prealloc->start = orig->start; in split_state()
483 prealloc->end = split - 1; in split_state()
484 prealloc->state = orig->state; in split_state()
487 node = tree_insert(&tree->state, &orig->rb_node, prealloc->end, in split_state()
488 &prealloc->rb_node, NULL, NULL); in split_state()
490 free_extent_state(prealloc); in split_state()
545 alloc_extent_state_atomic(struct extent_state *prealloc) in alloc_extent_state_atomic() argument
547 if (!prealloc) in alloc_extent_state_atomic()
548 prealloc = alloc_extent_state(GFP_ATOMIC); in alloc_extent_state_atomic()
550 return prealloc; in alloc_extent_state_atomic()
579 struct extent_state *prealloc = NULL; in clear_extent_bit() local
597 if (!prealloc && (mask & __GFP_WAIT)) { in clear_extent_bit()
605 prealloc = alloc_extent_state(mask); in clear_extent_bit()
664 prealloc = alloc_extent_state_atomic(prealloc); in clear_extent_bit()
665 BUG_ON(!prealloc); in clear_extent_bit()
666 err = split_state(tree, state, prealloc, start); in clear_extent_bit()
670 prealloc = NULL; in clear_extent_bit()
686 prealloc = alloc_extent_state_atomic(prealloc); in clear_extent_bit()
687 BUG_ON(!prealloc); in clear_extent_bit()
688 err = split_state(tree, state, prealloc, end + 1); in clear_extent_bit()
695 clear_state_bit(tree, prealloc, &bits, wake); in clear_extent_bit()
697 prealloc = NULL; in clear_extent_bit()
712 if (prealloc) in clear_extent_bit()
713 free_extent_state(prealloc); in clear_extent_bit()
841 struct extent_state *prealloc = NULL; in __set_extent_bit() local
853 if (!prealloc && (mask & __GFP_WAIT)) { in __set_extent_bit()
854 prealloc = alloc_extent_state(mask); in __set_extent_bit()
855 BUG_ON(!prealloc); in __set_extent_bit()
873 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
874 BUG_ON(!prealloc); in __set_extent_bit()
875 err = insert_state(tree, prealloc, start, end, in __set_extent_bit()
880 cache_state(prealloc, cached_state); in __set_extent_bit()
881 prealloc = NULL; in __set_extent_bit()
938 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
939 BUG_ON(!prealloc); in __set_extent_bit()
940 err = split_state(tree, state, prealloc, start); in __set_extent_bit()
944 prealloc = NULL; in __set_extent_bit()
975 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
976 BUG_ON(!prealloc); in __set_extent_bit()
982 err = insert_state(tree, prealloc, start, this_end, in __set_extent_bit()
987 cache_state(prealloc, cached_state); in __set_extent_bit()
988 prealloc = NULL; in __set_extent_bit()
1005 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1006 BUG_ON(!prealloc); in __set_extent_bit()
1007 err = split_state(tree, state, prealloc, end + 1); in __set_extent_bit()
1011 set_state_bits(tree, prealloc, &bits); in __set_extent_bit()
1012 cache_state(prealloc, cached_state); in __set_extent_bit()
1013 merge_state(tree, prealloc); in __set_extent_bit()
1014 prealloc = NULL; in __set_extent_bit()
1022 if (prealloc) in __set_extent_bit()
1023 free_extent_state(prealloc); in __set_extent_bit()
1067 struct extent_state *prealloc = NULL; in convert_extent_bit() local
1079 if (!prealloc && (mask & __GFP_WAIT)) { in convert_extent_bit()
1087 prealloc = alloc_extent_state(mask); in convert_extent_bit()
1088 if (!prealloc && !first_iteration) in convert_extent_bit()
1108 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1109 if (!prealloc) { in convert_extent_bit()
1113 err = insert_state(tree, prealloc, start, end, in convert_extent_bit()
1117 cache_state(prealloc, cached_state); in convert_extent_bit()
1118 prealloc = NULL; in convert_extent_bit()
1162 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1163 if (!prealloc) { in convert_extent_bit()
1167 err = split_state(tree, state, prealloc, start); in convert_extent_bit()
1170 prealloc = NULL; in convert_extent_bit()
1200 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1201 if (!prealloc) { in convert_extent_bit()
1210 err = insert_state(tree, prealloc, start, this_end, in convert_extent_bit()
1214 cache_state(prealloc, cached_state); in convert_extent_bit()
1215 prealloc = NULL; in convert_extent_bit()
1226 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1227 if (!prealloc) { in convert_extent_bit()
1232 err = split_state(tree, state, prealloc, end + 1); in convert_extent_bit()
1236 set_state_bits(tree, prealloc, &bits); in convert_extent_bit()
1237 cache_state(prealloc, cached_state); in convert_extent_bit()
1238 clear_state_bit(tree, prealloc, &clear_bits, 0); in convert_extent_bit()
1239 prealloc = NULL; in convert_extent_bit()
1247 if (prealloc) in convert_extent_bit()
1248 free_extent_state(prealloc); in convert_extent_bit()