Re: [RFC PATCH v2 11/32] iommu/pages: Add APIs to preserve/unpreserve/restore iommu pages
From: Baolu Lu
Date: Wed Dec 03 2025 - 21:30:05 EST
On 12/3/25 07:02, Samiullah Khawaja wrote:
+int iommu_preserve_pages(struct iommu_pages_list *list)
+{
+ struct ioptdesc *iopt;
+ int count = 0;
+ int ret;
+
+ list_for_each_entry(iopt, &list->pages, iopt_freelist_elm) {
+ ret = kho_preserve_folio(ioptdesc_folio(iopt));
+ if (ret) {
+ iommu_unpreserve_pages(list, count);
+ return ret;
+ }
+
+ ++count;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL_GPL(iommu_preserve_pages);
What is the purpose of "count"?
Thanks,
baolu