Lines Matching refs:discardable_extents
577 s32 discardable_extents; in btrfs_discard_calc_delay() local
582 discardable_extents = atomic_read(&discard_ctl->discardable_extents); in btrfs_discard_calc_delay()
583 if (!discardable_extents) in btrfs_discard_calc_delay()
595 if (discardable_extents < 0) in btrfs_discard_calc_delay()
596 atomic_add(-discardable_extents, in btrfs_discard_calc_delay()
597 &discard_ctl->discardable_extents); in btrfs_discard_calc_delay()
604 if (discardable_extents <= 0) { in btrfs_discard_calc_delay()
613 delay = BTRFS_DISCARD_TARGET_MSEC / discardable_extents; in btrfs_discard_calc_delay()
647 extents_delta = ctl->discardable_extents[BTRFS_STAT_CURR] - in btrfs_discard_update_discardable()
648 ctl->discardable_extents[BTRFS_STAT_PREV]; in btrfs_discard_update_discardable()
650 atomic_add(extents_delta, &discard_ctl->discardable_extents); in btrfs_discard_update_discardable()
651 ctl->discardable_extents[BTRFS_STAT_PREV] = in btrfs_discard_update_discardable()
652 ctl->discardable_extents[BTRFS_STAT_CURR]; in btrfs_discard_update_discardable()
756 atomic_set(&discard_ctl->discardable_extents, 0); in btrfs_discard_init()