Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp269105imm; Mon, 9 Jul 2018 01:08:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfopxVIiPWclmwZ+4uFBhjIktjyIXODIhIYRvFD0clbADt/2x+3IDrf3U+szC36a35wPEKZ X-Received: by 2002:a63:4306:: with SMTP id q6-v6mr17351099pga.181.1531123690460; Mon, 09 Jul 2018 01:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531123690; cv=none; d=google.com; s=arc-20160816; b=0ewnJATZ/HATi+/zQSAXRKNv9I7AUgvf9sXHlIgBb/JF+2yuvx97igoo1nfeSswHV/ Tcd4HKOZss2mzprcQIT14CNhc/YsUIamyImACw2+wrvOM8YI6kmPnYtjblNCk63Fbps2 Vv8PecCpUvspL5+Z+TjZ6oUBs+AAqKAXIW91tT4YMDftI42HWqfPPjb7VPa0mA4F3n+s 3ii+uZRPFpts+1XOTtqNiw/jOCvfm8523BgOPOiuU16F99n2dGwdAK1nHKigf2UHZYL8 G3VAijS2Wu0uGzmSuTkRDAyxC92ZpzWwkZwXcezJqGn6R43FkTiegt4UMoc7Pz680eTk 0eHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=l2+WL8Rrlts600OCqicqhny0TcWAgvVOfv4W3BQrKIQ=; b=VLzb9R4RAJF+5Ec4pUEHSoGZBBDPhfzecnZSuHvtqexHBYolI2dY2lM04Umsb7ruNx WYP20yHQMZMlDQZI44lfu2QRlXH6eKqN/GVZRahOzeM2qDQUP/u40VnHGJF7T48AtLOz Q2oc3W+5AI3+457WDy8836MMO8OHdL5pTViEyvZDa/xA/1jGYi90o6HHfsCyL805rVot 3XpsFXF6wSYuf2p4S/ekpdMh5MzpSq1Xd4Gibj5KqQhYNpy7cP5vLtkdYA2XyOWKOwPU dp3JWqWDLm4GmV5lp9N7vY4LNd1p8V+ELY/+XqHxIevT/0liPkLq6DZ+K4bav8us6AHf y5fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RaLiZYv3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y124-v6si13176456pgy.228.2018.07.09.01.07.55; Mon, 09 Jul 2018 01:08:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RaLiZYv3; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932397AbeGIIHD (ORCPT + 99 others); Mon, 9 Jul 2018 04:07:03 -0400 Received: from mail-yb0-f193.google.com ([209.85.213.193]:39065 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754326AbeGIIGg (ORCPT ); Mon, 9 Jul 2018 04:06:36 -0400 Received: by mail-yb0-f193.google.com with SMTP id k127-v6so6848979ybk.6; Mon, 09 Jul 2018 01:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l2+WL8Rrlts600OCqicqhny0TcWAgvVOfv4W3BQrKIQ=; b=RaLiZYv39bsHaziAru4/noM+SDyHObOMsrsJgUL4YlK4Glsi7kGTSqUkwBauUPrrQi WUFQGfOv/TUhm8+tp5lIY1pjLsOJZqNRhuvh9e9qBGHF/bv/K48/fsYQFK9AJGTkBTW6 d+cVUdUi/x4z6j3ot1KI7hMqlQXsza4x7Ue8A31N2M/wUj39oI5IQYvJYH6paLlul3x1 yrrjgsli6JraA7kPqSVCgyUaj1ng8IQlKq23Q/USZQjLKiIkPktbQ4cPvIDQ/n0EYBpG XZMmg5ZXPk9/3avGATYgVU8IjPJDyUbjqi1ls5gEmTY1RbBW2i3kdHKoTA3As7qNPw1/ /ldA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l2+WL8Rrlts600OCqicqhny0TcWAgvVOfv4W3BQrKIQ=; b=hf9Py0jZEo1+0Cb4ommWesNSFKzGl8J1Ui/mRDsRaOMNtR/mFPaUEi+zaiz4kqnWTP SUz7DMgADHI3U0SORqC2kOF4w8WxPqOspTkOHQ17MydY9FqXlY5ka8YTvlsJ7L7GYhbO t5wrG0ta9tsB0+hAj362eUXMHWbO7llxIrzJmWZQ6tl470PS3Wx+04i5OPx5pc0IuzSe 4oouJMZ/HUdo4YPQ7uZz/yJ+lPZ87jCA1ecFdvDjs7LaPBCknqXHhdSt7Gy+9MF9WAf2 PBDqUYCMg/bhPfYDJqFlZK5OitiD77klSNpMTVPcN4UhGb+0X+J0MYRMhH1D55L1ILIC u4KQ== X-Gm-Message-State: APt69E12dxdi2OXOZWKOV+O9vWe2gMWRnNtm0J55+qr5JwcbBZNenkJh /Sf3PMrfphR/nSPuSzoNB58= X-Received: by 2002:a25:2b06:: with SMTP id r6-v6mr3351455ybr.380.1531123595969; Mon, 09 Jul 2018 01:06:35 -0700 (PDT) Received: from sandstorm.nvidia.com ([2600:1700:43b0:3120:feaa:14ff:fe9e:34cb]) by smtp.gmail.com with ESMTPSA id w64-v6sm6339514ywe.46.2018.07.09.01.06.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jul 2018 01:06:35 -0700 (PDT) From: john.hubbard@gmail.com X-Google-Original-From: jhubbard@nvidia.com To: Matthew Wilcox , Michal Hocko , Christopher Lameter , Jason Gunthorpe , Dan Williams , Jan Kara , Al Viro Cc: linux-mm@kvack.org, LKML , linux-rdma , linux-fsdevel@vger.kernel.org, John Hubbard Subject: [PATCH 2/2] goldfish_pipe/mm: convert to the new put_user_page() call Date: Mon, 9 Jul 2018 01:05:54 -0700 Message-Id: <20180709080554.21931-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180709080554.21931-1-jhubbard@nvidia.com> References: <20180709080554.21931-1-jhubbard@nvidia.com> X-NVConfidentiality: public Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: John Hubbard 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 Signed-off-by: John Hubbard --- 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