From patchwork Fri Sep 2 19:46:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12964546 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 09517C6FA83 for ; Fri, 2 Sep 2022 19:47:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BAB0800F7; Fri, 2 Sep 2022 15:47:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 89CDE800F6; Fri, 2 Sep 2022 15:47:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4C4A8800F6; Fri, 2 Sep 2022 15:47:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 32C49800F4 for ; Fri, 2 Sep 2022 15:47:02 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 18C72407BA for ; Fri, 2 Sep 2022 19:47:02 +0000 (UTC) X-FDA: 79868178684.16.2522E6B Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf07.hostedemail.com (Postfix) with ESMTP id C0AED4004D for ; Fri, 2 Sep 2022 19:47:01 +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=9NiKz/AgNrTLUig1S7htcFVARNbE9lqPRbDWQiFWth8=; b=OGdXO+WBrVyGfrFBL9/PU/ddAA r0Z2ezGHhb0jzmiTy9KO0YJpEcI90LL1Nh/cULcaoCEtJ6QCbNdru3BE2vqncln6uMMqKmiYe2RXl GS7thNNJZDiyEHqc8Ypk3Xu+rBtsMLrxs3XeBL65pL0Ae4lYXYhpjVzvqUY4IhjR8FCkWTvWB4lFs 4/0ovxWBTnSpVu30uYNYRJr/H+XOHbKVbCS6PH1VSFJXOo98Pl/gaAxANr7CFsTyYN2IS5nMB1bDi ihqw0qF188Cjl+/jLH3fDQgQPbGqKiPaSaN4yyDchrMaJf6Pd9G+uxuxteqNQJ1pPNkMh/XWvstmQ Cpe5KVXQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oUCd3-007Iea-Dt; Fri, 02 Sep 2022 19:47:01 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org Subject: [PATCH v2 33/57] shmem: Remove shmem_getpage() Date: Fri, 2 Sep 2022 20:46:29 +0100 Message-Id: <20220902194653.1739778-34-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220902194653.1739778-1-willy@infradead.org> References: <20220902194653.1739778-1-willy@infradead.org> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662148021; 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=9NiKz/AgNrTLUig1S7htcFVARNbE9lqPRbDWQiFWth8=; b=Mz4BSldWtK9D6c7Q82QNDiedRibrWGMAp7/mJhgafLrTGNzBeM2Ww19uA9RL1jLJdA/QNH HYmAUZPi3b3pToc4sysNEt0E0+syXYBpVo66X/oUZbaK/l7xd9HrEglxImlivI2e9ASrzF W5FC8sOPm9w9OuucLRc2W47A/KHddTQ= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=OGdXO+WB; dmarc=none; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662148021; a=rsa-sha256; cv=none; b=mU3wAM8xPuAR6oVxbKFxMEpBDm9WHr08IVrZOqw80BbN+NJyA2vw4WpW9Rb93vpFE3jyi7 Hf2TJ02QzMyEFmMuPWDQcFCj8H/9RSkDbnUY+N88xVQW4wAGc7HmGjqZh+hyE8ub/vV80e lbka/Oxzot8h88Ic9aFeOfOGHZth/bg= X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C0AED4004D Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=OGdXO+WB; dmarc=none; spf=none (imf07.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspam-User: X-Stat-Signature: bg1qdrzh6gau9xekcq6u8b3yoac95nip X-HE-Tag: 1662148021-251117 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: With all callers removed, remove this wrapper function. The flags are now mysteriously called SGP, but I think we can live with that. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/shmem_fs.h | 4 +--- mm/shmem.c | 15 +-------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index f4bd50b08a91..f24071e3c826 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -102,7 +102,7 @@ extern unsigned long shmem_swap_usage(struct vm_area_struct *vma); extern unsigned long shmem_partial_swap_usage(struct address_space *mapping, pgoff_t start, pgoff_t end); -/* Flag allocation requirements to shmem_getpage */ +/* Flag allocation requirements to shmem_get_folio */ enum sgp_type { SGP_READ, /* don't exceed i_size, don't allocate page */ SGP_NOALLOC, /* similar, but fail on hole or use fallocated page */ @@ -111,8 +111,6 @@ enum sgp_type { SGP_FALLOC, /* like SGP_WRITE, but make existing page Uptodate */ }; -extern int shmem_getpage(struct inode *inode, pgoff_t index, - struct page **pagep, enum sgp_type sgp); int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, enum sgp_type sgp); diff --git a/mm/shmem.c b/mm/shmem.c index e89a11bf83f6..99b7341bd0bf 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -179,7 +179,7 @@ static inline int shmem_reacct_size(unsigned long flags, /* * ... whereas tmpfs objects are accounted incrementally as * pages are allocated, in order to allow large sparse files. - * shmem_getpage reports shmem_acct_block failure as -ENOSPC not -ENOMEM, + * shmem_get_folio reports shmem_acct_block failure as -ENOSPC not -ENOMEM, * so that a failure on a sparse tmpfs mapping will give SIGBUS not OOM. */ static inline int shmem_acct_block(unsigned long flags, long pages) @@ -2031,19 +2031,6 @@ int shmem_get_folio(struct inode *inode, pgoff_t index, struct folio **foliop, mapping_gfp_mask(inode->i_mapping), NULL, NULL, NULL); } -int shmem_getpage(struct inode *inode, pgoff_t index, - struct page **pagep, enum sgp_type sgp) -{ - struct folio *folio = NULL; - int ret = shmem_get_folio(inode, index, &folio, sgp); - - if (folio) - *pagep = folio_file_page(folio, index); - else - *pagep = NULL; - return ret; -} - /* * This is like autoremove_wake_function, but it removes the wait queue * entry unconditionally - even if something else had already woken the