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.
497 /* Calc the number of the pages we need flush for space reservation */ in shrink_delalloc()
502 * to_reclaim is set to however much metadata we need to in shrink_delalloc()
505 * make sure we're flushing enough delalloc to hopefully reclaim in shrink_delalloc()
526 * If we are doing more ordered than delalloc we need to just wait on in shrink_delalloc()
527 * ordered extents, otherwise we'll waste time trying to flush delalloc in shrink_delalloc()
528 * that likely won't give us the space back we need. in shrink_delalloc()
562 * @root - the root we're allocating for
563 * @bytes - the number of bytes we want to reserve
617 * we have block groups that are going to be freed, allowing us to in may_commit_transaction()
729 * If we have pending delayed iputs then we could free up a in flush_space()
730 * bunch of pinned space, so make sure we run the iputs before in flush_space()
731 * we do our pinned bytes check below. in flush_space()
765 * We may be flushing because suddenly we have less space than we had in btrfs_calc_reclaim_metadata_size()
766 * before, and now we're well over-committed based on our current free in btrfs_calc_reclaim_metadata_size()
767 * space. If that's the case add in our overage so we make sure to put in btrfs_calc_reclaim_metadata_size()
804 /* If we're just plain full then async reclaim just slows us down. */ in need_do_async_reclaim()
844 * maybe_fail_all_tickets - we've exhausted our flushing, start failing tickets
846 * @space_info - the space info we were flushing
848 * We call this when we've exhausted our flushing ability and haven't made
850 * order, so if there is a large ticket first and then smaller ones we could
882 * would result in the ticket succeeding. However if we have a in maybe_fail_all_tickets()
903 * We're just throwing tickets away, so more flushing may not in maybe_fail_all_tickets()
904 * trip over btrfs_try_granting_tickets, so we need to call it in maybe_fail_all_tickets()
905 * here to see if we can make progress with the next ticket in in maybe_fail_all_tickets()
914 * This is for normal flushers, we can wait all goddamned day if we want to. We
915 * will loop and continuously try to flush as long as we are making progress.
916 * We count progress as clearing off tickets each time we have to loop.
961 * We don't want to force a chunk allocation until we've tried in btrfs_async_reclaim_metadata_space()
962 * pretty hard to reclaim space. Think of the case where we in btrfs_async_reclaim_metadata_space()
964 * to reclaim. We would rather use that than possibly create a in btrfs_async_reclaim_metadata_space()
968 * around then we can force a chunk allocation. in btrfs_async_reclaim_metadata_space()
994 * 1) compression is on and we allocate less space than we reserved
995 * 2) we are overwriting existing space
1002 * For #2 this is trickier. Once the ordered extent runs we will drop the
1003 * extent in the range we are overwriting, which creates a delayed ref for
1008 * If we are freeing inodes, we want to make sure all delayed iputs have
1017 * reality if there are outstanding delayed refs. This is because we adjust
1019 * any on-disk state which might include more refs. So for example, if we
1020 * have an extent with 2 references, but we only drop 1, we'll see that there
1030 * This is where we reclaim all of the pinned space generated by the previous
1031 * two stages. We will not commit the transaction if we don't think we're
1033 * total_bytes_pinned < reservation we will not commit. This is why the
1034 * previous states are actually important, to make sure we know for sure
1038 * For data we start with alloc chunk force, however we could have been full
1040 * so if we now have space to allocate do the force chunk allocation.
1193 * Delete us from the list. After we unlock the space in wait_reserve_ticket()
1194 * info, we don't want the async reclaim job to reserve in wait_reserve_ticket()
1219 * @flush - how much we can flush
1259 * We were a priority ticket, so we need to delete ourselves in handle_reserve_ticket()
1260 * from the list. Because we could have other priority tickets in handle_reserve_ticket()
1276 * Check that we can't have an error set if the reservation succeeded, in handle_reserve_ticket()
1297 * @root - the root we're allocating for
1298 * @space_info - the space info we want to allocate from
1299 * @orig_bytes - the number of bytes we want
1300 * @flush - whether or not we can flush to make our reservation
1332 * We don't want NO_FLUSH allocations to jump everybody, they can in __reserve_bytes()
1343 * Carry on if we have enough space (short-circuit) OR call in __reserve_bytes()
1344 * can_overcommit() to ensure we can overcommit to continue. in __reserve_bytes()
1355 * If we couldn't make a reservation then setup our reservation ticket in __reserve_bytes()
1358 * If we are a priority flusher then we just need to add our ticket to in __reserve_bytes()
1359 * the list and we will do our own flushing further down. in __reserve_bytes()
1386 * We will do the space reservation dance during log replay, in __reserve_bytes()
1387 * which means we won't have fs_info->fs_root set, so don't do in __reserve_bytes()
1388 * the async reclaim as we will panic. in __reserve_bytes()
1408 * @root - the root we're allocating for
1409 * @block_rsv - the block_rsv we're allocating for
1410 * @orig_bytes - the number of bytes we want
1411 * @flush - whether or not we can flush to make our reservation
1451 * @bytes - the number of bytes we need
1452 * @flush - how we are allowed to flush
1455 * space then we will attempt to flush space as specified by flush.