lkml.org 
[lkml]   [2018]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] goldfish_pipe/mm: convert to the new put_user_page() call
Date
From: John Hubbard <jhubbard@nvidia.com>

For code that retains pages via get_user_pages*(),
release those pages via the new put_user_page(),
instead of put_page().

Also: rename release_user_pages(), to avoid a naming
conflict with the new external function of the same name.

CC: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
drivers/platform/goldfish/goldfish_pipe.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
index 3e32a4c14d5f..3ab871c22a88 100644
--- a/drivers/platform/goldfish/goldfish_pipe.c
+++ b/drivers/platform/goldfish/goldfish_pipe.c
@@ -331,7 +331,7 @@ static int pin_user_pages(unsigned long first_page, unsigned long last_page,

}

-static void release_user_pages(struct page **pages, int pages_count,
+static void __release_user_pages(struct page **pages, int pages_count,
int is_write, s32 consumed_size)
{
int i;
@@ -339,7 +339,7 @@ static void release_user_pages(struct page **pages, int pages_count,
for (i = 0; i < pages_count; i++) {
if (!is_write && consumed_size > 0)
set_page_dirty(pages[i]);
- put_page(pages[i]);
+ put_user_page(pages[i]);
}
}

@@ -409,7 +409,7 @@ static int transfer_max_buffers(struct goldfish_pipe *pipe,

*consumed_size = pipe->command_buffer->rw_params.consumed_size;

- release_user_pages(pages, pages_count, is_write, *consumed_size);
+ __release_user_pages(pages, pages_count, is_write, *consumed_size);

mutex_unlock(&pipe->lock);

--
2.18.0
\
 
 \ /
  Last update: 2018-07-09 10:08    [W:0.138 / U:1.708 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site