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: 13083621 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 4893BC4167B for ; Thu, 29 Dec 2022 16:11:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CBDDA8E0007; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9644B8E0002; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71C478E0006; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 494258E0008 for ; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 2360280E96 for ; Thu, 29 Dec 2022 16:10:59 +0000 (UTC) X-FDA: 80295832638.23.0EAEFD7 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf22.hostedemail.com (Postfix) with ESMTP id A6152C0013 for ; Thu, 29 Dec 2022 16:10:57 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=t1S2jL2D; dmarc=none; spf=none (imf22.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672330257; 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=fEUbsjBI9KXdP6pghJ78AVl7+BFXIZGKll0p9tWCLUk=; b=P1haGkTr8zPyrzIsDL5gXcW7dlWOYf6dEaMLUv2VUie/OLXm50+CxIM12QkaqnyS70Vkj4 HS9VEn7K5L9p3BDYqP3WFHAQrpFsgWkEjs61XYsHRSuXQP3IOZCwnKb9ivvfoggnmDaARi kWtbs2GsjFGgrWm2oAkzHbpLhkKw5xA= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=t1S2jL2D; dmarc=none; spf=none (imf22.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672330257; a=rsa-sha256; cv=none; b=bISdRc/fBt2aVRL0aOtrow0Ybnfe3V/LqQciHX7c4t36xo/crFEqRX9a1NJ6s0+Z/c7LvP 5mSAYZNNuyl44uk9vqMD755klRJM8RQUB1r3xxth3IIuO7d1WUY5ZzKhf6SaSWmA5JfOGI wgxo6qowRTpZ3uZDiBiG+KVJOCh0mRc= 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==; Received: from rrcs-67-53-201-206.west.biz.rr.com ([67.53.201.206] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAvUK-00HKL2-18; Thu, 29 Dec 2022 16:10:36 +0000 From: Christoph Hellwig To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: [PATCH 1/6] fs: remove an outdated comment on mpage_writepages 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A6152C0013 X-Stat-Signature: yukrskou1aiarza47oduwgbkqxh4bf7z X-HE-Tag: 1672330257-825957 X-HE-Meta: U2FsdGVkX18l7veJe4l9uyYH1r3zqmM2ukYmdeHdJrOoJs7eOVFVKP3i4e9bL6pgJ6IXUB814UxlFzboebcirj3okb1Y8hm4EN3lyKh2Z4R38DnZIVREhZsZ/RNSj8dBOMRzRr1kA8l1kqeIn1jGLsmh+AqqhBqcRe7J/GmpuxQZ/uNRA7dg4eBHdyA2QuSgIne8hspmutcmi/fBCgHIruiWBsC7pIBRRattjM47InnXpAan0vcSwmq28GQFjHq3o793CQEoPFIgbyWHupyRl26trOenQFN2Hi06NryfFyfGPRgVAXKqOLUsQHU+HlekZKoFddnjC4E0boP7rmYvRSNsq7nloXlqSysVWdBkif50LyhEOcmQeYxUgvTGeXvVVrCuiQ9G9/HjfvVFeMK0xn0smymlqJfjq/3SNjRQVyvwUwxh5kcftmTuQ1XVJt3yjp1XS5hMhQ4JqdfSqfwEz19XCcNuyDRVD5TDVwTrApr1VaxKyKKex3yV8t4M/LluEYu1loMmm9vueOGyEy7Fp8Euwq3kpzXtmAyWmnlQgvLJVb+tEgKWRVvINS3LTYitGxoevFN2S3Z6BPq0ChSexIrIdcRZk/C54r3fKRyRMBpn2UkqS+3YGAR8X/XuBSdceD9iKL6XNym6eLH4vWwNRR4TGP3kc9GDqP6OeEypQ23F7rLru3OIDvbmXSmh6F1pU4QY4bNs+BOz8PoC3kY3065rOmil3N3QzmwqLDFZ7a/4VKjTtMMsCN42F6AKtfvGIST95fCL6cpinTiyISGyyY7c5u3AYEwGY5FUEOXGfUYrVxeitVb6Q11YmO3PNDsci3tycLcAHWYGlVldGUV3VoN2MtcRgaTuowf3fyV6/h5wdNrfpy2VN2Pv0kDiOlSlDto++2deWH2j9SlzB6mukarm9MDzs1A+UtewBVuVTbm6c6WJpF4OQ6jtcN8lVtsCFHoCNAaDqDlC/00Olwv IuTvguHy dc+PIZWADwpKgAwMvBLi+lkOnymZtgeSgNrqnXzE65IEdrgsWbCqOlig0SH1VWsyslemsWB90l1wcmN8tN2eSkF/JP19Y3Z02afnXwGEdrnoYyycU+ujASw738vDY8YzvBMqy+qIMOHOqOj6ZdB1eiv9Cui19me9sDP2eeuKTGNGh+Y9Uz3CFr01GgRD+YbQG88bqcL2Ww+a4Ix007/j9XeJGBxZ+3pIha/OjSyhCf2J6EfA= 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: 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: 13083618 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 D5288C4167B for ; Thu, 29 Dec 2022 16:11:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 303ED8E0005; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2872A8E0006; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 127BA8E0005; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 03C4B8E0002 for ; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id DB3F5C086B for ; Thu, 29 Dec 2022 16:10:58 +0000 (UTC) X-FDA: 80295832596.30.0DB6980 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf10.hostedemail.com (Postfix) with ESMTP id EF05DC0018 for ; Thu, 29 Dec 2022 16:10:55 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=uEGqoJWM; spf=none (imf10.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672330256; a=rsa-sha256; cv=none; b=r5pps33nyRKWuZ2wlwp+7xaw2LZew9x4aYFsXcdtDKGw2pdzYA7AsnqVZKCEMF+cydowXI FjwJMHXYdCyCEntidG57x7M47LhcwpnRCOa4F2BPuAp/jmAo9ok48PwAg+soCskekL6Bk/ ml0/U0Co3D3neYwYKi26+95eDAxjWKc= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=uEGqoJWM; spf=none (imf10.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672330256; 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=JERcZZTMhkivNxo9SqHrHtIaAsMqudDjGhUiCLjWNr4=; b=xyul30OOXb1qvjewyn0F2FR6DHYO0dOpfMHsg0tEye/hL91LU7YUzb+4FhaKViuhWn8FRn zs4e9s7akTzahFpp/jdfKSiU65h8/OQFid1eK7jGNPKSLNhZN/tOFAyUZnOXlmYQBHmdB8 xHloNrRKcbP6JlgaBuSrBgVXsYxY+4w= 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==; Received: from rrcs-67-53-201-206.west.biz.rr.com ([67.53.201.206] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAvUL-00HKLm-6s; Thu, 29 Dec 2022 16:10:37 +0000 From: Christoph Hellwig To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: [PATCH 2/6] ntfs3: stop using generic_writepages 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: EF05DC0018 X-Stat-Signature: wueqwe891gzcxfezw7wrtnc4gqpytcbn X-HE-Tag: 1672330255-575307 X-HE-Meta: U2FsdGVkX1/t+1OFYhnlpYf2GmGUpVGtlsVLwlSQVww00xTQcdcpmP1thFoxkZtaTy3n3Iay9jU34gcn2Obv1AgcD6lVgXjW+BVIRIgqAy9mbLgnw0l3xGDSXkpeepPznPG8vWLmhjmdbtGWrUGQa20r3RpnO5V6wEQkG6kHSAme97KTOulUMoCL3R4NIxCAMS38uoUVJLFHRJJPXTQ76CLkQtrCfdT8cwb1hcKqRTAQW7OXfCxkeCTCbrP2NPmvjBqnorcQ1PS4EvEB4/Ke3Ut0w0tC+bNKMqviUyc2jYi6u54zcyrxrtfyanyohv3nJ8S2cxHCRgDNUY63bfMRIeGijHHjysygb1P60E7JiX0fb8Q7GOa6VFxEOtpb/oRFW5R0WFbSn+zCoJwxHXkfn0CwjU7/YDjhbExKG7L+zaSoZpHc9dORYtRPZnkpj797SjTtEj01FrMAJEMc2TVWgRmFSymXR+YDvn8qcZ7zsX85NS2FVd0rKn566t2Yjk26NF8tER0BaKUkx+08E+DnwABeBR9LTKL4OH7RgPzZ2Hj0cQ7GGgxipc5kf15pxVk0eLM0jevmuoUbK36/WzLIKQ+pIZqIkaj0OV4OT4xY5XShBqBvFA0tHno9xwUaVSvVeaN6h3bPZr9y/lNLIOXZunmjiAg0fLaecfCEi+90s7dydOixLr3icsJfsXnrCNMUrJiV3QyJEAxJakL2Lr5R2L6kYnW0XRSQjGChmirLE9uMUPieLk0647+OWD8SFbGx7zOePzVHvrEw/GOPd9CnbdG6QatQptLXn9Iw7CZ401RSH3rtaxHiNmVaMNLBXndH8yb/KEmbSetKFqTm/QyJHOaTpq594V1upTxLTupcgaz4mOnMQlp9oPe/afXUN4HNIvx/ooScHzqBNgZ9AQNJpYOAW88pY82VZxMqiduMxg7c6oi0TcaEvyx3qTPofNUZMXXYa7OnhyVUFId8zc0 Tgv9shAe gK22guW5sb2QtlWTLcmdrCD1cqSyNS+fz6rUw5+CJLEBJ8+wyCs0l3ijh2/ju2Qs153q5uX1i47K1RKk54JAtHeK78q2OJ41DtNGBklcMb63XIVIigAl+g91vxtIFGTHb4DNzsp3pMr4PMJqbKsHoRfoKMnLFQascYSB0zd7q6IZsuGy8vEMVl/9G6LrU6hEwNiHjHMP4oeq/HBffwDdgClK7s3w84w7QZlQ7wkkO23gz9d0= 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: 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: 13083622 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 5E629C4708D for ; Thu, 29 Dec 2022 16:11:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4FAAB8E0008; Thu, 29 Dec 2022 11:11:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 45B518E0002; Thu, 29 Dec 2022 11:11:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 34A8D8E0008; Thu, 29 Dec 2022 11:11:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2569D8E0002 for ; Thu, 29 Dec 2022 11:11:00 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 02AA2A0267 for ; Thu, 29 Dec 2022 16:10:59 +0000 (UTC) X-FDA: 80295832680.06.3CA3C00 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf17.hostedemail.com (Postfix) with ESMTP id 6DAFD40023 for ; Thu, 29 Dec 2022 16:10:58 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=CjvMuzxo; spf=none (imf17.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672330258; 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=eT+sezI7d2puBXhZ4YXeV63r+1dsBpxvT2Biv2ttQVQ=; b=Zq/KCNskDYX03sdvtVDgUklLIrbJGEdOMcX+hI4wPBzUHH4hZuF1KvA5+VPrjNRDdi11cI ddanJDmCDxYrlcR3Go+c76vAu9p0lO7LDiKWBwKrkVguvSBfeUiqerhDRwzZlpXAMm1bRB LaWacqnyLinnLKmv0eL7ynqvWmIIBcY= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=CjvMuzxo; spf=none (imf17.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672330258; a=rsa-sha256; cv=none; b=McZe7kA7ZjSI1jfko84LpeHbgV3Ra+hLvMpkygQJ25aCMc2SeYjM42J/CLQkji7xkltZPf lEowedBtNWRasxBo75UxzqCaBivAe1RRWpGs7LwxTkX01rv6ASuzSHBT7Zg07EW2u1eOGi VHQjG4uSBZFPrs8YAsr6AUcLSrI7NLI= 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==; Received: from rrcs-67-53-201-206.west.biz.rr.com ([67.53.201.206] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAvUM-00HKMX-JM; Thu, 29 Dec 2022 16:10:38 +0000 From: Christoph Hellwig To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: [PATCH 3/6] ntfs3: remove ->writepage 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Stat-Signature: zdkatwutkwcawgex7o3fkepr1s1cdpfk X-Rspam-User: X-Rspamd-Queue-Id: 6DAFD40023 X-Rspamd-Server: rspam06 X-HE-Tag: 1672330258-785389 X-HE-Meta: U2FsdGVkX19Uagbvj9ukYto0GjuXwdxv86F8gi1IPkqj02EU8x3dwRNZqcqhJ3gJ97TVRZkbic28hywnUVDVkpoDj0TESXel1O07Vhs1iO1ACTB+cKpjYFU6G8Ezsqmg74ZWVsmfq9RVN2gB9Y4fgIpuyfm15eeOEUS2/YCL/4F5WjWxqvvfHFgKqTeu5NHDV6gxTN8Zf4sZRxmx+df2HDQbMbkt98tFJsmMCxmF/DkC3akzEBu8LRZdAbWBTx5GZiW7HkEgA59mcq/o46djd6TS4rnfbUqe/5iPGxvapyV6ge8g37mhewWT0/OCVxuXyINyaQlh4TfEBt7/+6sCEBES6WzxsI3n6AfgEy5oFKiqm2OegqORU43GSyfwcqL/gtrXDsAh+PmM/yVd3jf5tkjqK4tQRG6QqIROCqtJEBBgCyzZs7X0U+oYyx+9pPIj9f/EWotG4hgzNVt9ED1u+q8kBLsrhvIdfzQsAmAQamFvuhL8o8RMZSGmSlxFu974STO587fYlD0gbi+N/8srv2YQAZ2d6ws3uAuUOX6X0G5htjObFsu+EWvdZp2aR0BKheqDGA2w3Nbk7qr7XkFqnUFqBvt+676ooljeQyCcYS2o2pBv/jbWjlZUJ8MDnE2/3oaqAceTcCdObhPEuTQ0mzkELM4INpdZvA7lUW7rDtMriveJOTFtv0y+Fy+6eXMN0Q4v1OJtObAuVKAl15DYV4tZ38mCznxRFTjCNvVGvcUXNzZ4UihQnnYUGbVv8io8ySKqmV5MkoSZqLhAiMk0MOtzLjEWGII/uqikz0BrxBKOEf+1T7ECM/q/ApbfasB4I380reGebBkPsr6ftySun6So+/pEn5GbyBqlJHhQT/PRsi6m1dqg6miUYrJnwaregWRyPZ6l3+OqJsHtUlWMGJqWGkvzwff4vQl0wdCIHX1QeEKz5dqSRhD/jxtRT2ATwUBWevPXUOzrjzh4+ti IlRs5B/g 2O7RrbGNx09zRXJkwbwV9nAYhPnfryiMlHJ+/d/nrdWuuSB1NPTB/qivVz+FoRVRKp6RJzuAsg+prbI+MBGDTDNfrUcOHFDD6/vNKARb30wok6vVMKgg+9hpsi76G0kvRHPmeOp9zArIR+WaXFXePPU3HlX/hRlfP1AGT6GiIfaqYXQSE4M19kirxTw== 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: ->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: 13083620 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 8DE30C4708D for ; Thu, 29 Dec 2022 16:11:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AAA838E0006; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 87D048E0008; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6C7E48E0002; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 454428E0007 for ; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 11CDD40E40 for ; Thu, 29 Dec 2022 16:10:59 +0000 (UTC) X-FDA: 80295832638.24.1F0961E Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf23.hostedemail.com (Postfix) with ESMTP id 8D0F8140009 for ; Thu, 29 Dec 2022 16:10:57 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=MMpycC1K; spf=none (imf23.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672330257; 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=wAGRF3f2s+7CXmKUNt5mcDbE20Oprr4M4XP/Y6UM90M=; b=HJnf34TXnudtYeFuPlWMZnb9EtvI33x8rL7LmjqvjPns6XHJ9IqArSp4couT3hTIiRjNf4 pIJh6gno72plRQlgnqCk6WdeFpdYM4IEmP+whob9MuXyLku4eFjM6FGhkcV8jYKbeKPLIF Bkpj/qC0rVyB7jkRt6XtMBRR1VFH6w0= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=MMpycC1K; spf=none (imf23.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672330257; a=rsa-sha256; cv=none; b=vzBFp+nZTWRV1kroBlivVIl3gFc6WDtICLEugP5YJA2FyO5CmmWh+3LkPyZdnX6bnAaaqX MqeFmWGEvi4o1xrGye3Be9g0hNvFDSR1v3xoLzenhGDfiU/nH+a8yuwNmXvcDx/dIZdNqL 9fRcbfRecEqg1AZYqQo06WgpY1ibXMc= 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==; Received: from rrcs-67-53-201-206.west.biz.rr.com ([67.53.201.206] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAvUN-00HKNb-OQ; Thu, 29 Dec 2022 16:10:40 +0000 From: Christoph Hellwig To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: [PATCH 4/6] jbd2,ocfs2: move jbd2_journal_submit_inode_data_buffers to ocfs2 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 8D0F8140009 X-Stat-Signature: 9ks3tqanxkw4ntpornu77xem4aemiaht X-HE-Tag: 1672330257-947017 X-HE-Meta: U2FsdGVkX1/n+PCRz/e43NQnj2Rbt7AmDSLPny9lZJRJVoHMEIE83NPQUKX1Ouwk12G0683UCu9RnXhP5LTZXa2XqtUyUkXFyMHV7E6UvstpzR3kbj2yZ8O3TSny/T9l4CvjaJMme8aoBJha9eN/1tE6L8NMDzf5lNmPiKuc95OrSd4ijm1BkYQrWlL91NACliECXs/tqPXXkFMuhk30r+usuqgaPowHcW/ysAYkqjDgWsletf4aekPLxEHWRiDV24UfolbkraK32UhiOwt/FF9Dqb1W9qDv+/GxJHlYoPAhI3CVP9N85CI9KLqdTOaOCu7EJ7X+CCqfio3Sqi+j8iDmYhi5GAvrJ4P6OIdkwD9Q5G48O+HIgcueXLeOK1u0Iit5vQk0wDqOFfzwkaPScHeeGaIqsdqx9nYbeLUuMt6qe0boWME61RidTZcO+BaJrABmproX5RAAOsUWoR22aJmIgB56djXICzmtdBAvudohJC8XFq5ndU1Ym6PC6lYy8czM5oenzs341z0otqRSrRrL8fHmUHYRdqeT7OibZX/Qv3TfzEWwHLN6uzU2xEyX1qeTP5qfXplDGk7kwFCn+p1ssxbBPYS3wFPZN5V+j1j7UZlW/MrP++PnENeWfDAJfNzR0Z3TSZWMMrK6F6aL/ra2Q/banUlsL/OC8hva8i+BKrvJeOn1Etoaq3wmb/wAEntodYreQSqgBdpHkq/A2uCBCTTHsN6urGJZJKLxDrFIitwktS/6skUlCl6SL20J7myTJ7HO9iSk0VHikRHCgVqw7gjWXbzZE5kQVZ1dXzMGFap1dJxomB1rjsoF8RI8UxjdLOkxrbpMHdzNiaWfopd8vM3DuAjzP+vJzvC+88FGDzd/33qLA/HWLTzwFhufkmYtdViO/sUBEpzDDekFmEPFSIv537CiGUnbJWmCuk5IRdm/Ip8Vcj//eMJmNARzhEplFwHHyQ3FhOq8JJO 3oNpo1tk dhugkIWBPXkAxCcfdDkaI/dEOB/ip44H3gQ/CK+tIGb9o6/tXZj9p65sxVrRWm8fOSf3GbOCCZz5JlG0yfRvZ29vW1c99CglBSe6+vQ0Hs/OjSQsYkSVxmHsU+sLTaRa+7dmJs88DwnEaDOFrarGUDWPbMyVm5womADdHIGbgeKa81u84vMTxR+mzosm1dunIgJ5TgAA3usDfATVBBuGjm58F444iDSdeTp+VBO0w5kfwGJY= 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: 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: 13083619 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 B355CC4332F for ; Thu, 29 Dec 2022 16:11:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 87DD88E0009; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 80C8C8E0007; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5202F8E0009; Thu, 29 Dec 2022 11:10:59 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 24DD98E0002 for ; Thu, 29 Dec 2022 11:10:59 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0277540E35 for ; Thu, 29 Dec 2022 16:10:58 +0000 (UTC) X-FDA: 80295832638.23.5F3A9B3 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf26.hostedemail.com (Postfix) with ESMTP id 7E83C140015 for ; Thu, 29 Dec 2022 16:10:57 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=mG3Xd47o; spf=none (imf26.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672330257; 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=/OSTms68IPUXcD9mOyJwWhvTFEvxpirJZnFVgrc7HRI=; b=b7xbr0p7IJSNlf4c8dJtRQQijLekHIIwmke6GYm+fY94VKluF11Fa3M98WJXvvZVYF7Oid NLd34YMJnJkfOI4HoHi4xgrg+ems8I5yK1o65phieqvieAvgMZOXPEXhtTzUDyf2n6D6DF R/yqd9//bl9ucF8w/mF8eGUzzBPNQy8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=mG3Xd47o; spf=none (imf26.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672330257; a=rsa-sha256; cv=none; b=38DaamGxkQQ3Hkkm5JJE1uwaa8M4Ftk2X7+RRXN1LgMjJhydznJhNTn8voOvYNQXi5Lxhy IT5IROaiU3a/6JiCuvKmwQmJ/yQuJuaKErzI4tLyoDs9hQBZWo4nhObVxgvzrihvPIkGnk LMfLclBPaxHeSkPr3BQP+BEn3xlZqtY= 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==; Received: from rrcs-67-53-201-206.west.biz.rr.com ([67.53.201.206] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAvUO-00HKOB-Uf; Thu, 29 Dec 2022 16:10:41 +0000 From: Christoph Hellwig To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: [PATCH 5/6] ocfs2: use filemap_fdatawrite_wbc instead of generic_writepages 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7E83C140015 X-Stat-Signature: qqfc43aii6tqnqj49gwhxd5zhj1kdbxt X-Rspam-User: X-HE-Tag: 1672330257-396984 X-HE-Meta: U2FsdGVkX19Yrclz+unhbdPQkT+v2Xdmz+7Vlb/PcirYKhWeckGNlEvibo0xmXLsP6tI3s/ouIJExhtkjoOms6kLSDv2P7PUuuUS1mzBGTJbtWt2PANo6LVk4caODE0HNcoajXUd7AfI0kW3UKuApR7phQ1JRLVOQt+ob8Hn7EfxuwIAx0EmPU/NQ4qv5SFWLWasGlBZOvpAGFNfqlNShsESLkMp/LjGwsArPnR3tIhP2xJWFdKrUAEPIGhB1EsCF2Z0V9Ki2AWc/ddz1I01iUqIleLNvn6ff62/r8c/EeXSVaZ3huWu9NgMrgqxpgZpbi7x57S5qemCN0GnX5JH9f+rngBeLYqQ2nGLxAV+EJSQqpaqmebPiWTC3BcaU2g+gaDKVzS4OXzBDYUjErl4KoLQAbPM546TbrlpRBJyVbrkMWumuKkPHqUZ1HwZuc0Wn8mqVGYfCVYa6SLOTNVfqx7Yp+DgQAWW9ngjChXpFMTHyeUePT1ERDxP2UoTIJXSrpmni+ZnuCHTTiE/TCBzww/UeaIe+AbyMjwC8QVB1F5NpzFsLDreVDhMY2Pg6GyilWrBBdjlHU7utymdNY9rHIdN+gvjV2o3QazbGNeKNPXsKTYWfUc5rAm5Lv9y+pSYQeeY60dh2EpSE6bSFvdmtfq66YLsoNRxe4NmS+V3maHbDwIi2tph1314xpUzID5R6MBEGPw7ycg7BKULhcyDpvyYOoylX19uoEad9mUY6guV2WAAHW/9I/7Xii8AiHAJlwQUT3/rWxm7cFPX6stuzxAmQU7uB+B510uc5w1ipNHCso8HHqmjdaS2p8RD0zqapglRJ3jhMZQZPIweQQ+oNEJQyNP0poKfHCoeWpM7pI199lU5dWKa1zR5wSqAW0hdq/Xl+luTH8PsUOnNkJw75sRk1x56YlmUJ68gYN4gZCVnAM+2Fjylf++JK3FM2lqPPEjjcWke521SEAyoRgZ 0DQsFsHz ZDZxUsyOFyIXTM4aXlAuZyBu2GphsFMkcNwJQHvL7jOym9rQcf2TJ5pweTkIi0aN3u+4irLPl0TNGeYsyNtxf/YHYJ49HCahOBvlwGrX7Gl46mq7qocjTWmgo3wEjSk/3mL4lYuaA9/d48yvEKcDqLDDHfJ2813CQD48QE38SNs2diZ5y0S15ozUSk1/5i+/8w6mFSL9vjqeDEdr+gdxEcKILsbwuk4O6v6miH/yaLPm5bGU= 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: 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: 13083617 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 2EA40C3DA79 for ; Thu, 29 Dec 2022 16:11:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 82A858E0001; Thu, 29 Dec 2022 11:10:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 795338E0005; Thu, 29 Dec 2022 11:10:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 51FAA8E0002; Thu, 29 Dec 2022 11:10:58 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2CA2E8E0001 for ; Thu, 29 Dec 2022 11:10:58 -0500 (EST) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 0F0281C628A for ; Thu, 29 Dec 2022 16:10:58 +0000 (UTC) X-FDA: 80295832596.11.1A94DE8 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf01.hostedemail.com (Postfix) with ESMTP id C4EEA4002F for ; Thu, 29 Dec 2022 16:10:55 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=hCkiJn6N; spf=none (imf01.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672330256; 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=x4y/4KuqfNuPAflIAi82X++2iXzPIgIv4Sol4IXfpIE=; b=8gb4LzJmAAkWqt0JkVPkhP6NMVgJmZnWb0tGJ7WAv0dgena4eVxAn3339pcplql3BzpTfl yIstEqKrbCjeZwwzBNNkx+ikKaGVvB0e1XegenR2hM8+AWJThvDEmhdlHSs1m9wL3rjKT/ 4LijokVDVBxN5gBkbtM/0DF9Bj3AfOk= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=infradead.org header.s=bombadil.20210309 header.b=hCkiJn6N; spf=none (imf01.hostedemail.com: domain of BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org has no SPF policy when checking 198.137.202.133) smtp.mailfrom=BATV+e05b48f8d7082ec3c215+7067+infradead.org+hch@bombadil.srs.infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672330256; a=rsa-sha256; cv=none; b=n+lWRNV7jxxMrQ6E+puWZ9COOOM7Ylz9CM2eRzrCrc3fEnaNNd3irfGqWUX6Yc6DJtNXjQ x9xyUPH4vxXhpJxGBeewMdVSa3bcywm5mD8z3cbBnsdfJh3xzBylVaLq5mRMq7jRrEXc5i nGe7K+KXWtCujd2DTVIrtD8wP4xKplA= 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==; Received: from rrcs-67-53-201-206.west.biz.rr.com ([67.53.201.206] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAvUQ-00HKPY-BW; Thu, 29 Dec 2022 16:10:42 +0000 From: Christoph Hellwig To: Andrew Morton , "Theodore Ts'o" , Jan Kara , Konstantin Komarov , Mark Fasheh , Joel Becker , Joseph Qi , "Matthew Wilcox (Oracle)" Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, linux-mm@kvack.org Subject: [PATCH 6/6] mm: remove generic_writepages 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-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C4EEA4002F X-Stat-Signature: pf3cmxhrwjtu1ro14zgrza3xzztf3qz7 X-HE-Tag: 1672330255-957571 X-HE-Meta: U2FsdGVkX19MDYFtlZO9HY4eDGAEEQzDz/WI0zdLxxNnvf3iafVRqv0x6oMjJ3jGTQTUKpEf6m2EMfYLS3DPBk8pUS7j/igu1UMJ/iLRgZ7Xda5R4YXVv9laFvENTeuV1fwI4J7FsR4exywqnGc1HIAcZX5xxxzfN5BhGSKzOkhAPXHRle5sB370Zn78S1g3GqyLmejbJLvIGo4Ike3R9gwITzkCgKkyd/pZK16uzD+NwqEPUDbZj/jT3o6OMUB/eTbeJ5uQ3j/HdeosA4BQQf37a+CpLJkBmon8O548C8ot5+GkyayehDdHPwNlWWORXqaeftmBcKZ4KPBcUIf/UAhWwnMNSU+GtLMjMiWIj+LVecfufbw5XRJJPqLsmLHWPdiPvfmB3mGmpOOlBdhI1IV+ZoErszDz3tAlmYr+PfGJj6CtGGQS3b0jL+YZz9Rvk/BvO1tSWbD1UMu8KPrw7rjcu4iFV/2T85LscWjSyWFydAm8yrVKkn9CDZx0ndYARBgb4ERIMNkIala16T1byQS6msM+Mj9VKXerhr36TU49bLT9Eophjf9FFza140cPePwmGuyEyiYo/qDFeNsoqIXDL+bfQ5x2PLEzrmnDEXhZLvbqKH9X8w/DLjIv2PL+RnGURACGXR5MwGNV0nZT0m1710bfDE2K8Q6+6tVN4oNJGKtKgt5Y1n2+Xl6e9f939v1yqOepiH5EIS/Ww4gzlzOSQ0d0NP5cuSuoo85W0o+ZhA5NX30kOIEQTmvF/OxkoYRUIqdjBhNX8btCxf2FWPZwwRRLTJ1UX0K2QXJwQCKYFyvgwD6p5xgTqmRLF5Y7m6h9kE9o5ESAE6rX67dRe2gDtn7iZ3FNINDkMi+HU67mBFBQuDDk9PXeOVbnI7zcMRvh+GyOZ7JHLvlny4wNWt/xTEKBPtSLInyIlUeJ8WAPee54kA+TYM6xNvwFu2auiI0GBuM+5Lo+K4s2UNN y17i3dVo TieqEvLWYehyATA6t1Pbmcq3cDdiq4zRjHrNNVRWfXNHr4AaJrNe165chsw8ssWaLUXJZ9j3ab016l/bZSR/rwTQ12+Opp1GZhRH5Yr2PsrTNNkQqxgvYoacaYrfuqw1dLOpQOSejLqb0yQsloCVgtwCE5wF5rIwkGEq9dw62xUpEr289YoihV+j3HD1ai91qxNbDs9uW8fvhqwmauiC3FZEf7UwGsMQ9cc7OZApA/dYHRXU= 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: 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; /*