iommufd: Export do_update_pinned
authorSteve Sistare <steven.sistare@oracle.com>
Wed, 13 Nov 2024 19:51:34 +0000 (11:51 -0800)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 14 Nov 2024 16:47:16 +0000 (12:47 -0400)
Export do_update_pinned. No functional change.

Link: https://patch.msgid.link/r/1731527497-16091-2-git-send-email-steven.sistare@oracle.com
Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/iommu/iommufd/io_pagetable.h
drivers/iommu/iommufd/pages.c

index 9b40b22..f5f20fa 100644 (file)
@@ -252,4 +252,9 @@ struct iopt_pages_access {
        unsigned int users;
 };
 
+struct pfn_reader_user;
+
+int iopt_pages_update_pinned(struct iopt_pages *pages, unsigned long npages,
+                            bool inc, struct pfn_reader_user *user);
+
 #endif
index 8f24916..3427749 100644 (file)
@@ -985,8 +985,8 @@ static int update_mm_locked_vm(struct iopt_pages *pages, unsigned long npages,
        return rc;
 }
 
-static int do_update_pinned(struct iopt_pages *pages, unsigned long npages,
-                           bool inc, struct pfn_reader_user *user)
+int iopt_pages_update_pinned(struct iopt_pages *pages, unsigned long npages,
+                            bool inc, struct pfn_reader_user *user)
 {
        int rc = 0;
 
@@ -1020,8 +1020,8 @@ static void update_unpinned(struct iopt_pages *pages)
                return;
        if (pages->npinned == pages->last_npinned)
                return;
-       do_update_pinned(pages, pages->last_npinned - pages->npinned, false,
-                        NULL);
+       iopt_pages_update_pinned(pages, pages->last_npinned - pages->npinned,
+                                false, NULL);
 }
 
 /*
@@ -1051,7 +1051,7 @@ static int pfn_reader_user_update_pinned(struct pfn_reader_user *user,
                npages = pages->npinned - pages->last_npinned;
                inc = true;
        }
-       return do_update_pinned(pages, npages, inc, user);
+       return iopt_pages_update_pinned(pages, npages, inc, user);
 }
 
 /*