Lines Matching full:mag
795 static void iova_magazine_free(struct iova_magazine *mag) in iova_magazine_free() argument
797 kfree(mag); in iova_magazine_free()
801 iova_magazine_free_pfns(struct iova_magazine *mag, struct iova_domain *iovad) in iova_magazine_free_pfns() argument
806 if (!mag) in iova_magazine_free_pfns()
811 for (i = 0 ; i < mag->size; ++i) { in iova_magazine_free_pfns()
812 struct iova *iova = private_find_iova(iovad, mag->pfns[i]); in iova_magazine_free_pfns()
822 mag->size = 0; in iova_magazine_free_pfns()
825 static bool iova_magazine_full(struct iova_magazine *mag) in iova_magazine_full() argument
827 return (mag && mag->size == IOVA_MAG_SIZE); in iova_magazine_full()
830 static bool iova_magazine_empty(struct iova_magazine *mag) in iova_magazine_empty() argument
832 return (!mag || mag->size == 0); in iova_magazine_empty()
835 static unsigned long iova_magazine_pop(struct iova_magazine *mag, in iova_magazine_pop() argument
841 BUG_ON(iova_magazine_empty(mag)); in iova_magazine_pop()
844 for (i = mag->size - 1; mag->pfns[i] > limit_pfn; i--) in iova_magazine_pop()
849 pfn = mag->pfns[i]; in iova_magazine_pop()
850 mag->pfns[i] = mag->pfns[--mag->size]; in iova_magazine_pop()
855 static void iova_magazine_push(struct iova_magazine *mag, unsigned long pfn) in iova_magazine_push() argument
857 BUG_ON(iova_magazine_full(mag)); in iova_magazine_push()
859 mag->pfns[mag->size++] = pfn; in iova_magazine_push()