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 01C12C25B08 for ; Mon, 8 Aug 2022 19:35:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C49694001A; Mon, 8 Aug 2022 15:35:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1529C940017; Mon, 8 Aug 2022 15:35:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF9BB94001A; Mon, 8 Aug 2022 15:35:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A695D940018 for ; Mon, 8 Aug 2022 15:35:28 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 83CF61C5CB5 for ; Mon, 8 Aug 2022 19:35:28 +0000 (UTC) X-FDA: 79777429536.19.F834E5B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf11.hostedemail.com (Postfix) with ESMTP id 1FA8840183 for ; Mon, 8 Aug 2022 19:35:27 +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=axbdm1vZfpnkHvpQc3L6SkUUiWdMrUO7JQX8stMwqQY=; b=cyHBpYEYVFxGzFBSnqzbmQcJBm M5JGh5xBVfo1fn71yP/OMx72DQ4mGiIPIyiKJ5X0DwmNc6hxXPAe5pzFs2h4jYB1ndhcNfzhLukbB sD7gr67a0JStv5wQe8tQmGVe17tam0uKZ1E17Tv3dFPQcFneDBLCZIJ9PcPLAPG4Jcnyej7DrG1Ow Xj+s/zxUhu18rFPBxYEeK20ySglqee+OltSpel82m2Wfrq3GqQFvzSMjmAWnqzUOwJyl+qq3riUpb Eks3CQygja08Zi/ieWxhhjxY4rV17v68x6aXggzsTPQlENBJUvfLzSS3AzLR0gvmnZXUoxJSHJM8y cv6bSFGQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oL8X6-00EAxd-4u; Mon, 08 Aug 2022 19:35:24 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , hughd@google.com Subject: [PATCH 28/59] shmem: Convert shmem_get_partial_folio() to use shmem_get_folio() Date: Mon, 8 Aug 2022 20:33:56 +0100 Message-Id: <20220808193430.3378317-29-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220808193430.3378317-1-willy@infradead.org> References: <20220808193430.3378317-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659987328; a=rsa-sha256; cv=none; b=xh1rwx0e6TTotlRW99+VFnfwrdwYfzYy76RlAYESr6jb//6OwgZxtVEKKRzS9Tu6qLkAWm EkkM4QDcAw/FJJ4xjCtR9bkwXZR7Yvj3aQz5DH5PLaHtKCCZk9naHD2x+Oich+PEq5Nxyw W+DqPf1bMiyk53esJBTO0tM+lay85qc= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cyHBpYEY; spf=none (imf11.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659987328; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=axbdm1vZfpnkHvpQc3L6SkUUiWdMrUO7JQX8stMwqQY=; b=PnBGlNOgtspZj5OKy5PrQMKNmI0Q+ByigpaC8H04XUhpNd3TJPK9YXrMuc0AR54LuaofRf IOrTie83av/B8FSwQIBADJHIbvADXyI0izQzPJWavdXBWc8if8eZMyuMyPpX+YCKdD12wd OLJp1Ae3NQk20YNA6YInY4Nw+vrwYWQ= X-Rspamd-Server: rspam06 X-Rspam-User: X-Stat-Signature: kon3bjfrqsdqkeyibwnr6uiurz8u7hfo X-Rspamd-Queue-Id: 1FA8840183 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cyHBpYEY; spf=none (imf11.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: 1659987327-823398 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: Get rid of an unnecessary folio->page->folio conversion. Signed-off-by: Matthew Wilcox (Oracle) --- mm/shmem.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mm/shmem.c b/mm/shmem.c index 75d9304b964e..b26ab3167040 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -874,10 +874,9 @@ void shmem_unlock_mapping(struct address_space *mapping) static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index) { struct folio *folio; - struct page *page; /* - * At first avoid shmem_getpage(,,,SGP_READ): that fails + * At first avoid shmem_get_folio(,,,SGP_READ): that fails * beyond i_size, and reports fallocated pages as holes. */ folio = __filemap_get_folio(inode->i_mapping, index, @@ -888,9 +887,9 @@ static struct folio *shmem_get_partial_folio(struct inode *inode, pgoff_t index) * But read a page back from swap if any of it is within i_size * (although in some cases this is just a waste of time). */ - page = NULL; - shmem_getpage(inode, index, &page, SGP_READ); - return page ? page_folio(page) : NULL; + folio = NULL; + shmem_get_folio(inode, index, &folio, SGP_READ); + return folio; } /* -- 2.35.1