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
147 * reserve more space than is currently free in the currently allocate
148 * metadata space. This only happens with metadata, data does not allow
152 * btrfs_can_overcommit(), but it only applies to unallocated space. If there
153 * is no unallocated space to be had, all reservations are kept within the
154 * free space in the allocated metadata chunks.
158 * thing with or without extra unallocated space.
172 * after adding space to the filesystem, we need to clear the full flags
173 * on all the space infos.
312 * space is actually usable. For raid56, the space info used in calc_available_free_space()
321 * 1/2th of the space. If we can flush, don't let us overcommit in calc_available_free_space()
322 * too much, let it overcommit up to 1/8 of the space. in calc_available_free_space()
361 * This is for space we already have accounted in space_info->bytes_may_use, so
362 * basically when we're returning space from block_rsv's.
417 /* The free space could be negative in case of overcommit */ in __btrfs_dump_space_info()
502 /* Calc the number of the pages we need flush for space reservation */ in shrink_delalloc()
527 * that likely won't give us the space back we need. in shrink_delalloc()
681 * bunch of pinned space, so make sure we run the iputs before in flush_space()
721 * We may be flushing because suddenly we have less space than we had in btrfs_calc_reclaim_metadata_size()
723 * space. If that's the case add in our overage so we make sure to put in btrfs_calc_reclaim_metadata_size()
767 * If we have over half of the free space occupied by reservations or in need_preemptive_reclaim()
778 * if our reclaimable space exceeds our clamped free space. in need_preemptive_reclaim()
809 * space before tickets need to wait for things to finish. In the case in need_preemptive_reclaim()
871 * @space_info - the space info we were flushing
892 btrfs_info(fs_info, "cannot satisfy tickets, dumping space info"); in maybe_fail_all_tickets()
981 * pretty hard to reclaim space. Think of the case where we in btrfs_async_reclaim_metadata_space()
982 * freed up a bunch of space and so have a lot of pinned space in btrfs_async_reclaim_metadata_space()
1010 * This handles pre-flushing of metadata space before we get to the point that
1014 * watermark of space by flushing whichever reservation pool is currently the
1047 * out the block rsv's space from the bytes_may_use. If that in btrfs_preempt_reclaim_metadata_space()
1061 * because that's space we can't touch. Subtract it from the in btrfs_preempt_reclaim_metadata_space()
1110 * Space is freed from flushing delalloc in one of two ways.
1112 * 1) compression is on and we allocate less space than we reserved
1113 * 2) we are overwriting existing space
1115 * For #1 that extra space is reclaimed as soon as the delalloc pages are
1117 * length to ->bytes_reserved, and subtracts the reserved space from
1128 * thus have been truncated and freed up space. But again this space is not
1133 * This is where we reclaim all of the pinned space generated by running the
1139 * so if we now have space to allocate do the force chunk allocation.
1295 * Delete us from the list. After we unlock the space in wait_reserve_ticket()
1297 * space for this ticket. If that would happen, then the in wait_reserve_ticket()
1298 * ticket's task would not known that space was reserved in wait_reserve_ticket()
1299 * despite getting an error, resulting in a space leak in wait_reserve_ticket()
1320 * @space_info: space info for the reservation
1367 * behind us that require less space, run in handle_reserve_ticket()
1384 * releasing reserved space (if an error happens the expectation is that in handle_reserve_ticket()
1385 * space wasn't reserved at all). in handle_reserve_ticket()
1413 * and freeing space, like there is with flushing delayed refs or in maybe_clamp_preempt()
1422 * Try to reserve bytes from the block_rsv's space
1425 * @space_info: space info we want to allocate from
1429 * This will reserve orig_bytes number of bytes from the space info associated
1430 * with the block_rsv. If there is not enough space it will make an attempt to
1431 * flush out space to make room. It will do this by flushing delalloc if
1434 * space already.
1471 * Carry on if we have enough space (short-circuit) OR call in __reserve_bytes()
1526 * We will do the space reservation dance during log replay, in __reserve_bytes()
1548 * Trye to reserve metadata bytes from the block_rsv's space
1555 * This will reserve orig_bytes number of bytes from the space info associated
1556 * with the block_rsv. If there is not enough space it will make an attempt to
1557 * flush out space to make room. It will do this by flushing delalloc if
1560 * space already.
1597 * This will reserve bytes from the data space info. If there is not enough
1598 * space then we will attempt to flush space as specified by flush.