Lines Matching refs:prealloc
592 struct extent_state *prealloc, u64 split) in split_state() argument
599 prealloc->start = orig->start; in split_state()
600 prealloc->end = split - 1; in split_state()
601 prealloc->state = orig->state; in split_state()
604 node = tree_insert(&tree->state, &orig->rb_node, prealloc->end, in split_state()
605 &prealloc->rb_node, NULL, NULL); in split_state()
607 free_extent_state(prealloc); in split_state()
669 alloc_extent_state_atomic(struct extent_state *prealloc) in alloc_extent_state_atomic() argument
671 if (!prealloc) in alloc_extent_state_atomic()
672 prealloc = alloc_extent_state(GFP_ATOMIC); in alloc_extent_state_atomic()
674 return prealloc; in alloc_extent_state_atomic()
702 struct extent_state *prealloc = NULL; in __clear_extent_bit() local
720 if (!prealloc && gfpflags_allow_blocking(mask)) { in __clear_extent_bit()
728 prealloc = alloc_extent_state(mask); in __clear_extent_bit()
787 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
788 BUG_ON(!prealloc); in __clear_extent_bit()
789 err = split_state(tree, state, prealloc, start); in __clear_extent_bit()
793 prealloc = NULL; in __clear_extent_bit()
810 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
811 BUG_ON(!prealloc); in __clear_extent_bit()
812 err = split_state(tree, state, prealloc, end + 1); in __clear_extent_bit()
819 clear_state_bit(tree, prealloc, &bits, wake, changeset); in __clear_extent_bit()
821 prealloc = NULL; in __clear_extent_bit()
843 if (prealloc) in __clear_extent_bit()
844 free_extent_state(prealloc); in __clear_extent_bit()
970 struct extent_state *prealloc = NULL; in __set_extent_bit() local
982 if (!prealloc && gfpflags_allow_blocking(mask)) { in __set_extent_bit()
990 prealloc = alloc_extent_state(mask); in __set_extent_bit()
1008 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1009 BUG_ON(!prealloc); in __set_extent_bit()
1010 err = insert_state(tree, prealloc, start, end, in __set_extent_bit()
1015 cache_state(prealloc, cached_state); in __set_extent_bit()
1016 prealloc = NULL; in __set_extent_bit()
1083 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1084 BUG_ON(!prealloc); in __set_extent_bit()
1085 err = split_state(tree, state, prealloc, start); in __set_extent_bit()
1089 prealloc = NULL; in __set_extent_bit()
1120 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1121 BUG_ON(!prealloc); in __set_extent_bit()
1127 err = insert_state(tree, prealloc, start, this_end, in __set_extent_bit()
1132 cache_state(prealloc, cached_state); in __set_extent_bit()
1133 prealloc = NULL; in __set_extent_bit()
1150 prealloc = alloc_extent_state_atomic(prealloc); in __set_extent_bit()
1151 BUG_ON(!prealloc); in __set_extent_bit()
1152 err = split_state(tree, state, prealloc, end + 1); in __set_extent_bit()
1156 set_state_bits(tree, prealloc, &bits, changeset); in __set_extent_bit()
1157 cache_state(prealloc, cached_state); in __set_extent_bit()
1158 merge_state(tree, prealloc); in __set_extent_bit()
1159 prealloc = NULL; in __set_extent_bit()
1173 if (prealloc) in __set_extent_bit()
1174 free_extent_state(prealloc); in __set_extent_bit()
1212 struct extent_state *prealloc = NULL; in convert_extent_bit() local
1226 if (!prealloc) { in convert_extent_bit()
1234 prealloc = alloc_extent_state(GFP_NOFS); in convert_extent_bit()
1235 if (!prealloc && !first_iteration) in convert_extent_bit()
1255 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1256 if (!prealloc) { in convert_extent_bit()
1260 err = insert_state(tree, prealloc, start, end, in convert_extent_bit()
1264 cache_state(prealloc, cached_state); in convert_extent_bit()
1265 prealloc = NULL; in convert_extent_bit()
1309 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1310 if (!prealloc) { in convert_extent_bit()
1314 err = split_state(tree, state, prealloc, start); in convert_extent_bit()
1317 prealloc = NULL; in convert_extent_bit()
1348 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1349 if (!prealloc) { in convert_extent_bit()
1358 err = insert_state(tree, prealloc, start, this_end, in convert_extent_bit()
1362 cache_state(prealloc, cached_state); in convert_extent_bit()
1363 prealloc = NULL; in convert_extent_bit()
1374 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1375 if (!prealloc) { in convert_extent_bit()
1380 err = split_state(tree, state, prealloc, end + 1); in convert_extent_bit()
1384 set_state_bits(tree, prealloc, &bits, NULL); in convert_extent_bit()
1385 cache_state(prealloc, cached_state); in convert_extent_bit()
1386 clear_state_bit(tree, prealloc, &clear_bits, 0, NULL); in convert_extent_bit()
1387 prealloc = NULL; in convert_extent_bit()
1401 if (prealloc) in convert_extent_bit()
1402 free_extent_state(prealloc); in convert_extent_bit()