Lines Matching full:reserved
15 * reservations. Each block_rsv has a ->size and a ->reserved. ->size is
16 * how large we want our block rsv to be, ->reserved is how much space is
17 * currently reserved for this block reserve.
28 * ->reserved, and ->size in the case of btrfs_block_rsv_add.
38 * ->reserved has enough space for our tree block allocation. Once
39 * successful we subtract fs_info->nodesize from ->reserved.
45 * from ->size, and then subtract ->size from ->reserved and free up the
80 * ->reserved that may exist.
118 if (block_rsv->reserved >= block_rsv->size) { in block_rsv_release_bytes()
119 num_bytes = block_rsv->reserved - block_rsv->size; in block_rsv_release_bytes()
120 block_rsv->reserved = block_rsv->size; in block_rsv_release_bytes()
141 bytes_to_add = dest->size - dest->reserved; in block_rsv_release_bytes()
143 dest->reserved += bytes_to_add; in block_rsv_release_bytes()
144 if (dest->reserved >= dest->size) in block_rsv_release_bytes()
238 if (block_rsv->reserved >= num_bytes) in btrfs_block_rsv_check()
257 if (block_rsv->reserved >= num_bytes) in btrfs_block_rsv_refill()
260 num_bytes -= block_rsv->reserved; in btrfs_block_rsv_refill()
304 if (block_rsv->reserved >= num_bytes) { in btrfs_block_rsv_use_bytes()
305 block_rsv->reserved -= num_bytes; in btrfs_block_rsv_use_bytes()
306 if (block_rsv->reserved < block_rsv->size) in btrfs_block_rsv_use_bytes()
318 block_rsv->reserved += num_bytes; in btrfs_block_rsv_add_bytes()
321 else if (block_rsv->reserved >= block_rsv->size) in btrfs_block_rsv_add_bytes()
338 if (global_rsv->reserved < min_bytes + num_bytes) { in btrfs_cond_migrate_bytes()
342 global_rsv->reserved -= num_bytes; in btrfs_cond_migrate_bytes()
343 if (global_rsv->reserved < global_rsv->size) in btrfs_cond_migrate_bytes()
398 if (block_rsv->reserved < block_rsv->size) { in btrfs_update_global_block_rsv()
399 num_bytes = block_rsv->size - block_rsv->reserved; in btrfs_update_global_block_rsv()
402 block_rsv->reserved = block_rsv->size; in btrfs_update_global_block_rsv()
403 } else if (block_rsv->reserved > block_rsv->size) { in btrfs_update_global_block_rsv()
404 num_bytes = block_rsv->reserved - block_rsv->size; in btrfs_update_global_block_rsv()
407 block_rsv->reserved = block_rsv->size; in btrfs_update_global_block_rsv()
411 block_rsv->full = (block_rsv->reserved == block_rsv->size); in btrfs_update_global_block_rsv()
466 WARN_ON(fs_info->trans_block_rsv.reserved > 0); in btrfs_release_global_block_rsv()
468 WARN_ON(fs_info->chunk_block_rsv.reserved > 0); in btrfs_release_global_block_rsv()
470 WARN_ON(fs_info->delayed_block_rsv.reserved > 0); in btrfs_release_global_block_rsv()
471 WARN_ON(fs_info->delayed_refs_rsv.reserved > 0); in btrfs_release_global_block_rsv()