From patchwork Mon Jul 11 04:14:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12912796 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 234FACCA47B for ; Mon, 11 Jul 2022 04:15:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229563AbiGKEPQ (ORCPT ); Mon, 11 Jul 2022 00:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiGKEPO (ORCPT ); Mon, 11 Jul 2022 00:15:14 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C53317E1A; Sun, 10 Jul 2022 21:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=UpNRgrzdjhANfksOn4XBOf9M3wcJerHjfMYMEA5ytpg=; b=oSggFQvQiu2Q/Z4+RDMuKHoaq1 NQSmsCJ4CDSVjb8qVFpmstPY3cliAV4YKv26+FTqAl725WUsiFW5OHJbZV5OCLsXOF0h/xicxpCJ6 GP4BN75XbHX4eRnc9jTwHnL2MEHlMZsBjtU9IdS4QDzH4nw7d53DIpADrUKe+Tn1174dSv34nlzbC 0tYZSuEkDzudQhHp611i2h6dZxPSi2wMFjrxbLFC8jORfL0RrbX58xFXHJJgb8sUcWj9+8DDkKxjA MM6zScWgrkBeb6ebKNwpsFlfQ4qp9SQnwavg2GzDKT9EYcNGsZ75XL3On/5Hgj8yEStz6qrQJ44aA t1uO9t5A==; Received: from 089144197153.atnat0006.highway.a1.net ([89.144.197.153] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAkp7-00FpwQ-9D; Mon, 11 Jul 2022 04:15:05 +0000 From: Christoph Hellwig To: Bob Peterson , Andreas Gruenbacher , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota Cc: Johannes Thumshirn , cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 1/4] gfs2: stop using generic_writepages in gfs2_ail1_start_one Date: Mon, 11 Jul 2022 06:14:56 +0200 Message-Id: <20220711041459.1062583-2-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220711041459.1062583-1-hch@lst.de> References: <20220711041459.1062583-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Use filemap_fdatawrite_wbc instead of generic_writepages in gfs2_ail1_start_one so that the functin can also cope with address_space operations that only implement ->writepages and to properly account for cgroup writeback. Signed-off-by: Christoph Hellwig Reviewed-by: Andreas Gruenbacher --- fs/gfs2/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index f0ee3ff6f9a87..624dffc96136b 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -131,7 +131,7 @@ __acquires(&sdp->sd_ail_lock) if (!mapping) continue; spin_unlock(&sdp->sd_ail_lock); - ret = generic_writepages(mapping, wbc); + ret = filemap_fdatawrite_wbc(mapping, wbc); if (need_resched()) { blk_finish_plug(plug); cond_resched(); From patchwork Mon Jul 11 04:14:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12912797 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD2B8C433EF for ; Mon, 11 Jul 2022 04:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229500AbiGKEPT (ORCPT ); Mon, 11 Jul 2022 00:15:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiGKEPR (ORCPT ); Mon, 11 Jul 2022 00:15:17 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7810D18B3A; Sun, 10 Jul 2022 21:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=+ahx8IwBj1lognBvyanyVPYvmkYJvj3o2T/XC6JDw+Y=; b=RkPmSbJOThdixWcmqh5WqcV+DM QZ937ZTJUiABfxThKQ5DgNZx047yLrbncE8Tj4ngUJHQnM3CSu/shmQrgCPy+7Hj5G5dBUuo2qRRW N8GMaaPnqecJZsF+zPBO4ETbzp8VcVwU0Pi+GT0VmD9UwCBVgfu4IYFEDgVyGSdvW1bC/apckAOnP NTBFEnwN29eBh1nKizbCqCx2+q9k/zKm/lKpf4QCLRPqXnG65gaJNoj5N2ZCx59h7NM2S/TET3aQ1 SgkyVz61fGRuTPP6bwHx/Jfhf5BtpgoRH+oWjJNHFtpjLtteE215iohAjzGOTwTQ31D1li9N2bYtW 8Wys0kFg==; Received: from 089144197153.atnat0006.highway.a1.net ([89.144.197.153] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAkpA-00Fpwn-1T; Mon, 11 Jul 2022 04:15:08 +0000 From: Christoph Hellwig To: Bob Peterson , Andreas Gruenbacher , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota Cc: Johannes Thumshirn , cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 2/4] gfs2: remove ->writepage Date: Mon, 11 Jul 2022 06:14:57 +0200 Message-Id: <20220711041459.1062583-3-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220711041459.1062583-1-hch@lst.de> References: <20220711041459.1062583-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org ->writepage is only used for single page writeback from memory reclaim, and not called at all for cgroup writeback. Follow the lead of XFS and remove ->writepage and rely entirely on ->writepages. Signed-off-by: Christoph Hellwig Tested-by: Andreas Gruenbacher Reviewed-by: Andreas Gruenbacher --- fs/gfs2/aops.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index 106e90a365838..0240a1a717f56 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -81,31 +81,6 @@ static int gfs2_get_block_noalloc(struct inode *inode, sector_t lblock, return 0; } -/** - * gfs2_writepage - Write page for writeback mappings - * @page: The page - * @wbc: The writeback control - */ -static int gfs2_writepage(struct page *page, struct writeback_control *wbc) -{ - struct inode *inode = page->mapping->host; - struct gfs2_inode *ip = GFS2_I(inode); - struct gfs2_sbd *sdp = GFS2_SB(inode); - struct iomap_writepage_ctx wpc = { }; - - if (gfs2_assert_withdraw(sdp, gfs2_glock_is_held_excl(ip->i_gl))) - goto out; - if (current->journal_info) - goto redirty; - return iomap_writepage(page, wbc, &wpc, &gfs2_writeback_ops); - -redirty: - redirty_page_for_writepage(wbc, page); -out: - unlock_page(page); - return 0; -} - /** * gfs2_write_jdata_page - gfs2 jdata-specific version of block_write_full_page * @page: The page to write @@ -765,7 +740,6 @@ bool gfs2_release_folio(struct folio *folio, gfp_t gfp_mask) } static const struct address_space_operations gfs2_aops = { - .writepage = gfs2_writepage, .writepages = gfs2_writepages, .read_folio = gfs2_read_folio, .readahead = gfs2_readahead, From patchwork Mon Jul 11 04:14:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12912798 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB807CCA482 for ; Mon, 11 Jul 2022 04:15:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229602AbiGKEPU (ORCPT ); Mon, 11 Jul 2022 00:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbiGKEPT (ORCPT ); Mon, 11 Jul 2022 00:15:19 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB63F18B3F; Sun, 10 Jul 2022 21:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=73WQtLAfublxnxlmb+ZkF+V6P0Xfh+eOQ9htm4JxrAc=; b=cQwfRLvK8KLMevw7oa8CBlZs/N nF4WHCExa93/t4A09tR6i7JU7ez49yjMLlm3AI5qyMOLvU+9dd9maeVyZqtMsIRjXPxYcVNi+rrUm Mtu5bS5TMZviK8kjNca4AH3Hi4f7Jsta30coKH2ncBgGPRnX1xqqhVRXvkcM0vzFsTypE8dEaSYem KSFedbiCq7tpHkaTcxxSmyBRyXk7WZoPG3l+EVXH487yrfqm3rmgDVeaEOs7K+9xbNoAP9TmQPHsf esUxA8OZsTcbNa4klMaIMnxJ3fXrbTNN0x6SxgxZunvAzQ1UbWu/U1urKPpsl92j2yQ0Ihp/BUazx 38r6vUOg==; Received: from 089144197153.atnat0006.highway.a1.net ([89.144.197.153] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAkpC-00Fpwv-RI; Mon, 11 Jul 2022 04:15:11 +0000 From: Christoph Hellwig To: Bob Peterson , Andreas Gruenbacher , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota Cc: Johannes Thumshirn , cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 3/4] zonefs: remove ->writepage Date: Mon, 11 Jul 2022 06:14:58 +0200 Message-Id: <20220711041459.1062583-4-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220711041459.1062583-1-hch@lst.de> References: <20220711041459.1062583-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org ->writepage is only used for single page writeback from memory reclaim, and not called at all for cgroup writeback. Follow the lead of XFS and remove ->writepage and rely entirely on ->writepages. Signed-off-by: Christoph Hellwig Acked-by: Damien Le Moal Reviewed-by: Johannes Thumshirn --- fs/zonefs/super.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c index 053299758deb9..062c3f1da0327 100644 --- a/fs/zonefs/super.c +++ b/fs/zonefs/super.c @@ -232,13 +232,6 @@ static const struct iomap_writeback_ops zonefs_writeback_ops = { .map_blocks = zonefs_write_map_blocks, }; -static int zonefs_writepage(struct page *page, struct writeback_control *wbc) -{ - struct iomap_writepage_ctx wpc = { }; - - return iomap_writepage(page, wbc, &wpc, &zonefs_writeback_ops); -} - static int zonefs_writepages(struct address_space *mapping, struct writeback_control *wbc) { @@ -266,7 +259,6 @@ static int zonefs_swap_activate(struct swap_info_struct *sis, static const struct address_space_operations zonefs_file_aops = { .read_folio = zonefs_read_folio, .readahead = zonefs_readahead, - .writepage = zonefs_writepage, .writepages = zonefs_writepages, .dirty_folio = filemap_dirty_folio, .release_folio = iomap_release_folio, From patchwork Mon Jul 11 04:14:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 12912799 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 124C5C433EF for ; Mon, 11 Jul 2022 04:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229608AbiGKEPV (ORCPT ); Mon, 11 Jul 2022 00:15:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiGKEPU (ORCPT ); Mon, 11 Jul 2022 00:15:20 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73C8E18B30; Sun, 10 Jul 2022 21:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=coXs7fZqtjdeX2Tzle8EdrF+O0+NaGLuimvWE8sIgts=; b=Tt6n//qoWHWsmWJA3vCeCXOqRg xzyPNEaoIqC67drpSr97P02ADJ9JuDeK40PKwOnc8R9i9F22UjtnxyMTdSP2Nw2xh+wSqfDNJtSDq RKItZpUL4YsBk4XYQdwq5mQNJ6QL92iY6CA2UNr+4mvW0VZAW8Sc48srasnlpQzllaw2mkX64eCDD 4VgIdVi6qe8YvEP0JByfBqzoUUOtCtUUDxyluN4lNdIeFKuR1ha6uOVctCoYO9D3tRaS6sEQmdo4E zJ0Tzo9RnYWIPcFJUk6N5W8j7AyYxcERNseBQO+93/yqMEhaiYxTEXqwoWc15ilSg8HJUBc2JDVeP qk63xVvg==; Received: from 089144197153.atnat0006.highway.a1.net ([89.144.197.153] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oAkpF-00Fpxf-Jo; Mon, 11 Jul 2022 04:15:14 +0000 From: Christoph Hellwig To: Bob Peterson , Andreas Gruenbacher , "Darrick J. Wong" , Damien Le Moal , Naohiro Aota Cc: Johannes Thumshirn , cluster-devel@redhat.com, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 4/4] iomap: remove iomap_writepage Date: Mon, 11 Jul 2022 06:14:59 +0200 Message-Id: <20220711041459.1062583-5-hch@lst.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220711041459.1062583-1-hch@lst.de> References: <20220711041459.1062583-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org Unused now. Signed-off-by: Christoph Hellwig Reviewed-by: Damien Le Moal --- fs/iomap/buffered-io.c | 15 --------------- include/linux/iomap.h | 3 --- 2 files changed, 18 deletions(-) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index d2a9f699e17ed..1bac8bda40d0c 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1518,21 +1518,6 @@ iomap_do_writepage(struct page *page, struct writeback_control *wbc, void *data) return 0; } -int -iomap_writepage(struct page *page, struct writeback_control *wbc, - struct iomap_writepage_ctx *wpc, - const struct iomap_writeback_ops *ops) -{ - int ret; - - wpc->ops = ops; - ret = iomap_do_writepage(page, wbc, wpc); - if (!wpc->ioend) - return ret; - return iomap_submit_ioend(wpc, wpc->ioend, ret); -} -EXPORT_SYMBOL_GPL(iomap_writepage); - int iomap_writepages(struct address_space *mapping, struct writeback_control *wbc, struct iomap_writepage_ctx *wpc, diff --git a/include/linux/iomap.h b/include/linux/iomap.h index e552097c67e0b..911888560d3eb 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -303,9 +303,6 @@ void iomap_finish_ioends(struct iomap_ioend *ioend, int error); void iomap_ioend_try_merge(struct iomap_ioend *ioend, struct list_head *more_ioends); void iomap_sort_ioends(struct list_head *ioend_list); -int iomap_writepage(struct page *page, struct writeback_control *wbc, - struct iomap_writepage_ctx *wpc, - const struct iomap_writeback_ops *ops); int iomap_writepages(struct address_space *mapping, struct writeback_control *wbc, struct iomap_writepage_ctx *wpc, const struct iomap_writeback_ops *ops);