From patchwork Thu Dec 29 16:10:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13083625 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 aib29ajc249.phx1.oracleemaildelivery.com (aib29ajc249.phx1.oracleemaildelivery.com [192.29.103.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70D1FC3DA79 for ; Thu, 29 Dec 2022 16:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=6ZNc4z7M7dM/wDzZd9AMQhLTSYEuVatI5SKI0qtttUg=; b=nTQIQfiGolyVanFRO3oIi6vetN75z3du6pkOBTlKhjtoiYfwavM2xgYDjrxirIRKTB82yJad5cfe hubgnc080mBoANv6ePUvt0o47c5mqtxnu1KNGJEjUMVrvfti9CxO4zpa6CAQe0mjA1jVrRxRFKLc vc1vTknKfT28RjKYEOCpXrpCurVdsTsldG5cfZuit9BUSzDmiai6i1aZNEQB1dJyZnu0Pbj6zL0h BWYUnHLveHsbYQdy3LC4FnEt03RjHg2kmG/yNFSOOpOQvHudDay3fbc3OBt8IaTGyYilbsixfaQv r91JRjJTjawiQwYiuSAOitkHM4Bw1hRMo4Y1fA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=6ZNc4z7M7dM/wDzZd9AMQhLTSYEuVatI5SKI0qtttUg=; b=dwQ2nxVJT9JdtJEpWjLeUG0LJJ8hnB6Q+NdjmuVTlILcAxe9Yhk/jMYy+5Es+CeblFfYiSPefjGs jXHCsEVS0+ss2qbE43YGGc6c2WEW115GtwQmk3HEVbxg+D2GdGRD2T5iFm0RuyG/9pC3B8t6IG5o iKgwiiqm+/z9WskVD2cyKCfKO4fJwMjDJuIphfhsFjgTNWD/x2w8ai2uNz60EnC8gE7x2WGbyor4 oPPlojqPSW/d9l7TlNXTuEfTnyARP3ZYyR3Cxbf0CnspxLVvqLSH4WpNBd47LHkXpWaWnAj0EQ/t 6uZazWmlO1smFejQZdjkqiuu2oul6+LEwHF/bg== Received: by omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20221212 64bit (built Dec 12 2022)) with ESMTPS id <0RNN009LXUASDK80@omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 29 Dec 2022 16:11:16 +0000 (GMT) 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=fEUbsjBI9KXdP6pghJ78AVl7+BFXIZGKll0p9tWCLUk=; b=t1S2jL2DHoW16PA0jk/pbHQHDg RBs4GhrpF9YeRdVoZ5tq9A1aPdJeOjq91lfo7o5iKcunokcstvPbjfOb5C1qHOTZBoAGzMEgZ25d9 C5o7gFDbOXlZVoosJgILi0a9I3LR4lGcXGGPpDxMY8Z08Fs+hik9wVwCAUkCmR2OV7rxGJJyr2hjp Zv4kGbTY2mD5jY+OJ8lwVOyAR4ZX1bDl+ikdrDdlU07hOw7f3AsQUBG1SNmOv77SPXjK1JIImv2No Dbh0w8jo37mco9XgGK5mLl24utTvSDtaTj3J5LiN5/5CGoVanfP2Q7XBUN+yCvVYGXOsn3vy9A0Al FxMX+glA==; To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Date: Thu, 29 Dec 2022 06:10:26 -1000 Message-id: <20221229161031.391878-2-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-reply-to: <20221229161031.391878-1-hch@lst.de> References: <20221229161031.391878-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10575 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0 priorityscore=0 mlxscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 clxscore=315 phishscore=0 mlxlogscore=289 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290133 Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, ntfs3@lists.linux.dev Subject: [Ocfs2-devel] [PATCH 1/6] fs: remove an outdated comment on mpage_writepages X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: NhaY5xrLI-_jUlckeuh7phIjpJA16Zdg X-Proofpoint-ORIG-GUID: NhaY5xrLI-_jUlckeuh7phIjpJA16Zdg Reporting-Meta: AAHyZQiea64e4PycuiHj5RiewnH3ccbqCIQt7WLyENpfrmnPNsvwcRaLyi+8Tu2C ERJxHT16gw2edOkE3yB344PJeIbQEa6YYJRnfbvUX1tL9VZlMEvCMqHK9cMFrdGg unVuBo414n2rG+trFlTb6aKEz/7DgwzUWrE11HWNgOez228Mjz4LdL/whhUp3lLz keOXCecd8bWcLlsSVaDlN1eibLeKE8nSzA4F+oBhIBdm9oYIpzblLkst8gHeseWu DsFHux28DDH7Opc6rpYC9OhcGl5JoJbHmayvJH3+gfPPN4Z5XWs9NmEzblkqc9HF uPiOO1n5HVlQLVUlNQls0rsxaJU2fx7koogr5xpdesV0+En956/CPmqotGCq0FSM oxOHHiTODWzbwOcgx0BpBqdSxD1jvJzr2lO9T6D56wouVt0OXVLB+pSvdvG/9cEN zTza5sIggTuAl/XQq8eLZcNZw3bsoiJNBZawmiZDIZQlK+dTz0let7Cmsc8l+HXM uHJjl+NuMecZtJNzPyaXkUsShLyw8YMNziUtvHeP1A== mpage_writepages doesn't do any of the page locking itself, so remove and outdated comment on the locking pattern there. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/mpage.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/fs/mpage.c b/fs/mpage.c index 0f8ae954a57903..910cfe8a60d2e4 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -641,14 +641,6 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, * * This is a library function, which implements the writepages() * address_space_operation. - * - * If a page is already under I/O, generic_writepages() skips it, even - * if it's dirty. This is desirable behaviour for memory-cleaning writeback, - * but it is INCORRECT for data-integrity system calls such as fsync(). fsync() - * and msync() need to guarantee that all the data which was dirty at the time - * the call was made get new I/O started against them. If wbc->sync_mode is - * WB_SYNC_ALL then we were called for data integrity and we must wait for - * existing IO to complete. */ int mpage_writepages(struct address_space *mapping, From patchwork Thu Dec 29 16:10:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13083626 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 aib29ajc249.phx1.oracleemaildelivery.com (aib29ajc249.phx1.oracleemaildelivery.com [192.29.103.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 52108C4332F for ; Thu, 29 Dec 2022 16:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=H2Fj5xVYqE5l3sIBmwgC5+WhRhpyrCiHvk1nIyPWnXw=; b=r/yygS2DvpNnT27DWF+RU/XSyd4gbTyFkU9AHS94kBlQkZCwVJsD1daCtJIcijR98e2x9yZ88FGK nq/AtYFtoJPUnhY36k+MTEe2M8jBdmPVVewUSqIdjX4JDcPcEyXk9AeoaAF49kIAH2LrGsKL4MLr 2RsWvT6vbFADL1ue3P2/o00CZvOvpcXfW2XUT9nJFGk4vqxviGJY3Rd0U3qfky+PVueMpszpBTvo vIuOk5GIV+K9miTfL5x4VJlazbjl/zjQMZpRQmFk6YG4+0m529JPP/gtu/o/jZrfl89QhYIkAYto mGp6XYExD9K0hJl3Y3jAvBidOJZ7jGgRzWEYYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=H2Fj5xVYqE5l3sIBmwgC5+WhRhpyrCiHvk1nIyPWnXw=; b=rhim3XBDrYQH+RK91A6IgjQHl15zvy13yB57ItDTINSiB7LwI7ZSJY2iXRibC62wRyXV23ooltKg SAk5XAuhLsDsJxz9CGGvXiwCz5xRXWyLZx6+gCqzoq02vKDY71W4fUJJMIjEW7oy9JA5hwPpeWB2 TrMEfGBBORWeD+cWP4mn+3roYe9T8RGRrcqvfNPCndPbgO/IEo2ByfuHXK7vELfukq/IhpvotwAH o11rm2sGwAWCuqtZWH7rQkIpw9isWfsFElnW1PUltsSpcct3Ukt2prJM9bEDRhS4ptAh3Go02Blp DGEpdIqjUZDMq5v+cIzPjyJ1JHfOmwjeOnpcqA== Received: by omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20221212 64bit (built Dec 12 2022)) with ESMTPS id <0RNN009LVUASDK80@omta-ad2-fd1-202-us-phoenix-1.omtaad2.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 29 Dec 2022 16:11:16 +0000 (GMT) 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=JERcZZTMhkivNxo9SqHrHtIaAsMqudDjGhUiCLjWNr4=; b=uEGqoJWMD+5m6rJC3ueg05BpdS yvzRe5kSxtpJEljm6rFhRT1KRo1MlimyyptGn9oxiqWwdzZsevEiRJQrIRs1dUZqZsBMxlA9BWQsg M60+EvxQ4N/NiSFx77YOHKWe18eT6imHat7MQ+wu+cwl1ZsHZTSOBC43DUrAKHZSnlSSZSqwN25fl 2xfzM4yW8GRHjwfPnIoPzDtp0qJrNfdyY8+uGVOXTBVIWPnbEUn981Z7rFSjcIz4HWuKxyiJ9WbEn sknQxfWX4y/0QjsHbAy7+s80zQxbjy4SGIct67u+X9EVRQv401lmk0efcwt/0lXTE79gy1wgzifMT RD2bgzOQ==; To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Date: Thu, 29 Dec 2022 06:10:27 -1000 Message-id: <20221229161031.391878-3-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-reply-to: <20221229161031.391878-1-hch@lst.de> References: <20221229161031.391878-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10575 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 priorityscore=0 bulkscore=0 suspectscore=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=670 clxscore=284 phishscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290134 Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, ntfs3@lists.linux.dev Subject: [Ocfs2-devel] [PATCH 2/6] ntfs3: stop using generic_writepages X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: kaRTEzunsbeKVTsZh7A2YGOxaQxfdHPM X-Proofpoint-ORIG-GUID: kaRTEzunsbeKVTsZh7A2YGOxaQxfdHPM Reporting-Meta: AAE5utTXX7uVUFD4c76gAyJnrTN2gzQJnuDb/BkpF2LbY52sIiLtbJPImYI+zKYb +JbX+9lRylVkNBQfj2dBLPcrmy1jcu6agUqd+wMdsLJA7jd5VEqcdqFCgplEjAiw YPwWF6vxXHPe8p4O6igpgnvNMROPdPm/zZtW/bu5A6ozLsOlKH058CaFK42l8s1X W8KkTyCSPkeC9OMvKThBhQ81LSttPcWteVFwV73JeCILX73W+GUT2zvgHZlJ4zg1 9vrADu3pY7uNy/58ib3gjD+UZs/akOPdcMH6rEhrbk+qoXvernpQ0YWpmIEvCSZP T6UL5unw4GvVCin2yRb+wvtQ/A1MIsEk4DonUxiTLX6+2qiYF74gJgnNQGcIX33S 9rbJ+3100dmxKwh9naH5e56BoF4KtaUbMyitA9bgo+2G0czU7PfFnF+KsGjPlkIo 52ePBViiI3aARCYMB7LgDmI43JskmzS0WRVNe/Rv+feIxmg2dgKYdyrDTQsfIrE/ JxxuqVFnPJuF/3+hTkWx6nlv4tCFq7136EFkaXrn5Iw= Open code the resident inode handling in ntfs_writepages by directly using write_cache_pages to prepare removing the ->writepage handler in ntfs3. Signed-off-by: Christoph Hellwig --- fs/ntfs3/inode.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 20b953871574b8..b6dad2da59501b 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -852,12 +852,29 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc) return block_write_full_page(page, ntfs_get_block, wbc); } +static int ntfs_resident_writepage(struct page *page, + struct writeback_control *wbc, void *data) +{ + struct address_space *mapping = data; + struct ntfs_inode *ni = ntfs_i(mapping->host); + int ret; + + ni_lock(ni); + ret = attr_data_write_resident(ni, page); + ni_unlock(ni); + + if (ret != E_NTFS_NONRESIDENT) + unlock_page(page); + mapping_set_error(mapping, ret); + return ret; +} + static int ntfs_writepages(struct address_space *mapping, struct writeback_control *wbc) { - /* Redirect call to 'ntfs_writepage' for resident files. */ if (is_resident(ntfs_i(mapping->host))) - return generic_writepages(mapping, wbc); + return write_cache_pages(mapping, wbc, ntfs_resident_writepage, + mapping); return mpage_writepages(mapping, wbc, ntfs_get_block); } From patchwork Thu Dec 29 16:10:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13083628 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 aib29ajc255.phx1.oracleemaildelivery.com (aib29ajc255.phx1.oracleemaildelivery.com [192.29.103.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 79861C5479D for ; Thu, 29 Dec 2022 16:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=W0Z672HmWyexyAJDpYlpLojrS36XIebTzIVLTMA0ZEE=; b=ZeAZlthLjWVJpdvl9MOTRt81Gvdj6H959EViQaagkWVPNoxIHm7ps6dpCWGw5/7xOfYgMoHVMdoZ w56FPoMIu1Y8UlLd96s0uitKqH9jFhDX55jikYnyXYTpb2xPIZyVXdUIOielfjHk6XZfIx9JweEh XU50X9H2rnSplKt29Se4b7nQDrXIjtYKv8zQ4l87Wu9wTAJOtOrRNxIN9pmsotD32ZL0DTpkxnzX EuNB4QAtZ4fptxWgYqRJKRhXlV8Dc+Bf859YqLT3kOCSaP7THPleXLjbLPSOFF+Ws9t2ef7MG/4x cUxCbp2HL2Wc/Y+x7HhaDOBnN7Yn3aPJidvm3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=W0Z672HmWyexyAJDpYlpLojrS36XIebTzIVLTMA0ZEE=; b=qRzqGkY1kU7/URRdB0HauneT04n3Eyr3iR60wm79CoUITIFxpTRJPQL6uRzs5f25/gZ4i/m/V7v1 BjN97Wp4svB57uY2mqxteEE5H1ZwVsKz2THUUVor6sp8Yas5YjxzPxZupP3RQGFHVt33GpBukWSq Vtr3JTwugGc8onEgfqAl2IZRHTjPOclj4DZG4aeu33jqcrNjNduv4LgL5NTcnI2SM+2gM9uj9+Kl hZak19+dRZ09EmvpTotQ0Q7OScnocFlZN49bC/pM+dzUNwwVQ/4OYicHU34QZrfZ7JsH//HKJrEB i+k4tS23pjbpDzjDQXKe27Zt/66tE1UIwZzC8g== Received: by omta-ad3-fd3-302-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20221212 64bit (built Dec 12 2022)) with ESMTPS id <0RNN008MHUAWGW90@omta-ad3-fd3-302-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 29 Dec 2022 16:11:20 +0000 (GMT) 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=eT+sezI7d2puBXhZ4YXeV63r+1dsBpxvT2Biv2ttQVQ=; b=CjvMuzxosYlfRlZyUreZne6XPB dsdBq4zBXheihbIMeS2ElpPTfep1aHkMTppG3M9VXX4j+hrA3xvtALTE1dKDVbJgRn/XvkK/3Msrn eRjanXTfUV2tQLntyRky0Y45cs55uEBTGho1aZPsQTGJpBqr2gp8OczZvzIPd7cAKsgsAgklZY9FQ FEEuCyiJxEnEmUr/V2rgzMmvgzew8LKBMJNo7Oyt/vdAD0gMTeR9itSequwor3zkWmBFvviZhw2/L 3RcxZFmAbPj3p5oC0BZZeevS6/3SpWkUk7D8U9SkyP0scecn/DuasxSAYYvxJaL3SKNKWGwJwUZD5 VE++S3Bg==; To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Date: Thu, 29 Dec 2022 06:10:28 -1000 Message-id: <20221229161031.391878-4-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-reply-to: <20221229161031.391878-1-hch@lst.de> References: <20221229161031.391878-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10575 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 bulkscore=0 impostorscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 phishscore=0 clxscore=287 priorityscore=0 mlxlogscore=773 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290134 Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, ntfs3@lists.linux.dev Subject: [Ocfs2-devel] [PATCH 3/6] ntfs3: remove ->writepage X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: xM5o69Jl2lwEJpO1Lip0AT_PGOEfY9f0 X-Proofpoint-ORIG-GUID: xM5o69Jl2lwEJpO1Lip0AT_PGOEfY9f0 Reporting-Meta: AAEPLI6k0WmaiCZeUqwudezYIhQVmH5X1uJFY2ZxEWu81blP1FJ48SvXcjhVQrKv wtJQjFnGG4zDaT+PSrxPTZoHVaNXTm58OOdep/lVZ+2nyN1WNHiQEf7PkmfE5aQD Vbjl3jwrDchCiR3kfT+vGRg9wgrZXOO8uzeBMRrJ/P9d/EIqOjikhTyOP+8mWtqO UICLDTmuR8K9P89oXuug3w/tNsbYrcWZ9HPGToUa87ZNm9iEnRbXhER54VW2q/Zw eay6aTelVXcPaFYgUeOwOr/nIXOJnWgVRTJMmK6M8Hpy51AbcJqYnv0lrLi7NcxU m3WhFbHhTjYz7wSTXTuMmq9OLLOugIIFo9fV65UEjppiVkaXyVyjNTWIwENrH1R8 X6aMLnNhNhW48IAP75WGoV0l/ZTzvniw7zbjHh4Ao2nCfelbJ+cr8FYTA+xPz5g4 LeR5JJiQYpl1iiQks2nbXkidEdunm38d7VXyKp75FG0vKAXDIY7lQczRnH3qX6K+ LxvU2g7txtJzsh43g5BKQdJ5ZMCeI++nZrHR3mjX+bKv ->writepage is a very inefficient method to write back data, and only used through write_cache_pages or a a fallback when no ->migrate_folio method is present. Set ->migrate_folio to the generic buffer_head based helper, and remove the ->writepage implementation. Signed-off-by: Christoph Hellwig --- fs/ntfs3/inode.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index b6dad2da59501b..6b50b6e3237876 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -832,26 +832,6 @@ int ntfs_set_size(struct inode *inode, u64 new_size) return err; } -static int ntfs_writepage(struct page *page, struct writeback_control *wbc) -{ - struct address_space *mapping = page->mapping; - struct inode *inode = mapping->host; - struct ntfs_inode *ni = ntfs_i(inode); - int err; - - if (is_resident(ni)) { - ni_lock(ni); - err = attr_data_write_resident(ni, page); - ni_unlock(ni); - if (err != E_NTFS_NONRESIDENT) { - unlock_page(page); - return err; - } - } - - return block_write_full_page(page, ntfs_get_block, wbc); -} - static int ntfs_resident_writepage(struct page *page, struct writeback_control *wbc, void *data) { @@ -2083,13 +2063,13 @@ const struct inode_operations ntfs_link_inode_operations = { const struct address_space_operations ntfs_aops = { .read_folio = ntfs_read_folio, .readahead = ntfs_readahead, - .writepage = ntfs_writepage, .writepages = ntfs_writepages, .write_begin = ntfs_write_begin, .write_end = ntfs_write_end, .direct_IO = ntfs_direct_IO, .bmap = ntfs_bmap, .dirty_folio = block_dirty_folio, + .migrate_folio = buffer_migrate_folio, .invalidate_folio = block_invalidate_folio, }; From patchwork Thu Dec 29 16:10:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13083629 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 aib29ajc246.phx1.oracleemaildelivery.com (aib29ajc246.phx1.oracleemaildelivery.com [192.29.103.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C2E96C4332F for ; Thu, 29 Dec 2022 16:11:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=HSVGpxVbvKBPr/2abtkI+0mtnwiSKakf3UvSz9wZ2WM=; b=ZcCcXJ/qM40tuQpnp5TOHdCOI86LUl72UNN8yOyUBKOhM6qufRSwRIg9Qnbx53ziL4sApkgoDYkS HkOHI6rOdEa1R3oJ7rYTNTBWvasoPMWdl5HCsHH36gS1rUi8bJYvxqnSjXf0tdDQdVRT/JnDpPSq oMUdYZwH+bOqpet3JqDtbiGxTbQLMNjBgnwW8ExPSlTnTAIlQFMh0P2WYdAB/2XWgu2EkkEP8vJs VqVYkpofEaEI4xiwt5NKfLKTNk8bMZM1DOFfFgNMONzx40OmppAvv4Jj67TLzWWmN+GOavPvZqVO VdsMl88cwKeTR586vghkRhJOZrMtZdCLZn26zw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=HSVGpxVbvKBPr/2abtkI+0mtnwiSKakf3UvSz9wZ2WM=; b=D9AqPqX0Zn87fj/Gh/yO/ZtTAVoPiYoO2ujPrnQeAdCBILQOWTnE24UMK4Kjz5aDGq9odwIv+vT/ EyN9vvNjvPOimQVF57UUbfJE7tky1tEYBAghFlYBetYnWqmi6j6VQfCWUNxSScI7Lx7gQHIsvr24 ZkHNN7V8+eDZhDnmf5sXTtJBdNrquY2J6nCMUO8pf0OM0fMS/4HFUoyxy+6ALjBeMIEMHl21lWZT uK7ygg6Mi6sLmzFFbx2mBEPfINJxbECNtFjf40wyxDp2i+T0CpzB1ec4Tapkk1o2/YUI1CIBlcjq wdCy3hyIV40/WXGbvK0bfPiI5KMIcB4ogUAGzA== Received: by omta-ad1-fd3-101-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20221212 64bit (built Dec 12 2022)) with ESMTPS id <0RNN00H23UBSQT30@omta-ad1-fd3-101-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 29 Dec 2022 16:11:52 +0000 (GMT) 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=wAGRF3f2s+7CXmKUNt5mcDbE20Oprr4M4XP/Y6UM90M=; b=MMpycC1KT21omSKtBmc7e4cD91 Iur3yD3HgzJ5iMdxiVKkR1ZdnMKaHYh0D1Nuka8SBPXLYXNDFOPUPjutKy047FuX/hr9iOVGjIu9G vu3jWyTLYTkn/q4qayrFVqWDQ2qLCxTbqGz5nuJK5RFkoxrMb3jAWruQSKfi5SiDLwNsh91m401s5 +s+QGTNiigo0NptVFmx9P5DRo4sVO5VktSXZkS2NhcU0aJuEjy0pM6MAIkyfURfefHDrd7Z2txVZo W9YfXAgZI90nQqdDcVsuZpNNtkWPWnZ6Ntxlpx6YlHstNPYDMflBh8RUxWsqi/L9Tx/1r9azMHKHQ JUeQZujQ==; To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Date: Thu, 29 Dec 2022 06:10:29 -1000 Message-id: <20221229161031.391878-5-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-reply-to: <20221229161031.391878-1-hch@lst.de> References: <20221229161031.391878-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10575 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0 priorityscore=0 mlxscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 clxscore=236 phishscore=0 mlxlogscore=881 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290134 Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, ntfs3@lists.linux.dev Subject: [Ocfs2-devel] [PATCH 4/6] jbd2, ocfs2: move jbd2_journal_submit_inode_data_buffers to ocfs2 X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: NfsWqDHCwxBk9jqHgKlMIYRqVC25H4s8 X-Proofpoint-ORIG-GUID: NfsWqDHCwxBk9jqHgKlMIYRqVC25H4s8 Reporting-Meta: AAHQ80d/jf7Klzsz/7OS8oWPHgwtjedLyhVuAGqauGkEmmDM2GEL9lMNBedZawc7 7D6YHfQ32/wxSzt583P0FXB8UWJw7XisRLlkslMgQRZ60pMaTfW9tMNeaICtrkLP 1UQEAXPlpIMd7luoic1EDQmZ8NxSmLaYQVuxkW/M2MDqhmZJLyAC+RbQwaA0hC+l MTheHBIZM0Xy8o8MOkb4cdvMPgu9gkwZIBHkDmnzaTVzijqrxeUZ3/VV8rsEcO3T QlF5oSkIyY5/4Ug98QA265AtRcTUEljoFHmPWMhX0Tma1bfGMU3Yrmxs3GurUvN3 X5YgZlGnSxSAX9ceLWBpmZG0ue76qzRh+HNrlwDTuVv7aOwBtktdN6l6Eh/Gu9t0 jHp6EKAee80GJqODXA/41xse81fOQJ/l12r/kmbxbTowvXNWBWCDXCPSR8dT6Zn0 nR2/I6CemorfgLFJ5yi3heHlXh72IxeE928nP+EqBBG3SrVuLxYZkVwG9jrIFRW2 th1SOvcWLnAcOV7ViTC0xJIZ3zIR9efYcsGcpzqSGYY= jbd2_journal_submit_inode_data_buffers is only used by ocfs2, so move it there to prepare for removing generic_writepages. Signed-off-by: Christoph Hellwig --- fs/jbd2/commit.c | 25 ------------------------- fs/jbd2/journal.c | 1 - fs/ocfs2/journal.c | 16 +++++++++++++++- include/linux/jbd2.h | 2 -- 4 files changed, 15 insertions(+), 29 deletions(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index 4810438b7856aa..aeee6b8a6da218 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -181,31 +181,6 @@ static int journal_wait_on_commit_record(journal_t *journal, return ret; } -/* - * write the filemap data using writepage() address_space_operations. - * We don't do block allocation here even for delalloc. We don't - * use writepages() because with delayed allocation we may be doing - * block allocation in writepages(). - */ -int jbd2_journal_submit_inode_data_buffers(struct jbd2_inode *jinode) -{ - struct address_space *mapping = jinode->i_vfs_inode->i_mapping; - struct writeback_control wbc = { - .sync_mode = WB_SYNC_ALL, - .nr_to_write = mapping->nrpages * 2, - .range_start = jinode->i_dirty_start, - .range_end = jinode->i_dirty_end, - }; - - /* - * submit the inode data buffers. We use writepage - * instead of writepages. Because writepages can do - * block allocation with delalloc. We need to write - * only allocated blocks here. - */ - return generic_writepages(mapping, &wbc); -} - /* Send all the data buffers related to an inode */ int jbd2_submit_inode_data(journal_t *journal, struct jbd2_inode *jinode) { diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 2696f43e7239f8..d331f6ece20a28 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -89,7 +89,6 @@ EXPORT_SYMBOL(jbd2_journal_try_to_free_buffers); EXPORT_SYMBOL(jbd2_journal_force_commit); EXPORT_SYMBOL(jbd2_journal_inode_ranged_write); EXPORT_SYMBOL(jbd2_journal_inode_ranged_wait); -EXPORT_SYMBOL(jbd2_journal_submit_inode_data_buffers); EXPORT_SYMBOL(jbd2_journal_finish_inode_data_buffers); EXPORT_SYMBOL(jbd2_journal_init_jbd_inode); EXPORT_SYMBOL(jbd2_journal_release_jbd_inode); diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 3fb98b4569a28b..59f612684c5178 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -15,6 +15,7 @@ #include #include #include +#include #include @@ -841,6 +842,19 @@ int ocfs2_journal_alloc(struct ocfs2_super *osb) return status; } +static int ocfs2_journal_submit_inode_data_buffers(struct jbd2_inode *jinode) +{ + struct address_space *mapping = jinode->i_vfs_inode->i_mapping; + struct writeback_control wbc = { + .sync_mode = WB_SYNC_ALL, + .nr_to_write = mapping->nrpages * 2, + .range_start = jinode->i_dirty_start, + .range_end = jinode->i_dirty_end, + }; + + return generic_writepages(mapping, &wbc); +} + int ocfs2_journal_init(struct ocfs2_super *osb, int *dirty) { int status = -1; @@ -910,7 +924,7 @@ int ocfs2_journal_init(struct ocfs2_super *osb, int *dirty) journal->j_journal = j_journal; journal->j_journal->j_submit_inode_data_buffers = - jbd2_journal_submit_inode_data_buffers; + ocfs2_journal_submit_inode_data_buffers; journal->j_journal->j_finish_inode_data_buffers = jbd2_journal_finish_inode_data_buffers; journal->j_inode = inode; diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 2170e0cc279d5c..5962072a4b19e6 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h @@ -1570,8 +1570,6 @@ extern int jbd2_journal_inode_ranged_write(handle_t *handle, extern int jbd2_journal_inode_ranged_wait(handle_t *handle, struct jbd2_inode *inode, loff_t start_byte, loff_t length); -extern int jbd2_journal_submit_inode_data_buffers( - struct jbd2_inode *jinode); extern int jbd2_journal_finish_inode_data_buffers( struct jbd2_inode *jinode); extern int jbd2_journal_begin_ordered_truncate(journal_t *journal, From patchwork Thu Dec 29 16:10:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13083627 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 aib29ajc247.phx1.oracleemaildelivery.com (aib29ajc247.phx1.oracleemaildelivery.com [192.29.103.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 812C4C53210 for ; Thu, 29 Dec 2022 16:11:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=LRHDQHHyabiNo5WYQJIbvdIF+weHpcIRO6qf29/SB1w=; b=pcUuKCsFMnYqP8wKdsKorq2zTMR1viOemmvkSsA0KECzjByRLDMczprSDOxuOQD7iIX0CL0TsaxZ kGKf2z3qs4oTEW0PZ8QsBEgWoA3STlrjB5zvOVRLsahKx1/CxIK2y7xCMmJ/GA/e4RcbuxsZ3Hp/ kXQ2B4Y5EVVFKY42U0Ki7jgjA6lkV6aAUmltYb176xHkVZcbjNDoRNtW4nIMGKM3Uil05SOoGMyr eypV3p+3h8oLb/xxdSzQokNC5Ipr8tyvjBmp2EmBgBmt2oR4bp6FYE2oCMQLXqBLBvzuGGLZsreQ TfIwDHK1inwlvoKLqkK7AcRHpAiOH6KdHOYh+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=LRHDQHHyabiNo5WYQJIbvdIF+weHpcIRO6qf29/SB1w=; b=qFcVk1fM/2iDUsoVuO48/Ma6XbZGEw5gv93spjcAG4O5ew71zhrkjdWopILbrLV5y8Lioym3hWfd dyzBjfI0lfLRE1vm+6DRQ1jAluNFAYNQeX4PnFt0kyVvqn3990F1qhwSgifzvwq638gzGsrGD7dV 0YYodrFBhhTj1oT3Th55VCaAEP1ZAeBxIVKnhgSnBH3lwoF4e/avUPn85V+h6WEmnKnW9v8Nb6SF /xkt8O6nrFVEE2SqFcU1303NqhW/h8gId0oP8kTcOh1K6ZR22i4kCN3u/kp1N3Kzvo1pp2PotKag gJyVSN4kA0SMxc3Bcw0SvTEHnozNoWQJfb16bg== Received: by omta-ad1-fd3-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20221212 64bit (built Dec 12 2022)) with ESMTPS id <0RNN007DKUAULLB0@omta-ad1-fd3-102-us-phoenix-1.omtaad1.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 29 Dec 2022 16:11:18 +0000 (GMT) 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=/OSTms68IPUXcD9mOyJwWhvTFEvxpirJZnFVgrc7HRI=; b=mG3Xd47oTUQecGZV2lFfDakfTy v9T6b0WubaweFmczUE/fgvx9Ej4TE34uR+iCTgXqcWAZEtr4nOwjmIu7RgbAexm9fF0FQQClyljLk 26JoH5gI1K+5QiVdrRypcrfvoceq4NJW/JTha943AxPSp195deUacqWMuM6Hw4hLbyFsR5+6RgEUA Fn1sHTGv69ttZMtXYF7gIJkwL61CE3QVKLKPdS29QXQgMpfIwoP5p45q41XYs+lhHGRJDhPj5r0sc mLVdGFgskkvDGn9spGCbLcJnva/V2khDSMNj+mzAJRxEDup9kUduZRBnmm9ZYAUWooRXugVtUAP2G kI54fxzg==; To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Date: Thu, 29 Dec 2022 06:10:30 -1000 Message-id: <20221229161031.391878-6-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-reply-to: <20221229161031.391878-1-hch@lst.de> References: <20221229161031.391878-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10575 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 bulkscore=0 malwarescore=0 adultscore=0 priorityscore=0 mlxlogscore=658 clxscore=290 phishscore=0 mlxscore=0 suspectscore=0 impostorscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290134 Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, ntfs3@lists.linux.dev Subject: [Ocfs2-devel] [PATCH 5/6] ocfs2: use filemap_fdatawrite_wbc instead of generic_writepages X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: ylolPSY89h4pZeG7YneEdmhI75KZRG3A X-Proofpoint-ORIG-GUID: ylolPSY89h4pZeG7YneEdmhI75KZRG3A Reporting-Meta: AAEM73KeuUriWhjOM4eR9M47NaGqQERRv3XC96Z3qLKWSziNQ0LxZW9496A3P7M0 avf47oBkNO+009jH2Z3O2rC9aWNl3Tmq6Y6oKfSWMC5cDcf5GwKWSHdCJuH6aUBZ zgJwyzSn4ejNPDimK5LL9EHObo4RbKgTothwIQtJp2ZZu8o7vDrBhiVgUZYny4iQ eDui3lFY2LPnJHM1ZvjZoyic4aMcBgpA6qqMfmY7vGpBiHucEZ1ak8Ffy4i4kHJV df4fMQreLfPjikarIyJRQcwzre9ySsvG51GpNF9bjJRbDGasm1EjRhS5bvXXOLTr suT69ZvZ+Zn9SDL0YkHaQXrLAtvq26sqMZ2kbD9lbw7YgNWOVj8EKpyau9Iba2Wt ImVXuz0w/2pCfs3fKiJI7m9+INkonZWCMy3K1Jr+6ZHi8Y9s/E+f8+7dAv4p2mF4 P3M2kIs2iwTH27AUFl1GskVVI/CCVPERO1IYh7O0offEUupzg8/umXrxuccuGfF8 A0zN6QXg1ND8yWjw4S5ZwJazzl0tMUKuD7PRlUebIETE filemap_fdatawrite_wbc is a fairly thing wrapper around do_writepages, and the big difference there is support for cgroup writeback, which is not supported by ocfs2, and the potential to use ->writepages instead of ->writepage, which ocfs2 does not currently implement but eventually should. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/ocfs2/journal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 59f612684c5178..25d8072ccfce46 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -852,7 +852,7 @@ static int ocfs2_journal_submit_inode_data_buffers(struct jbd2_inode *jinode) .range_end = jinode->i_dirty_end, }; - return generic_writepages(mapping, &wbc); + return filemap_fdatawrite_wbc(mapping, &wbc); } int ocfs2_journal_init(struct ocfs2_super *osb, int *dirty) From patchwork Thu Dec 29 16:10:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13083630 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 aib29ajc253.phx1.oracleemaildelivery.com (aib29ajc253.phx1.oracleemaildelivery.com [192.29.103.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36EA5C4332F for ; Thu, 29 Dec 2022 16:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=oss-phx-1109; d=oss.oracle.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=GeQfdYvozUDNS9fH+EZ2NRwPS1wBjbBUQnlHHBUQClo=; b=Oq4EsCY7coaxR7jpcWQj5eGJW7wNsyDobF9W4FuHkEv7Wax5bMOjGaLAHbh0+HygPC/Cp8kVK9W8 RYPvuGWWHHuKuieqBumLJRfL5x2MyXLjC4WhyASUBSxxVOZ+WrP80s+E5hIC3nerOADDWU5+ikUD 75/Qqb4CZqyhfDIhMGCn7oLAXf+zBFfo4UllQQvuwrpZRYH7qsEPGF6Axf0FRfk4l0ASdsHbSVZW PWEcCw0Y/mw31hbgixnxrj4jPJbEWXkCipHfb9fYJtlVot45ApuSUSTj6z8kB3G0JYmvTbhZIDK7 b7+cW10mtzs+t82JbVOcvEgt9ReRNbYq1HeBgg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=prod-phx-20191217; d=phx1.rp.oracleemaildelivery.com; h=Date:To:From:Subject:Message-Id:MIME-Version:Sender; bh=GeQfdYvozUDNS9fH+EZ2NRwPS1wBjbBUQnlHHBUQClo=; b=ZGsmZNYYVkv86IGMKKBvWwYD4GLTBz1PY+ur9F/i8ncC01J9wg3COgxG8Tra7mILxyGS/nO9UAzx qrcoazLLVxuCYkmWLrjJYzBk2DXDcH5VmsRXZDj37UDl6PZbpQTCCoZibhQGC9Qm/IOCh5T+R4xJ PsK+nd7dxtih47YEnGaeNyZzym9FelW3lG7pMWeHC7mQc1cBv7tTqY46GhmmvAoLYXfGUamId1N8 WF7TfMzPAIhoNypVvY5P8sJJtXOmO2izGLEDcFQ+z8M5DguWnnpfZNSg9+WGXd/twFknoBsaixR1 EBV/ziFHm6uFYTuQXBdqNGbZ8uMm3CfWfRdV/Q== Received: by omta-ad3-fd1-302-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20221212 64bit (built Dec 12 2022)) with ESMTPS id <0RNN009PCUHVRCA0@omta-ad3-fd1-302-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Thu, 29 Dec 2022 16:15:31 +0000 (GMT) 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=x4y/4KuqfNuPAflIAi82X++2iXzPIgIv4Sol4IXfpIE=; b=hCkiJn6NwipyF95xZ/GfQjLDmb Si4sdlVrqYhOzIyOHDvE4X1IaWOLKGwwB/WyfjcmVjqFBn391Tx3NsE4ImwHez5KUQC/YOtFnd3mB r0I/7KTgno8i5rUd8vWxs5M/4cUs5R7OBibrzqx9/lV/aVXxlt4uKk9q1q5ScZ1TEx6FqrKHPk9Ow 3MypnruGXVZJgQEhTyB8WJmJjakTwGYd+3QT1gdqttF5scQ2eSbdXz50yJDorlrrXTwZmCZInLwjR YllxS++9Um0yVvQk5aqOUb7TRQl9yf2UWXnv73HmIV5RLJGI6TFAVilzX/ndLItpgvO2wMHJZDKsO xGCE/zIA==; To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Date: Thu, 29 Dec 2022 06:10:31 -1000 Message-id: <20221229161031.391878-7-hch@lst.de> X-Mailer: git-send-email 2.35.1 In-reply-to: <20221229161031.391878-1-hch@lst.de> References: <20221229161031.391878-1-hch@lst.de> MIME-version: 1.0 X-Source-IP: 198.137.202.133 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10575 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 lowpriorityscore=0 malwarescore=0 impostorscore=0 bulkscore=0 mlxlogscore=458 adultscore=0 spamscore=0 priorityscore=0 phishscore=0 clxscore=287 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212290134 Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, ntfs3@lists.linux.dev Subject: [Ocfs2-devel] [PATCH 6/6] mm: remove generic_writepages X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christoph Hellwig via Ocfs2-devel Reply-to: Christoph Hellwig Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-ServerName: bombadil.infradead.org X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-GUID: 1bwq1rXQ67y7GPdl7CUjASVZ_KUt-Q0D X-Proofpoint-ORIG-GUID: 1bwq1rXQ67y7GPdl7CUjASVZ_KUt-Q0D Reporting-Meta: AAEPLI6k0WmaiCZeUqwudezYIhQVmH5X1uJFY2ZxEWu81blP1FJ48SvXcjhVQrKv wtJQjFnGG4zDaT+PSrw5TpoHVaNXTm58OOczKbkXpUBolg68GHV7nRtLmbyZWXC6 8gf31ZX4xFRMLY1aVfJ4sc2PGb4sYMdKnFVVs8vvkgg9oJs6ID6JteHuIwMtUeTL RQ74t88Rw2nY7OyK2vsGoOUqis6RzWaZhzjweFOnYJo/x3re2SzQFc9t8Y8lOToz mpV4EZ08Op8TgoVU+CytyZe+tuLxWjLbNXT9A8eZjWhweTEUWRAo7fujmkdyjKLC vXDEO5NBl0mkWNQfEZKbT4jRSCPk3bDapNfScD6dKbk1DEE86A11yyVsq/cip2aO sqvA/v6qCPsaCFV6DV/erk28hf9GUkYOlo0yFDuLdktN1VMW9rmQQ3tgFdWRyQVk Ndpq/aXHJ3n/8gGRtyvsXDuojiF02LBGNb00yIYvEysNOeiTIfm8QiUQdAQljVQ2 NNRCoVMhh8dYxXIdqNCN6/7BXKWc/5AGIMxoNPKrEQ== Now that all external callers are gone, just fold it into do_writepages. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- include/linux/writeback.h | 2 -- mm/page-writeback.c | 53 +++++++++++---------------------------- 2 files changed, 15 insertions(+), 40 deletions(-) diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 06f9291b6fd512..2554b71765e9d0 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -369,8 +369,6 @@ bool wb_over_bg_thresh(struct bdi_writeback *wb); typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, void *data); -int generic_writepages(struct address_space *mapping, - struct writeback_control *wbc); void tag_pages_for_writeback(struct address_space *mapping, pgoff_t start, pgoff_t end); int write_cache_pages(struct address_space *mapping, diff --git a/mm/page-writeback.c b/mm/page-writeback.c index ad608ef2a24365..dfeeceebba0ae0 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -2526,12 +2526,8 @@ int write_cache_pages(struct address_space *mapping, } EXPORT_SYMBOL(write_cache_pages); -/* - * Function used by generic_writepages to call the real writepage - * function and set the mapping flags on error - */ -static int __writepage(struct page *page, struct writeback_control *wbc, - void *data) +static int writepage_cb(struct page *page, struct writeback_control *wbc, + void *data) { struct address_space *mapping = data; int ret = mapping->a_ops->writepage(page, wbc); @@ -2539,34 +2535,6 @@ static int __writepage(struct page *page, struct writeback_control *wbc, return ret; } -/** - * generic_writepages - walk the list of dirty pages of the given address space and writepage() all of them. - * @mapping: address space structure to write - * @wbc: subtract the number of written pages from *@wbc->nr_to_write - * - * This is a library function, which implements the writepages() - * address_space_operation. - * - * Return: %0 on success, negative error code otherwise - */ -int generic_writepages(struct address_space *mapping, - struct writeback_control *wbc) -{ - struct blk_plug plug; - int ret; - - /* deal with chardevs and other special file */ - if (!mapping->a_ops->writepage) - return 0; - - blk_start_plug(&plug); - ret = write_cache_pages(mapping, wbc, __writepage, mapping); - blk_finish_plug(&plug); - return ret; -} - -EXPORT_SYMBOL(generic_writepages); - int do_writepages(struct address_space *mapping, struct writeback_control *wbc) { int ret; @@ -2577,11 +2545,20 @@ 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 - ret = generic_writepages(mapping, wbc); - if ((ret != -ENOMEM) || (wbc->sync_mode != WB_SYNC_ALL)) + } else if (mapping->a_ops->writepage) { + struct blk_plug plug; + + blk_start_plug(&plug); + ret = write_cache_pages(mapping, wbc, writepage_cb, + mapping); + blk_finish_plug(&plug); + } else { + /* deal with chardevs and other special files */ + ret = 0; + } + if (ret != -ENOMEM || wbc->sync_mode != WB_SYNC_ALL) break; /*