From patchwork Tue Jun 29 02:36:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12348991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C6ECC11F66 for ; Tue, 29 Jun 2021 02:36:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B9C8D61D04 for ; Tue, 29 Jun 2021 02:36:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9C8D61D04 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1BC4D8D00B1; Mon, 28 Jun 2021 22:36:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 193B08D008F; Mon, 28 Jun 2021 22:36:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05B0D8D00B1; Mon, 28 Jun 2021 22:36:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0150.hostedemail.com [216.40.44.150]) by kanga.kvack.org (Postfix) with ESMTP id D65808D008F for ; Mon, 28 Jun 2021 22:36:25 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D332C8249980 for ; Tue, 29 Jun 2021 02:36:25 +0000 (UTC) X-FDA: 78305197530.15.8F4A451 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf05.hostedemail.com (Postfix) with ESMTP id 8EF24E000259 for ; Tue, 29 Jun 2021 02:36:25 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D16961A2B; Tue, 29 Jun 2021 02:36:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1624934184; bh=BVGSBXG+iIv71EvhAwQT77Vw6G7WU+AsbnzpJ5VHF5Y=; h=Date:From:To:Subject:In-Reply-To:From; b=AdjbQMBI9u39lMUaFjOfyIJ7zeroFeRNA2xtMo+iXjGMY0S2T6GAI+qQ1Hmbw4476 9mY0gwBN2tfxYbym854n8tsam1B6OgDWAFtL0lefxtIc3TupkR6tUl5OiIdkvqU+KP xDZwEOOkT3GpqwUSxf7sPjDDoaXf5vA9dUoSTQMY= Date: Mon, 28 Jun 2021 19:36:24 -0700 From: Andrew Morton To: akpm@linux-foundation.org, dan.j.williams@intel.com, gregkh@linuxfoundation.org, hch@lst.de, jack@suse.cz, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, willy@infradead.org Subject: [patch 060/192] fs: remove anon_set_page_dirty() Message-ID: <20210629023624.v3hqK-B4d%akpm@linux-foundation.org> In-Reply-To: <20210628193256.008961950a714730751c1423@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=AdjbQMBI; spf=pass (imf05.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8EF24E000259 X-Stat-Signature: 1rhi94eyi9aquj351zusn5fcij1z9k4p X-HE-Tag: 1624934185-487931 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: From: "Matthew Wilcox (Oracle)" Subject: fs: remove anon_set_page_dirty() Use __set_page_dirty_no_writeback() instead. This will set the dirty bit on the page, which will be used to avoid calling set_page_dirty() in the future. It will have no effect on actually writing the page back, as the pages are not on any LRU lists. Link: https://lkml.kernel.org/r/20210615162342.1669332-5-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Cc: Al Viro Cc: Dan Williams Cc: Greg Kroah-Hartman Cc: Jan Kara Signed-off-by: Andrew Morton --- fs/libfs.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) --- a/fs/libfs.c~fs-remove-anon_set_page_dirty +++ a/fs/libfs.c @@ -1217,19 +1217,10 @@ void kfree_link(void *p) } EXPORT_SYMBOL(kfree_link); -/* - * nop .set_page_dirty method so that people can use .page_mkwrite on - * anon inodes. - */ -static int anon_set_page_dirty(struct page *page) -{ - return 0; -}; - struct inode *alloc_anon_inode(struct super_block *s) { static const struct address_space_operations anon_aops = { - .set_page_dirty = anon_set_page_dirty, + .set_page_dirty = __set_page_dirty_no_writeback, }; struct inode *inode = new_inode_pseudo(s);