Lines Matching full:space
5 #include "space-info.h"
8 #include "free-space-cache.h"
14 * HOW DOES SPACE RESERVATION WORK
22 * 1) space_info. This is the ultimate arbiter of how much space we can use.
26 * determining if there is space to make an allocation. There is a space_info
32 * much space is accounted for in space_info->bytes_may_use.
62 * enough space
73 * Flushes various things attempting to free up space.
76 * This is called by anything that either subtracts space from
80 * completed. If it can the space is added to space_info->bytes_may_use and
102 * reclaim space so we can make new reservations.
110 * metadata space.
113 * Look at the delalloc comment to get an idea of how much space is reserved
114 * for delayed allocation. We can reclaim some of this space simply by
116 * reclaim the bulk of this space.
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
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
132 * items, and extent tree items. Loads of space could be freed up by these
139 * However we need to take into account things like pinned space that would
146 * reserve more space than is currently free in the currently allocate
147 * metadata space. This only happens with metadata, data does not allow
151 * btrfs_can_overcommit(), but it only applies to unallocated space. If there
152 * is no unallocated space to be had, all reservations are kept within the
153 * free space in the allocated metadata chunks.
157 * thing with or without extra unallocated space.
170 * after adding space to the filesystem, we need to clear the full flags
171 * on all the space infos.
315 * space is actually usable. For raid56, the space info used 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()
325 * too much, let it overcommit up to 1/8 of the space. 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()
528 * that likely won't give us the space back we need. in shrink_delalloc()
616 * See if there is enough pinned space to make this reservation, or if in may_commit_transaction()
627 * See if there is some space in the delayed insertion reserve for this in may_commit_transaction()
629 * SYSTEM) then just go enospc, reclaiming this space won't recover any in may_commit_transaction()
630 * space to satisfy those reservations. in may_commit_transaction()
730 * bunch of pinned space, so make sure we run the iputs before in flush_space()
765 * We may be flushing because suddenly we have less space than we had 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()
846 * @space_info - the space info we were flushing
866 btrfs_info(fs_info, "cannot satisfy tickets, dumping space info"); in maybe_fail_all_tickets()
881 * if it doesn't feel like the space reclaimed by the commit in maybe_fail_all_tickets()
962 * pretty hard to reclaim space. Think of the case where we in btrfs_async_reclaim_metadata_space()
963 * freed up a bunch of space and so have a lot of pinned space in btrfs_async_reclaim_metadata_space()
992 * Space is freed from flushing delalloc in one of two ways.
994 * 1) compression is on and we allocate less space than we reserved
995 * 2) we are overwriting existing space
997 * For #1 that extra space is reclaimed as soon as the delalloc pages are
999 * length to ->bytes_reserved, and subtracts the reserved space from
1010 * thus have been truncated and freed up space. But again this space is not
1021 * is a negative delayed ref count for the extent and assume that the space
1026 * space for us, it just makes sure that may_commit_transaction() has all of
1030 * This is where we reclaim all of the pinned space generated by the previous
1032 * likely to satisfy our request, which means if our current free space +
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()
1195 * space for this ticket. If that would happen, then the in wait_reserve_ticket()
1196 * ticket's task would not known that space was reserved in wait_reserve_ticket()
1197 * despite getting an error, resulting in a space leak in wait_reserve_ticket()
1261 * behind us that require less space, run in handle_reserve_ticket()
1278 * releasing reserved space (if an error happens the expectation is that in handle_reserve_ticket()
1279 * space wasn't reserved at all). in handle_reserve_ticket()
1296 * reserve_metadata_bytes - try to reserve bytes from the block_rsv's space
1298 * @space_info - the space info we want to allocate from
1302 * This will reserve orig_bytes number of bytes from the space info associated
1303 * with the block_rsv. If there is not enough space it will make an attempt to
1304 * flush out space to make room. It will do this by flushing delalloc if
1307 * space already.
1343 * Carry on if we have enough space (short-circuit) OR call in __reserve_bytes()
1386 * We will do the space reservation dance during log replay, in __reserve_bytes()
1407 * reserve_metadata_bytes - try to reserve bytes from the block_rsv's space
1413 * This will reserve orig_bytes number of bytes from the space info associated
1414 * with the block_rsv. If there is not enough space it will make an attempt to
1415 * flush out space to make room. It will do this by flushing delalloc if
1418 * space already.
1454 * This will reserve bytes from the data space info. If there is not enough
1455 * space then we will attempt to flush space as specified by flush.