Lines Matching refs:prealloc
602 struct extent_state *prealloc, u64 split) in split_state() argument
609 prealloc->start = orig->start; in split_state()
610 prealloc->end = split - 1; in split_state()
611 prealloc->state = orig->state; in split_state()
614 node = tree_insert(&tree->state, &orig->rb_node, prealloc->end, in split_state()
615 &prealloc->rb_node, NULL, NULL); in split_state()
617 free_extent_state(prealloc); in split_state()
679 alloc_extent_state_atomic(struct extent_state *prealloc) in alloc_extent_state_atomic() argument
681 if (!prealloc) in alloc_extent_state_atomic()
682 prealloc = alloc_extent_state(GFP_ATOMIC); in alloc_extent_state_atomic()
684 return prealloc; in alloc_extent_state_atomic()
712 struct extent_state *prealloc = NULL; in __clear_extent_bit() local
730 if (!prealloc && gfpflags_allow_blocking(mask)) { in __clear_extent_bit()
738 prealloc = alloc_extent_state(mask); in __clear_extent_bit()
797 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
798 BUG_ON(!prealloc); in __clear_extent_bit()
799 err = split_state(tree, state, prealloc, start); in __clear_extent_bit()
803 prealloc = NULL; in __clear_extent_bit()
820 prealloc = alloc_extent_state_atomic(prealloc); in __clear_extent_bit()
821 BUG_ON(!prealloc); in __clear_extent_bit()
822 err = split_state(tree, state, prealloc, end + 1); in __clear_extent_bit()
829 clear_state_bit(tree, prealloc, &bits, wake, changeset); in __clear_extent_bit()
831 prealloc = NULL; in __clear_extent_bit()
853 if (prealloc) in __clear_extent_bit()
854 free_extent_state(prealloc); in __clear_extent_bit()
978 struct extent_state *prealloc = NULL; in set_extent_bit() local
994 if (!prealloc && gfpflags_allow_blocking(mask)) { in set_extent_bit()
1002 prealloc = alloc_extent_state(mask); in set_extent_bit()
1020 prealloc = alloc_extent_state_atomic(prealloc); in set_extent_bit()
1021 BUG_ON(!prealloc); in set_extent_bit()
1022 err = insert_state(tree, prealloc, start, end, in set_extent_bit()
1027 cache_state(prealloc, cached_state); in set_extent_bit()
1028 prealloc = NULL; in set_extent_bit()
1095 prealloc = alloc_extent_state_atomic(prealloc); in set_extent_bit()
1096 BUG_ON(!prealloc); in set_extent_bit()
1097 err = split_state(tree, state, prealloc, start); in set_extent_bit()
1101 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()
1139 err = insert_state(tree, prealloc, start, this_end, in set_extent_bit()
1144 cache_state(prealloc, cached_state); in set_extent_bit()
1145 prealloc = NULL; in set_extent_bit()
1162 prealloc = alloc_extent_state_atomic(prealloc); in set_extent_bit()
1163 BUG_ON(!prealloc); in set_extent_bit()
1164 err = split_state(tree, state, prealloc, end + 1); in set_extent_bit()
1168 set_state_bits(tree, prealloc, &bits, changeset); in set_extent_bit()
1169 cache_state(prealloc, cached_state); in set_extent_bit()
1170 merge_state(tree, prealloc); in set_extent_bit()
1171 prealloc = NULL; in set_extent_bit()
1185 if (prealloc) in set_extent_bit()
1186 free_extent_state(prealloc); in set_extent_bit()
1215 struct extent_state *prealloc = NULL; in convert_extent_bit() local
1229 if (!prealloc) { in convert_extent_bit()
1237 prealloc = alloc_extent_state(GFP_NOFS); in convert_extent_bit()
1238 if (!prealloc && !first_iteration) in convert_extent_bit()
1258 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1259 if (!prealloc) { in convert_extent_bit()
1263 err = insert_state(tree, prealloc, start, end, in convert_extent_bit()
1267 cache_state(prealloc, cached_state); in convert_extent_bit()
1268 prealloc = NULL; in convert_extent_bit()
1312 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1313 if (!prealloc) { in convert_extent_bit()
1317 err = split_state(tree, state, prealloc, start); in convert_extent_bit()
1320 prealloc = NULL; in convert_extent_bit()
1351 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1352 if (!prealloc) { in convert_extent_bit()
1361 err = insert_state(tree, prealloc, start, this_end, in convert_extent_bit()
1365 cache_state(prealloc, cached_state); in convert_extent_bit()
1366 prealloc = NULL; in convert_extent_bit()
1377 prealloc = alloc_extent_state_atomic(prealloc); in convert_extent_bit()
1378 if (!prealloc) { in convert_extent_bit()
1383 err = split_state(tree, state, prealloc, end + 1); in convert_extent_bit()
1387 set_state_bits(tree, prealloc, &bits, NULL); in convert_extent_bit()
1388 cache_state(prealloc, cached_state); in convert_extent_bit()
1389 clear_state_bit(tree, prealloc, &clear_bits, 0, NULL); in convert_extent_bit()
1390 prealloc = NULL; in convert_extent_bit()
1404 if (prealloc) in convert_extent_bit()
1405 free_extent_state(prealloc); in convert_extent_bit()
3452 struct btrfs_subpage *prealloc) in attach_extent_buffer_page() argument
3476 btrfs_free_subpage(prealloc); in attach_extent_buffer_page()
3480 if (prealloc) in attach_extent_buffer_page()
3482 attach_page_private(page, prealloc); in attach_extent_buffer_page()
6201 struct btrfs_subpage *prealloc = NULL; in alloc_extent_buffer() local
6220 prealloc = btrfs_alloc_subpage(fs_info, BTRFS_SUBPAGE_METADATA); in alloc_extent_buffer()
6221 if (IS_ERR(prealloc)) { in alloc_extent_buffer()
6222 ret = PTR_ERR(prealloc); in alloc_extent_buffer()
6237 btrfs_free_subpage(prealloc); in alloc_extent_buffer()
6241 ret = attach_extent_buffer_page(eb, p, prealloc); in alloc_extent_buffer()