Lines Matching full:we
22 * 1) space_info. This is the ultimate arbiter of how much space we can use.
25 * reservations we care about total_bytes - SUM(space_info->bytes_) when
30 * metadata reservation we have. You can see the comment in the block_rsv
34 * 3) btrfs_calc*_size. These are the worst case calculations we used based
35 * on the number of items we will want to modify. We have one for changing
36 * items, and one for inserting new items. Generally we use these helpers to
42 * We call into either btrfs_reserve_data_bytes() or
43 * btrfs_reserve_metadata_bytes(), depending on which we're looking for, with
44 * num_bytes we want to reserve.
61 * Assume we are unable to simply make the reservation because we do not have
84 * Check if ->bytes == 0, if it does we got our reservation and we can carry
85 * on, if not return the appropriate error (ENOSPC, but can be EINTR if we
90 * Same as the above, except we add ourselves to the
91 * space_info->priority_tickets, and we do not use ticket->wait, we simply
97 * Generally speaking we will have two cases for each state, a "nice" state
98 * and a "ALL THE THINGS" state. In btrfs we delay a lot of work in order to
102 * reclaim space so we can make new reservations.
106 * for example, we would update the inode item at write time to update the
108 * isize or bytes. We keep these delayed items to coalesce these operations
114 * for delayed allocation. We can reclaim some of this space simply by
115 * running delalloc, but usually we need to wait for ordered extents to
119 * We have a block reserve for the outstanding delayed refs space, and every
121 * to reclaim space, but we want to hold this until the end because COW can
122 * churn a lot and we can avoid making some extent tree modifications if we
126 * We will skip this the first time through space reservation, because of
127 * overcommit and we don't want to have a lot of useless metadata space when
131 * If we're freeing inodes we're likely freeing checksums, file extent
136 * may_commit_transaction() is the ultimate arbiter on whether we commit the
137 * transaction or not. In order to avoid constantly churning we do all the
139 * However we need to take into account things like pinned space that would
140 * be freed, plus any delayed work we may not have gotten rid of in the case
145 * Because we hold so many reservations for metadata we will allow you to
150 * You can see the current logic for when we allow overcommit in
170 * after adding space to the filesystem, we need to clear the full flags
314 * If we have dup, raid1 or raid10 then only half of the free in calc_available_free_space()
316 * doesn't include the parity drive, so we don't have to in calc_available_free_space()
323 * If we aren't flushing all things, let us overcommit up to in calc_available_free_space()
324 * 1/2th of the space. If we can flush, don't let us overcommit in calc_available_free_space()
364 * This is for space we already have accounted in space_info->bytes_may_use, so
365 * basically when we're returning space from block_rsv's.
498 /* Calc the number of the pages we need flush for space reservation */ in shrink_delalloc()
503 * to_reclaim is set to however much metadata we need to in shrink_delalloc()
506 * make sure we're flushing enough delalloc to hopefully reclaim in shrink_delalloc()
527 * If we are doing more ordered than delalloc we need to just wait on in shrink_delalloc()
528 * ordered extents, otherwise we'll waste time trying to flush delalloc in shrink_delalloc()
529 * that likely won't give us the space back we need. in shrink_delalloc()
565 * @root - the root we're allocating for
566 * @bytes - the number of bytes we want to reserve
620 * we have block groups that are going to be freed, allowing us to in may_commit_transaction()
732 * If we have pending delayed iputs then we could free up a in flush_space()
733 * bunch of pinned space, so make sure we run the iputs before in flush_space()
734 * we do our pinned bytes check below. in flush_space()
768 * We may be flushing because suddenly we have less space than we had in btrfs_calc_reclaim_metadata_size()
769 * before, and now we're well over-committed based on our current free in btrfs_calc_reclaim_metadata_size()
770 * space. If that's the case add in our overage so we make sure to put in btrfs_calc_reclaim_metadata_size()
807 /* If we're just plain full then async reclaim just slows us down. */ in need_do_async_reclaim()
847 * maybe_fail_all_tickets - we've exhausted our flushing, start failing tickets
849 * @space_info - the space info we were flushing
851 * We call this when we've exhausted our flushing ability and haven't made
853 * order, so if there is a large ticket first and then smaller ones we could
885 * would result in the ticket succeeding. However if we have a in maybe_fail_all_tickets()
906 * We're just throwing tickets away, so more flushing may not in maybe_fail_all_tickets()
907 * trip over btrfs_try_granting_tickets, so we need to call it in maybe_fail_all_tickets()
908 * here to see if we can make progress with the next ticket in in maybe_fail_all_tickets()
917 * This is for normal flushers, we can wait all goddamned day if we want to. We
918 * will loop and continuously try to flush as long as we are making progress.
919 * We count progress as clearing off tickets each time we have to loop.
964 * We don't want to force a chunk allocation until we've tried in btrfs_async_reclaim_metadata_space()
965 * pretty hard to reclaim space. Think of the case where we in btrfs_async_reclaim_metadata_space()
967 * to reclaim. We would rather use that than possibly create a in btrfs_async_reclaim_metadata_space()
971 * around then we can force a chunk allocation. in btrfs_async_reclaim_metadata_space()
997 * 1) compression is on and we allocate less space than we reserved
998 * 2) we are overwriting existing space
1005 * For #2 this is trickier. Once the ordered extent runs we will drop the
1006 * extent in the range we are overwriting, which creates a delayed ref for
1011 * If we are freeing inodes, we want to make sure all delayed iputs have
1020 * reality if there are outstanding delayed refs. This is because we adjust
1022 * any on-disk state which might include more refs. So for example, if we
1023 * have an extent with 2 references, but we only drop 1, we'll see that there
1033 * This is where we reclaim all of the pinned space generated by the previous
1034 * two stages. We will not commit the transaction if we don't think we're
1036 * total_bytes_pinned < reservation we will not commit. This is why the
1037 * previous states are actually important, to make sure we know for sure
1041 * For data we start with alloc chunk force, however we could have been full
1043 * so if we now have space to allocate do the force chunk allocation.
1196 * Delete us from the list. After we unlock the space in wait_reserve_ticket()
1197 * info, we don't want the async reclaim job to reserve in wait_reserve_ticket()
1222 * @flush - how much we can flush
1262 * We were a priority ticket, so we need to delete ourselves in handle_reserve_ticket()
1263 * from the list. Because we could have other priority tickets in handle_reserve_ticket()
1279 * Check that we can't have an error set if the reservation succeeded, in handle_reserve_ticket()
1300 * @root - the root we're allocating for
1301 * @space_info - the space info we want to allocate from
1302 * @orig_bytes - the number of bytes we want
1303 * @flush - whether or not we can flush to make our reservation
1335 * We don't want NO_FLUSH allocations to jump everybody, they can in __reserve_bytes()
1346 * Carry on if we have enough space (short-circuit) OR call in __reserve_bytes()
1347 * can_overcommit() to ensure we can overcommit to continue. in __reserve_bytes()
1358 * If we couldn't make a reservation then setup our reservation ticket in __reserve_bytes()
1361 * If we are a priority flusher then we just need to add our ticket to in __reserve_bytes()
1362 * the list and we will do our own flushing further down. in __reserve_bytes()
1389 * We will do the space reservation dance during log replay, in __reserve_bytes()
1390 * which means we won't have fs_info->fs_root set, so don't do in __reserve_bytes()
1391 * the async reclaim as we will panic. in __reserve_bytes()
1411 * @root - the root we're allocating for
1412 * @block_rsv - the block_rsv we're allocating for
1413 * @orig_bytes - the number of bytes we want
1414 * @flush - whether or not we can flush to make our reservation
1454 * @bytes - the number of bytes we need
1455 * @flush - how we are allowed to flush
1458 * space then we will attempt to flush space as specified by flush.