Lines Matching refs:num_bytes

11 				    struct btrfs_block_rsv *dest, u64 num_bytes,  in block_rsv_release_bytes()  argument
19 if (num_bytes == (u64)-1) { in block_rsv_release_bytes()
20 num_bytes = block_rsv->size; in block_rsv_release_bytes()
23 block_rsv->size -= num_bytes; in block_rsv_release_bytes()
25 num_bytes = block_rsv->reserved - block_rsv->size; in block_rsv_release_bytes()
29 num_bytes = 0; in block_rsv_release_bytes()
40 ret = num_bytes; in block_rsv_release_bytes()
41 if (num_bytes > 0) { in block_rsv_release_bytes()
48 bytes_to_add = min(num_bytes, bytes_to_add); in block_rsv_release_bytes()
52 num_bytes -= bytes_to_add; in block_rsv_release_bytes()
56 if (num_bytes) in block_rsv_release_bytes()
59 num_bytes); in block_rsv_release_bytes()
67 struct btrfs_block_rsv *dst, u64 num_bytes, in btrfs_block_rsv_migrate() argument
72 ret = btrfs_block_rsv_use_bytes(src, num_bytes); in btrfs_block_rsv_migrate()
76 btrfs_block_rsv_add_bytes(dst, num_bytes, update_size); in btrfs_block_rsv_migrate()
119 struct btrfs_block_rsv *block_rsv, u64 num_bytes, in btrfs_block_rsv_add() argument
124 if (num_bytes == 0) in btrfs_block_rsv_add()
127 ret = btrfs_reserve_metadata_bytes(root, block_rsv, num_bytes, flush); in btrfs_block_rsv_add()
129 btrfs_block_rsv_add_bytes(block_rsv, num_bytes, true); in btrfs_block_rsv_add()
136 u64 num_bytes = 0; in btrfs_block_rsv_check() local
143 num_bytes = div_factor(block_rsv->size, min_factor); in btrfs_block_rsv_check()
144 if (block_rsv->reserved >= num_bytes) in btrfs_block_rsv_check()
155 u64 num_bytes = 0; in btrfs_block_rsv_refill() local
162 num_bytes = min_reserved; in btrfs_block_rsv_refill()
163 if (block_rsv->reserved >= num_bytes) in btrfs_block_rsv_refill()
166 num_bytes -= block_rsv->reserved; in btrfs_block_rsv_refill()
172 ret = btrfs_reserve_metadata_bytes(root, block_rsv, num_bytes, flush); in btrfs_block_rsv_refill()
174 btrfs_block_rsv_add_bytes(block_rsv, num_bytes, false); in btrfs_block_rsv_refill()
183 u64 num_bytes, u64 *qgroup_to_release) in __btrfs_block_rsv_release() argument
201 return block_rsv_release_bytes(fs_info, block_rsv, target, num_bytes, in __btrfs_block_rsv_release()
205 int btrfs_block_rsv_use_bytes(struct btrfs_block_rsv *block_rsv, u64 num_bytes) in btrfs_block_rsv_use_bytes() argument
210 if (block_rsv->reserved >= num_bytes) { in btrfs_block_rsv_use_bytes()
211 block_rsv->reserved -= num_bytes; in btrfs_block_rsv_use_bytes()
221 u64 num_bytes, bool update_size) in btrfs_block_rsv_add_bytes() argument
224 block_rsv->reserved += num_bytes; in btrfs_block_rsv_add_bytes()
226 block_rsv->size += num_bytes; in btrfs_block_rsv_add_bytes()
233 struct btrfs_block_rsv *dest, u64 num_bytes, in btrfs_cond_migrate_bytes() argument
244 if (global_rsv->reserved < min_bytes + num_bytes) { in btrfs_cond_migrate_bytes()
248 global_rsv->reserved -= num_bytes; in btrfs_cond_migrate_bytes()
253 btrfs_block_rsv_add_bytes(dest, num_bytes, true); in btrfs_cond_migrate_bytes()
261 u64 num_bytes; in btrfs_update_global_block_rsv() local
269 num_bytes = btrfs_root_used(&fs_info->extent_root->root_item) + in btrfs_update_global_block_rsv()
290 num_bytes = max_t(u64, num_bytes, in btrfs_update_global_block_rsv()
296 block_rsv->size = min_t(u64, num_bytes, SZ_512M); in btrfs_update_global_block_rsv()
299 num_bytes = block_rsv->size - block_rsv->reserved; in btrfs_update_global_block_rsv()
300 block_rsv->reserved += num_bytes; in btrfs_update_global_block_rsv()
302 num_bytes); in btrfs_update_global_block_rsv()
304 num_bytes = block_rsv->reserved - block_rsv->size; in btrfs_update_global_block_rsv()
306 -num_bytes); in btrfs_update_global_block_rsv()