]> git.karo-electronics.de Git - linux-beck.git/commitdiff
virtio_ballon: change stub of release_pages_by_pfn
authorDenis V. Lunev <den@openvz.org>
Wed, 19 Aug 2015 21:49:48 +0000 (00:49 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 8 Sep 2015 10:31:51 +0000 (13:31 +0300)
and rename it to release_pages_balloon. The function originally takes
arrays of pfns and now it takes pointer to struct virtio_ballon.
This change is necessary to conditionally call adjust_managed_page_count
in the next patch.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/virtio/virtio_balloon.c

index 82e80e034f250b88993af25bb27434c2a78f8204..8543c9a97307abe41c0264219a077dd7dee73917 100644 (file)
@@ -166,13 +166,13 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
        mutex_unlock(&vb->balloon_lock);
 }
 
-static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
+static void release_pages_balloon(struct virtio_balloon *vb)
 {
        unsigned int i;
 
        /* Find pfns pointing at start of each page, get pages and free them. */
-       for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
-               struct page *page = balloon_pfn_to_page(pfns[i]);
+       for (i = 0; i < vb->num_pfns; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
+               struct page *page = balloon_pfn_to_page(vb->pfns[i]);
                adjust_managed_page_count(page, 1);
                put_page(page); /* balloon reference */
        }
@@ -206,7 +206,7 @@ static unsigned leak_balloon(struct virtio_balloon *vb, size_t num)
        if (vb->num_pfns != 0)
                tell_host(vb, vb->deflate_vq);
        mutex_unlock(&vb->balloon_lock);
-       release_pages_by_pfn(vb->pfns, vb->num_pfns);
+       release_pages_balloon(vb);
        return num_freed_pages;
 }