Lines Matching refs:flush
70 * the tail of space_info->tickets, kick async flush thread
346 enum btrfs_reserve_flush_enum flush)
370 * 1/2th of the space. If we can flush, don't let us overcommit
373 if (flush == BTRFS_RESERVE_FLUSH_ALL)
382 enum btrfs_reserve_flush_enum flush)
392 avail = calc_available_free_space(fs_info, space_info, flush);
417 enum btrfs_reserve_flush_enum flush = BTRFS_RESERVE_NO_FLUSH;
432 flush)) {
447 flush = BTRFS_RESERVE_FLUSH_ALL;
593 /* Calc the number of the pages we need flush for space reservation */
606 * it's not enough subsequent flush stages will be more
617 * ordered extents, otherwise we'll waste time trying to flush delalloc
703 * Try to flush some data based on policy set by @state. This is only advisory
856 /* The total flushable belongs to the global rsv, don't flush. */
935 * flushing when we could still have several gigs of delalloc to flush.
1042 * will loop and continuously try to flush as long as we are making progress.
1060 space_info->flush = 0;
1072 space_info->flush = 0;
1115 space_info->flush = 0;
1128 * from the other flush paths because it doesn't rely on tickets to tell us how
1129 * much we need to flush, instead it attempts to keep us below the 80% full
1153 enum btrfs_flush_state flush;
1183 * could result in poor allocation patterns, so only flush it if
1188 flush = FLUSH_DELALLOC;
1193 flush = COMMIT_TRANS;
1197 flush = FLUSH_DELAYED_ITEMS_NR;
1200 flush = FLUSH_DELAYED_REFS_NR;
1213 flush_space(fs_info, space_info, to_reclaim, flush, true);
1277 space_info->flush = 0;
1288 space_info->flush = 0;
1305 space_info->flush = 0;
1322 space_info->flush = 0;
1338 space_info->flush = 0;
1497 * @flush: how much we can flush
1499 * This does the work of figuring out how to flush for the ticket, waiting for
1506 enum btrfs_reserve_flush_enum flush)
1510 switch (flush) {
1544 start_ns, flush, ticket->error);
1549 * This returns true if this flush state will go through the ordinary flushing
1552 static inline bool is_normal_flushing(enum btrfs_reserve_flush_enum flush)
1554 return (flush == BTRFS_RESERVE_FLUSH_ALL) ||
1555 (flush == BTRFS_RESERVE_FLUSH_ALL_STEAL);
1576 static inline bool can_steal(enum btrfs_reserve_flush_enum flush)
1578 return (flush == BTRFS_RESERVE_FLUSH_ALL_STEAL ||
1579 flush == BTRFS_RESERVE_FLUSH_EVICT);
1586 static inline bool can_ticket(enum btrfs_reserve_flush_enum flush)
1588 return (flush != BTRFS_RESERVE_NO_FLUSH &&
1589 flush != BTRFS_RESERVE_FLUSH_EMERGENCY);
1598 * @flush: whether or not we can flush to make our reservation
1602 * flush out space to make room. It will do this by flushing delalloc if
1603 * possible or committing the transaction. If flush is 0 then no attempts to
1609 enum btrfs_reserve_flush_enum flush)
1621 * the flush method can not be neither BTRFS_RESERVE_FLUSH_ALL* nor
1627 ASSERT(flush != BTRFS_RESERVE_FLUSH_ALL);
1628 ASSERT(flush != BTRFS_RESERVE_FLUSH_ALL_STEAL);
1629 ASSERT(flush != BTRFS_RESERVE_FLUSH_EVICT);
1632 if (flush == BTRFS_RESERVE_FLUSH_DATA)
1645 if (is_normal_flushing(flush) || (flush == BTRFS_RESERVE_NO_FLUSH))
1657 btrfs_can_overcommit(fs_info, space_info, orig_bytes, flush))) {
1668 if (ret && unlikely(flush == BTRFS_RESERVE_FLUSH_EMERGENCY)) {
1684 if (ret && can_ticket(flush)) {
1689 ticket.steal = can_steal(flush);
1693 if (flush == BTRFS_RESERVE_FLUSH_ALL ||
1694 flush == BTRFS_RESERVE_FLUSH_ALL_STEAL ||
1695 flush == BTRFS_RESERVE_FLUSH_DATA) {
1697 if (!space_info->flush) {
1707 space_info->flush = 1;
1710 orig_bytes, flush,
1728 orig_bytes, flush, "preempt");
1734 if (!ret || !can_ticket(flush))
1738 orig_bytes, flush);
1747 * @flush: whether or not we can flush to make our reservation
1751 * flush out space to make room. It will do this by flushing delalloc if
1752 * possible or committing the transaction. If flush is 0 then no attempts to
1759 enum btrfs_reserve_flush_enum flush)
1763 ret = __reserve_bytes(fs_info, block_rsv->space_info, orig_bytes, flush);
1781 * @flush: how we are allowed to flush
1784 * space then we will attempt to flush space as specified by flush.
1787 enum btrfs_reserve_flush_enum flush)
1792 ASSERT(flush == BTRFS_RESERVE_FLUSH_DATA ||
1793 flush == BTRFS_RESERVE_FLUSH_FREE_SPACE_INODE ||
1794 flush == BTRFS_RESERVE_NO_FLUSH);
1795 ASSERT(!current->journal_info || flush != BTRFS_RESERVE_FLUSH_DATA);
1797 ret = __reserve_bytes(fs_info, data_sinfo, bytes, flush);