Lines Matching full:reserved
14 * reservations. Each block_rsv has a ->size and a ->reserved. ->size is
15 * how large we want our block rsv to be, ->reserved is how much space is
16 * currently reserved for this block reserve.
27 * ->reserved, and ->size in the case of btrfs_block_rsv_add.
37 * ->reserved has enough space for our tree block allocation. Once
38 * successful we subtract fs_info->nodesize from ->reserved.
44 * from ->size, and then subtract ->size from ->reserved and free up the
79 * ->reserved that may exist.
117 if (block_rsv->reserved >= block_rsv->size) { in block_rsv_release_bytes()
118 num_bytes = block_rsv->reserved - block_rsv->size; in block_rsv_release_bytes()
119 block_rsv->reserved = block_rsv->size; in block_rsv_release_bytes()
140 bytes_to_add = dest->size - dest->reserved; in block_rsv_release_bytes()
142 dest->reserved += bytes_to_add; in block_rsv_release_bytes()
143 if (dest->reserved >= dest->size) in block_rsv_release_bytes()
237 if (block_rsv->reserved >= num_bytes) in btrfs_block_rsv_check()
256 if (block_rsv->reserved >= num_bytes) in btrfs_block_rsv_refill()
259 num_bytes -= block_rsv->reserved; in btrfs_block_rsv_refill()
303 if (block_rsv->reserved >= num_bytes) { in btrfs_block_rsv_use_bytes()
304 block_rsv->reserved -= num_bytes; in btrfs_block_rsv_use_bytes()
305 if (block_rsv->reserved < block_rsv->size) in btrfs_block_rsv_use_bytes()
317 block_rsv->reserved += num_bytes; in btrfs_block_rsv_add_bytes()
320 else if (block_rsv->reserved >= block_rsv->size) in btrfs_block_rsv_add_bytes()
337 if (global_rsv->reserved < min_bytes + num_bytes) { in btrfs_cond_migrate_bytes()
341 global_rsv->reserved -= num_bytes; in btrfs_cond_migrate_bytes()
342 if (global_rsv->reserved < global_rsv->size) in btrfs_cond_migrate_bytes()
391 if (block_rsv->reserved < block_rsv->size) { in btrfs_update_global_block_rsv()
392 num_bytes = block_rsv->size - block_rsv->reserved; in btrfs_update_global_block_rsv()
395 block_rsv->reserved = block_rsv->size; in btrfs_update_global_block_rsv()
396 } else if (block_rsv->reserved > block_rsv->size) { in btrfs_update_global_block_rsv()
397 num_bytes = block_rsv->reserved - block_rsv->size; in btrfs_update_global_block_rsv()
400 block_rsv->reserved = block_rsv->size; in btrfs_update_global_block_rsv()
404 if (block_rsv->reserved == block_rsv->size) in btrfs_update_global_block_rsv()
445 WARN_ON(fs_info->trans_block_rsv.reserved > 0); in btrfs_release_global_block_rsv()
447 WARN_ON(fs_info->chunk_block_rsv.reserved > 0); in btrfs_release_global_block_rsv()
449 WARN_ON(fs_info->delayed_block_rsv.reserved > 0); in btrfs_release_global_block_rsv()
450 WARN_ON(fs_info->delayed_refs_rsv.reserved > 0); in btrfs_release_global_block_rsv()