From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01DC0C433FE for ; Fri, 4 Feb 2022 19:59:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2FBF08D000B; Fri, 4 Feb 2022 14:59:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C3C928D0007; Fri, 4 Feb 2022 14:59:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 197C28D0008; Fri, 4 Feb 2022 14:59:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0009.hostedemail.com [216.40.44.9]) by kanga.kvack.org (Postfix) with ESMTP id 05E776B009C for ; Fri, 4 Feb 2022 14:59:07 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BB0D7824C424 for ; Fri, 4 Feb 2022 19:59:06 +0000 (UTC) X-FDA: 79106161092.28.2FAAAD4 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf04.hostedemail.com (Postfix) with ESMTP id 6D33A40002 for ; Fri, 4 Feb 2022 19:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=kgqLD6/1r3pqXl6hXsEe475huLOrflUH9tTG8cvSgDw=; b=j3V9BV1a439HO2pZf2qMRBylXN SaPFWzaALH24RiPRV0suHNvWT9WAz1KF/pAVXJ16Yz0pmQ4Ck+w0PipqMzwM+6f5Owll1t60KOG2P Jz5o8IFcSNrZoE8dcSQ2JZ/Pq7Z1u6DktpEV8mgayBL6gj/nL1qJeuaSJXrKhy5AQlSn3dcxYAEj2 mDYMPUC83LJ4xI9hLmnqyAuW8XTWPXfdS+yqoFmW4Zn9EvBSSTONOmhbjXyKSKA2P123vSFRGcI86 uQNXGF0o0/49bJNqSOVgdx1jLVwW9GwGkavYx755iIoSj5psQO7NyrxTSAUUlmYse75NTJREhu6Zs 7FzOrudA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nG4jT-007Ll9-V7; Fri, 04 Feb 2022 19:58:59 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org, John Hubbard , Jason Gunthorpe , William Kucharski Subject: [PATCH 04/75] mm/gup: Change the calling convention for compound_range_next() Date: Fri, 4 Feb 2022 19:57:41 +0000 Message-Id: <20220204195852.1751729-5-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220204195852.1751729-1-willy@infradead.org> References: <20220204195852.1751729-1-willy@infradead.org> MIME-Version: 1.0 X-Rspam-User: nil X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 6D33A40002 X-Stat-Signature: gikpu6aguij1zojhif9389m3cncwkgdd Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=j3V9BV1a; spf=none (imf04.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-HE-Tag: 1644004746-359024 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Return the head page instead of storing it to a passed parameter. Pass the start page directly instead of passing a pointer to it. Reorder the arguments to match the calling function's arguments. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Jason Gunthorpe Reviewed-by: William Kucharski --- mm/gup.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/gup.c b/mm/gup.c index facadcaedea3..26c73998c6df 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -254,21 +254,20 @@ void unpin_user_page(struct page *page) } EXPORT_SYMBOL(unpin_user_page); =20 -static inline void compound_range_next(unsigned long i, unsigned long np= ages, - struct page **list, struct page **head, - unsigned int *ntails) +static inline struct page *compound_range_next(struct page *start, + unsigned long npages, unsigned long i, unsigned int *ntails) { struct page *next, *page; unsigned int nr =3D 1; =20 - next =3D *list + i; + next =3D start + i; page =3D compound_head(next); if (PageCompound(page) && compound_order(page) >=3D 1) nr =3D min_t(unsigned int, page + compound_nr(page) - next, npages - i); =20 - *head =3D page; *ntails =3D nr; + return page; } =20 static inline void compound_next(unsigned long i, unsigned long npages, @@ -380,7 +379,7 @@ void unpin_user_page_range_dirty_lock(struct page *pa= ge, unsigned long npages, unsigned int ntails; =20 for (index =3D 0; index < npages; index +=3D ntails) { - compound_range_next(index, npages, &page, &head, &ntails); + head =3D compound_range_next(page, npages, index, &ntails); if (make_dirty && !PageDirty(head)) set_page_dirty_lock(head); put_compound_head(head, ntails, FOLL_PIN); --=20 2.34.1