From patchwork Mon Aug 8 19:34:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12939088 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 97A64C00140 for ; Mon, 8 Aug 2022 19:36:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9BAFF940028; Mon, 8 Aug 2022 15:35:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 93C0F940023; Mon, 8 Aug 2022 15:35:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7B652940028; Mon, 8 Aug 2022 15:35:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 646E5940023 for ; Mon, 8 Aug 2022 15:35:59 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8B48D160196 for ; Mon, 8 Aug 2022 19:35:58 +0000 (UTC) X-FDA: 79777430796.12.E8C3D12 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf29.hostedemail.com (Postfix) with ESMTP id D5DB412015B for ; Mon, 8 Aug 2022 19:35:57 +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=HR/mBIOdxosWBhe7YLzmGPGSClLtJ9GPmZ0+j22jXvQ=; b=vklXHJH1TP3wfj48pNk8cBN0I8 7pmfyedhrJq3VtjNuqmGtVG9s59pBPc+79gJsXls8NQc/NiCoudAeC15SyQ4Czh7xGEiLL7uZaqQK 7xCz7g5nf5DSQ7vcUds/c/yTKtDPUn+mLejOLTXtWfwu8rPaXrXkkfBMDcpoPtGjmqm0ZCyKsA5p6 p3qvGbgb0EaZ2YVPK+Ben/HOp8WUkyEGEu9n15p+a0oTcvnaVRPjXxvuGOOWK39BbRM8XESZMHTjm 9C8Fmt+MBQE0qeZLi6tE4NF2ZoHl4GuGjSCrKfgdZBsL7uUBKot6QAehEFc3j7BkYY/NwfZz6ID2f WIebdp5Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1oL8XA-00EAym-L9; Mon, 08 Aug 2022 19:35:30 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Cc: "Matthew Wilcox (Oracle)" , hughd@google.com Subject: [PATCH 36/59] shmem: Remove shmem_getpage() Date: Mon, 8 Aug 2022 20:34:04 +0100 Message-Id: <20220808193430.3378317-37-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 ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=vklXHJH1; spf=none (imf29.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659987358; a=rsa-sha256; cv=none; b=mBISAdleu0DWoiY43vop3sdXVthXQBl4RcXwcT6qQSyiGTRSW/dsmCIT3nFFeu4pZ+Q50j Cyn0grpHXS+R3vALaZnx9Yk/HNFLrL6Y8/lyxYKPm5dk/0hPqPBM1ROdRd5iWzJ3YtirdZ Ikz2W/6tpdg5ppIQO/DdGocE4rg0TY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659987358; 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=HR/mBIOdxosWBhe7YLzmGPGSClLtJ9GPmZ0+j22jXvQ=; b=cwPbZKN5tb+1xo3ctWFJZpKZ2es6szUFCkYGt/NDAaQcnH2pdO4ZJV2xZKsYclKhx5SHo+ wbd9bB85S+0bSH6jJtb9XiXvSZqYrZOkE+x8X8IRi5pKAHrbMg/2dkcHI1/ac5QNQ46NeD GIjQh4teQ7pncnTbd0ULqjRkoiTO1MY= X-Stat-Signature: dd3taebjer6sx8p5x1iwg4u7jd8rewj3 X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: D5DB412015B Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=vklXHJH1; spf=none (imf29.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: 1659987357-662743 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 0549929261f2..5c8cc23fcefe 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h @@ -107,7 +107,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 */ @@ -116,8 +116,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 da7ce4039430..3cdfb061b2ff 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) @@ -2029,19 +2029,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