Lines Matching full:space
5 #include "space-info.h"
8 #include "free-space-cache.h"
18 * HOW DOES SPACE RESERVATION WORK
26 * 1) space_info. This is the ultimate arbiter of how much space we can use.
30 * determining if there is space to make an allocation. There is a space_info
36 * much space is accounted for in space_info->bytes_may_use.
66 * enough space
77 * Flushes various things attempting to free up space.
80 * This is called by anything that either subtracts space from
84 * completed. If it can the space is added to space_info->bytes_may_use and
106 * reclaim space so we can make new reservations.
114 * metadata space.
117 * Look at the delalloc comment to get an idea of how much space is reserved
118 * for delayed allocation. We can reclaim some of this space simply by
120 * reclaim the bulk of this space.
123 * We have a block reserve for the outstanding delayed refs space, and every
125 * to reclaim space, but we want to hold this until the end because COW can
130 * We will skip this the first time through space reservation, because of
131 * overcommit and we don't want to have a lot of useless metadata space when
136 * items, and extent tree items. Loads of space could be freed up by these
151 * reserve more space than is currently free in the currently allocate
152 * metadata space. This only happens with metadata, data does not allow
156 * btrfs_can_overcommit(), but it only applies to unallocated space. If there
157 * is no unallocated space to be had, all reservations are kept within the
158 * free space in the allocated metadata chunks.
162 * thing with or without extra unallocated space.
176 * after adding space to the filesystem, we need to clear the full flags
177 * on all the space infos.
189 * Block groups with more than this value (percents) of unusable space will be
361 * space is actually usable. For raid56, the space info used in calc_available_free_space()
370 * 1/2th of the space. If we can flush, don't let us overcommit in calc_available_free_space()
371 * too much, let it overcommit up to 1/8 of the space. in calc_available_free_space()
410 * This is for space we already have accounted in space_info->bytes_may_use, so
411 * basically when we're returning space from block_rsv's.
492 /* The free space could be negative in case of overcommit */ in __btrfs_dump_space_info()
593 /* Calc the number of the pages we need flush for space reservation */ in shrink_delalloc()
618 * that likely won't give us the space back we need. in shrink_delalloc()
777 * bunch of pinned space, so make sure we run the iputs before in flush_space()
826 * We may be flushing because suddenly we have less space than we had in btrfs_calc_reclaim_metadata_size()
828 * space. If that's the case add in our overage so we make sure to put in btrfs_calc_reclaim_metadata_size()
876 * If we have over half of the free space occupied by reservations or in need_preemptive_reclaim()
887 * if our reclaimable space exceeds our clamped free space. in need_preemptive_reclaim()
918 * space before tickets need to wait for things to finish. In the case in need_preemptive_reclaim()
983 * @space_info - the space info we were flushing
1005 btrfs_info(fs_info, "cannot satisfy tickets, dumping space info"); in maybe_fail_all_tickets()
1097 * pretty hard to reclaim space. Think of the case where we in btrfs_async_reclaim_metadata_space()
1098 * freed up a bunch of space and so have a lot of pinned space in btrfs_async_reclaim_metadata_space()
1126 * This handles pre-flushing of metadata space before we get to the point that
1130 * watermark of space by flushing whichever reservation pool is currently the
1163 * out the block rsv's space from the bytes_may_use. If that in btrfs_preempt_reclaim_metadata_space()
1176 * because that's space we can't touch. Subtract it from the in btrfs_preempt_reclaim_metadata_space()
1227 * Space is freed from flushing delalloc in one of two ways.
1229 * 1) compression is on and we allocate less space than we reserved
1230 * 2) we are overwriting existing space
1232 * For #1 that extra space is reclaimed as soon as the delalloc pages are
1234 * length to ->bytes_reserved, and subtracts the reserved space from
1245 * thus have been truncated and freed up space. But again this space is not
1250 * This is where we reclaim all of the pinned space generated by running the
1256 * so if we now have space to allocate do the force chunk allocation.
1404 * turned into error mode due to a transaction abort when flushing space in priority_reclaim_metadata_space()
1421 * the available space. in priority_reclaim_metadata_space()
1468 * Delete us from the list. After we unlock the space in wait_reserve_ticket()
1470 * space for this ticket. If that would happen, then the in wait_reserve_ticket()
1471 * ticket's task would not known that space was reserved in wait_reserve_ticket()
1472 * despite getting an error, resulting in a space leak in wait_reserve_ticket()
1493 * @space_info: space info for the reservation
1539 * releasing reserved space (if an error happens the expectation is that in handle_reserve_ticket()
1540 * space wasn't reserved at all). in handle_reserve_ticket()
1568 * and freeing space, like there is with flushing delayed refs or in maybe_clamp_preempt()
1593 * Try to reserve bytes from the block_rsv's space.
1596 * @space_info: space info we want to allocate from
1600 * This will reserve orig_bytes number of bytes from the space info associated
1601 * with the block_rsv. If there is not enough space it will make an attempt to
1602 * flush out space to make room. It will do this by flushing delalloc if
1605 * space already.
1652 * Carry on if we have enough space (short-circuit) OR call in __reserve_bytes()
1665 * will let this reservation go through as long as we have actual space in __reserve_bytes()
1720 * We will do the space reservation dance during log replay, in __reserve_bytes()
1742 * Try to reserve metadata bytes from the block_rsv's space.
1749 * This will reserve orig_bytes number of bytes from the space info associated
1750 * with the block_rsv. If there is not enough space it will make an attempt to
1751 * flush out space to make room. It will do this by flushing delalloc if
1754 * space already.
1783 * This will reserve bytes from the data space info. If there is not enough
1784 * space then we will attempt to flush space as specified by flush.
1807 /* Dump all the space infos when we abort a transaction due to ENOSPC. */
1812 btrfs_info(fs_info, "dumping space info:"); in btrfs_dump_space_info_for_trans_abort()
1822 * Account the unused space of all the readonly block group in the space_info.