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/e43NQnj2Rbt7AmDSLPny9lZJRJVoHMEIE83N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MyVm5womADdHIGbgeKa81u84vMTxR+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,