Lines Matching full:tr
464 struct xfs_trim_rtdev *tr) in xfs_discard_free_rtdev_extents() argument
468 list_for_each_entry_safe(busyp, n, &tr->extent_list, list) { in xfs_discard_free_rtdev_extents()
482 struct xfs_trim_rtdev *tr) in xfs_discard_rtdev_extents() argument
492 list_for_each_entry(busyp, &tr->extent_list, list) { in xfs_discard_rtdev_extents()
506 xfs_discard_free_rtdev_extents(tr); in xfs_discard_rtdev_extents()
532 struct xfs_trim_rtdev *tr = priv; in xfs_trim_gather_rtextent() local
536 if (rec->ar_startext > tr->stop_rtx) { in xfs_trim_gather_rtextent()
542 tr->restart_rtx = rec->ar_startext; in xfs_trim_gather_rtextent()
550 if (rlen < tr->minlen_fsb) { in xfs_trim_gather_rtextent()
562 list_add_tail(&busyp->list, &tr->extent_list); in xfs_trim_gather_rtextent()
564 tr->restart_rtx = rec->ar_startext + rec->ar_extcount; in xfs_trim_gather_rtextent()
577 struct xfs_trim_rtdev tr = { in xfs_trim_rtextents() local
579 .extent_list = LIST_HEAD_INIT(tr.extent_list), in xfs_trim_rtextents()
591 tr.stop_rtx = low + xfs_rtbitmap_rtx_per_rbmblock(mp); in xfs_trim_rtextents()
594 xfs_trim_gather_rtextent, &tr); in xfs_trim_rtextents()
600 xfs_discard_free_rtdev_extents(&tr); in xfs_trim_rtextents()
604 if (list_empty(&tr.extent_list)) { in xfs_trim_rtextents()
609 error = xfs_discard_rtdev_extents(mp, &tr); in xfs_trim_rtextents()
614 low = tr.restart_rtx; in xfs_trim_rtextents()
645 struct xfs_trim_rtgroup *tr = priv; in xfs_trim_gather_rtgroup_extent() local
649 if (--tr->batch <= 0) { in xfs_trim_gather_rtgroup_extent()
655 tr->restart_rtx = rec->ar_startext; in xfs_trim_gather_rtgroup_extent()
663 if (len < tr->minlen_fsb) { in xfs_trim_gather_rtgroup_extent()
678 &tr->extents->extent_list); in xfs_trim_gather_rtgroup_extent()
680 tr->queued++; in xfs_trim_gather_rtgroup_extent()
681 tr->restart_rtx = rec->ar_startext + rec->ar_extcount; in xfs_trim_gather_rtgroup_extent()
694 struct xfs_trim_rtgroup tr = { in xfs_trim_rtgroup_extents() local
707 tr.extents = kzalloc(sizeof(*tr.extents), GFP_KERNEL); in xfs_trim_rtgroup_extents()
708 if (!tr.extents) { in xfs_trim_rtgroup_extents()
713 tr.queued = 0; in xfs_trim_rtgroup_extents()
714 tr.batch = XFS_DISCARD_MAX_EXAMINE; in xfs_trim_rtgroup_extents()
715 tr.extents->owner = tr.extents; in xfs_trim_rtgroup_extents()
716 INIT_LIST_HEAD(&tr.extents->extent_list); in xfs_trim_rtgroup_extents()
720 xfs_trim_gather_rtgroup_extent, &tr); in xfs_trim_rtgroup_extents()
725 kfree(tr.extents); in xfs_trim_rtgroup_extents()
729 if (!tr.queued) { in xfs_trim_rtgroup_extents()
730 kfree(tr.extents); in xfs_trim_rtgroup_extents()
744 error = xfs_discard_extents(rtg_mount(rtg), tr.extents); in xfs_trim_rtgroup_extents()
748 low = tr.restart_rtx; in xfs_trim_rtgroup_extents()