From patchwork Wed Apr 2 14:59:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 14036141 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 2BA39C3601A for ; Wed, 2 Apr 2025 15:00:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C655328000C; Wed, 2 Apr 2025 11:00:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C0EA428000A; Wed, 2 Apr 2025 11:00:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AAFCF28000C; Wed, 2 Apr 2025 11:00:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 8A4CC28000A for ; Wed, 2 Apr 2025 11:00:15 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4AAD959BFB for ; Wed, 2 Apr 2025 15:00:16 +0000 (UTC) X-FDA: 83289414432.19.426BB4F Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf15.hostedemail.com (Postfix) with ESMTP id 96B1FA0003 for ; Wed, 2 Apr 2025 15:00:14 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=aldD+WzI; dmarc=none; spf=none (imf15.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=1743606014; a=rsa-sha256; cv=none; b=8QkNul+NpLOvvj5FW39tZHXvCf8i+7vhW4xN7KkFMl3+I6Iumqv4rVnrHtlW7ZooObNIgv oKt8CFbgBhj9bFjJM7JD622Ro1CST2PaHt48P0ChP11+olUqU3neT/pyKdvyPTaHeGi34b 0iT2hOufBbn0v4FHpCxFRZSeCUV6PeE= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=aldD+WzI; dmarc=none; spf=none (imf15.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1743606014; 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=USN/8SwPxGkpN9iKStANYoZJi04hj3LODUnr4I2+Xx8=; b=eNSeAqg4fRQLu0fjZJx03/gdw3/N4Bf9iTkMm0RxeMBssRFeNJhLa68x95U9BwXrDKLx6+ U+14fvEMSHl/e/VlbU9hGrJi3eh7MuRPGyBTNCoZ3qqDEeKaW3C15MBW4SAjSNaPxypPAb qb9TTppd/it6CLQn7HDLAEuCXU+1WRk= 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=USN/8SwPxGkpN9iKStANYoZJi04hj3LODUnr4I2+Xx8=; b=aldD+WzI/aKdQ2XEMrI1DtpAyB uXrZ5Dnx/rhBTcN/bbRRqfOX2YC53+ZpRz75qWLyq/1urNcEOc/sxxc6aRf1DOrWtUeZST0atwG6D rPDsdz3NfzG5svTviGHXM5+n0/M+CqRecB+4O3qugWSFiematCWWMs+IbVGc80UFwNmGMuDH5MNYP xHJ9/+9ozytW5lP9Ugm7M2e4JbX3WPxUGItRy7OKJVKFlWocD9Z5qGu77nJE/Lxq+pXQ3VXqtPTRP 36PRWYzQ4cZfAiVLx10GN+rhiM3tnzFQir5/15+eQigFcNP4ROxf+F6Sik872RulOVx8/DHDKhXYI kdfgkjLA==; Received: from willy by casper.infradead.org with local (Exim 4.98.1 #2 (Red Hat Linux)) id 1tzzZX-00000009gsD-1Wga; Wed, 02 Apr 2025 15:00:07 +0000 From: "Matthew Wilcox (Oracle)" To: linux-fsdevel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , intel-gfx@lists.freedesktop.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 4/9] writeback: Remove writeback_use_writepage() Date: Wed, 2 Apr 2025 15:59:58 +0100 Message-ID: <20250402150005.2309458-5-willy@infradead.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250402150005.2309458-1-willy@infradead.org> References: <20250402150005.2309458-1-willy@infradead.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 96B1FA0003 X-Stat-Signature: wbdw7r79yn1ypfeqtcfwoi1hjhae8jjs X-Rspam-User: X-Rspamd-Server: rspam06 X-HE-Tag: 1743606014-238059 X-HE-Meta: U2FsdGVkX19TaCIkZl1+C5NEkV0fufszvamMNHkBD03uHPPZz8kRJYOQkwFMljdKm7q32uwOdOO18uyqLbnEHv22tYBEA2xwRTIQSx57KkekNJpCvNxcIL8a5qblM7S22mv9ZcdI7nrLGhTOR5ixM2dxbYBQcPXM7IoXiJdpHwHDDQgBL+SFJHrb6XMuu+lp3qpQoBZSjacIDyRCRzUO57/4wVH/5Q+XrXwr2u1N/Q/+ZK6t6VVVQZzAAjoAVBWUMwAmgsZaGVPv+M85YROM9L89ZOJmr4giE3ByZr3p/BgjDZQHqa9Pj/yPdconIVlyNFTKePIqZJOUy159rmxVW4PIa3yvv4MlrJFJPo1bc4DmBGKQ2qqX9FqENPoBiR9hQsFl6PFP5HJSi5xBtt0R01V+kzIek8FZRh+Flp+lN++2r5vvmmniej5YVKdn0Rk6Jj1IHsK2kn4gn4cENeUInAXCYIcK1qZbamP3rh6iOrVpj/ljZ7qWe6AK/FjEj6QsqFdBp9OHFrFApnwxrOBJ54RUSJcbpGOK+/L3IgIOymTfqFuQ4/Izp+s97PstyD3oH/RcxfoAuopgd0iuTwOCUZ0vAN4A4yog04SUTIhZs8MJ7wj/5EgnfmHzbC1+kRcxuJQVRb+BHRY+6tymByYyBPmROpzBhzENBDpBk3DAJf4XdEQLucJp2CL9IhYeMCyZ2RK6UGwen3XDQWLHMxhRdJupOpvGL5Xn1UB8212vlMu3BhkmWgzkYs9ffaaSX4DLs3bgRRkoVIcTQkg8LZ0yWt5mC6RLcvhxhwDqCXCu2deC18OwHD5o2Yx0dshZyga6cY31IzXhIsN39/rfckT7vL6w5EXEQcUR8+Evd5PjxU+OfRGRhM02A4v9pfhUTvBBBki35L/ePb34B2UELoSjG5/R9zyJMlSOJM55iSpOMB8iTkorqWwTsivCYeS/VRj/GvBxniOaRo8j/HkHhQM 9si715La iUnfzf7v5eupqq8MwkzbefABcbuw4y9yxzFGcGlY1QfuIhhWxc3jHYGy39aW8O+MKy9DMoayu6KQIhOT9/KOb+gAEQhIk49J2/RzmoPmLK9HrWlbbsVIuFeuoJxoT7iqZn/O2D6LoOYtdDsuG6TKfsuqn1udXITRJwTRxmuFltyFW9tbLg4qxoM7M5/lI9R2tK2o9Ufou5lO9LqLMj/1kiIek0WarkLezkQXTZwnmSi9eqUdj/dr7VjxxqkxAPebLZOn6uJpJkyCRsfVfzwoPouPXLB/5aPkVRyUt 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: List-Subscribe: List-Unsubscribe: The ->writepage operation has been removed from all filesystems but shmem and swap, neither of which call in here. Remove this alternative to calling ->writepages. Signed-off-by: Matthew Wilcox (Oracle) --- mm/page-writeback.c | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 18456ddd463b..3cf7ae45be58 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2621,27 +2621,6 @@ int write_cache_pages(struct address_space *mapping, } EXPORT_SYMBOL(write_cache_pages); -static int writeback_use_writepage(struct address_space *mapping, - struct writeback_control *wbc) -{ - struct folio *folio = NULL; - struct blk_plug plug; - int err; - - blk_start_plug(&plug); - while ((folio = writeback_iter(mapping, wbc, folio, &err))) { - err = mapping->a_ops->writepage(&folio->page, wbc); - if (err == AOP_WRITEPAGE_ACTIVATE) { - folio_unlock(folio); - err = 0; - } - mapping_set_error(mapping, err); - } - blk_finish_plug(&plug); - - return err; -} - int do_writepages(struct address_space *mapping, struct writeback_control *wbc) { int ret; @@ -2652,14 +2631,11 @@ int do_writepages(struct address_space *mapping, struct writeback_control *wbc) wb = inode_to_wb_wbc(mapping->host, wbc); wb_bandwidth_estimate_start(wb); while (1) { - if (mapping->a_ops->writepages) { + if (mapping->a_ops->writepages) ret = mapping->a_ops->writepages(mapping, wbc); - } else if (mapping->a_ops->writepage) { - ret = writeback_use_writepage(mapping, wbc); - } else { + else /* deal with chardevs and other special files */ ret = 0; - } if (ret != -ENOMEM || wbc->sync_mode != WB_SYNC_ALL) break;