From patchwork Mon Jun 26 05:41:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 13292359 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 96D76EB64D7 for ; Mon, 26 Jun 2023 05:42:30 +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=gK4ArPCiLUKRgOEGrDu84q8pislsbTRDUCXF2Zgjs4I=; b=k+gRJRI7zFAD2KxtejKuaIurc2cat3Qp+qGNf1DMEgY//30PNEA66h4jpPQ999wKmrIoBRwyWU7e LfG7k8mxOKsrKWBCESinqOLkvAijllZeWj4Aa09h9ElyWefQrg6Xa4GPFQ9zqOJNE9JOvfO8I/va XsnJpws94wRy2gvOhPMSlOZ4n2vHlVx9Ya+RdCmCM28YDzyBFldnuYt3BTwoPwoZz6JXo4THwnYr Ax3addQe9+Nv3UOx7oQzS4RhqKvmt62OmiFtyNxH6Rl7Xw7N5PCDKFaGmT7MOYMDzoxYSiCDmfon 1IaYlwMdIxMV+Jw/TxG268Su6aT31dIJeUgrRQ== 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=gK4ArPCiLUKRgOEGrDu84q8pislsbTRDUCXF2Zgjs4I=; b=id/3oIj2MvDdQxv8lTPjmGbw0WtB2cPHh7nrv9KMLkat0H3YTppHA7/+woAJy3aQc5EJs0DIJW0q iqCzzNUN/kK4ElHFYlegT7rIhZ6mL64KOgoyzTvnQWgXTJtl1LukHtWFnaP7Z6RCDEeQ1MId9RbB QC/BZjqSxwEi+5mpN7m26TjPSP4N6rIq3FWaYnAeIRMxoLIS2KnNDxda7Qp0o2kChdwaNNOiPECB nCazJyR1+nOBX350dKM26COq5nju5V+89lZTcmv0hBsVz8zRirzwDwr0wdcr9Qpq+Vt46oQErlg7 NIrmFbViHEF0bap5GL3rGlUboxYHdtlXsbxyGA== Received: by omta-ad3-fd1-302-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20230523 64bit (built May 23 2023)) with ESMTPS id <0RWU00EYPIIT7510@omta-ad3-fd1-302-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Mon, 26 Jun 2023 05:42:29 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; t=1687758123; cv=none; d=strato.com; s=strato-dkim-0002; b=BLsPKXmVGveNz1cWfRhdc45UhP+767VVGi141W8RVA4ZEZZP2JgAB7tkOyloadHPea 0m8yVuCv2OM2Ww/pKkTRGeq5+h6R+6PtU9AlyZeLz7CSeofmO/tplJEPdE5jQFqK8zPr A2xHXfLEvKepgABVVft3avmi0JZwzM1dTSnXFqI0JgiOft/xbF5P5+U709b9gNebW8X4 6Q2RtPXYx4ntxvsqHajtQBtDOrvb6IU//Ep5CLUlO85BnH1IeTqr/Eki+cElugzSE6Lj kvb7wqHdXV60ZjL5zS/x8J4jtFqaDk22YveWArqxNOIgQs92yJbmF6aYgg7XuqFbnDMs Tlkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1687758123; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=mhoN52NrOJrJXRtOmObH8v06ZrNecZha/sBxCLu1zqg=; b=ZCsWMe2TXHMNkB9FaqP7W1Xr9DE2eQO0B3JLwm7wWM+OpaeyxV3s8fnwOVtU6U2znq sOZ97vbok1ZltiWjDNWwOwvX6gL7W+MS+oc6jmXNRnrh3f9aPeTL7sd3Dgi9VBlS8pGI mjBfWJTzszyhPSzT4nnQNtq73xv77mIzop6oAmjcUCO48LxQiSs4UU4Uw4M6d08ocKSv mjpA+gOcMbFedY+Z3FRwfbI2/NMyo3LtKRmlLN6N9FsbnLvQUTaIchVUSKe5uZ7+6Nh9 6qaCupaSCFzFOajM87SnnUOejjWtLcFw52IflFKsJMDC4k5Fj70Vjl3QRn9V+hWTvf08 /BMw== ARC-Authentication-results: i=1; strato.com; arc=none; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1687758123; s=strato-dkim-0002; d=iokpp.de; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=mhoN52NrOJrJXRtOmObH8v06ZrNecZha/sBxCLu1zqg=; b=dn38vfl83FJAEJOE40CVxkpykk4kWCRRj+jGqEk4ue0L6B+wq4eRyadOJMt/7fuYgE Ebr4Z95t5+LdRzbdf2OThbZFWcPfDh5bbrdsK+uPwPEjY8zMuU2VvNTgMwXrCxyJAkOP dhZfYU+D5eKk07vPzSiJzrPf/sGSSj+6gL6c51Qx/mGXnhUm3EKn+gy2WYdtX37Pvnmo Hd6Od+VbbmxgcG3KQooJa8VG/k/OFxd7rCDSCLDysv3EeTU/QNOcoz+18yDb6jThitLc vX+8ASVpvg+5uzTA4/zW+Oxg6CzKjhuaNW7GSfznKVoyEPIEqoVk1bWIy6LynEphYsVb LSFw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1687758123; s=strato-dkim-0003; d=iokpp.de; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=mhoN52NrOJrJXRtOmObH8v06ZrNecZha/sBxCLu1zqg=; b=7QCQPusEOW3XxIMInpXpKbXXPNiNqkdAG/j4EsA3IiOrCjdXQit8tl8J7yBwJznqtG TXhSJI8/Zw5kTNmmRyDA== To: viro@zeniv.linux.org.uk, brauner@kernel.org, akpm@linux-foundation.org, jack@suse.cz, jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, willy@infradead.org, hch@infradead.org Date: Mon, 26 Jun 2023 07:41:52 +0200 Message-id: <20230626054153.839672-2-beanhuo@iokpp.de> X-Mailer: git-send-email 2.34.1 In-reply-to: <20230626054153.839672-1-beanhuo@iokpp.de> References: <20230626054153.839672-1-beanhuo@iokpp.de> MIME-version: 1.0 X-Source-IP: 85.215.255.81 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10752 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 impostorscore=0 malwarescore=0 mlxscore=0 suspectscore=0 adultscore=0 unknownsenderscore=20 spamscore=0 mlxlogscore=837 clxscore=138 phishscore=0 bulkscore=0 priorityscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306260050 Cc: linux-kernel@vger.kernel.org, Bean Huo , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, beanhuo@micron.com Subject: [Ocfs2-devel] [PATCH v3 1/2] fs/buffer: clean up block_commit_write 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: Bean Huo via Ocfs2-devel Reply-to: Bean Huo Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-RZG-CLASS-ID: mo02 X-RZG-AUTH: ":LmkFe0i9dN8c2t4QQyGBB/NDXvjDB6pBSedrgBzPc9DUyubU4DD1QLj68UeUr1+U1RrW5o+P9bSFaHg+gZu+uCjL2b+VQTRnVQrIOQ==" X-ServerName: mo4-p02-ob.smtp.rzone.de X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-ORIG-GUID: h_yeqvxDxMDSkyjfSfJ55t5NHrTVhR-t X-Proofpoint-GUID: h_yeqvxDxMDSkyjfSfJ55t5NHrTVhR-t Reporting-Meta: AAHusnVEcCYRqZBDB6zw2au+lA7GhboNNgpwJOWVxElSHY89ItQmE/Br175MFzRv +X7IJkiR5AnE+9hnihEEZ/m6uwE1Ufwlwko54l28YUxzQt7rF8SkyLlgCwpewMiX +8JM0Mcc2YEJAItdnXv6f2clREtS7oiEHlMKA9OoAr4mOUMpgnnVdZRCZP0n2q4g T1FZfErhn7l47sV7WEAlNLAJzqmae+CY1jZZdr7pChrlfaVDPFM0SF0v9hA2HJcr krQ0SeqloIcOCx3PEQb2MMD1l5zbEnlRP8G8LFb13zt42fI1+eWOqpwvwveAF0ZQ QYssSEmX6eCr1CW+K4mZABnTN5dd+CWPRs8QParX0/WtdONEf58GouUYfpHlypyu js5idcMDPbC0TDJJM0A9pZuS+LXw/FxsPetFo9FKOsYjkRGNiT5RV1a2yphlAenZ ZvUbSKU0VdeSM4bRWrgMbmbxxS6s68J8Hj/TSbVaZgw01xxQrE+UcC8HazPrW5jz bbIk2KWRVaHfTdblg/wwU1Kc2Ex9OpTgN50OXl1eW5fV From: Bean Huo From: Bean Huo Originally inode is used to get blksize, after commit 45bce8f3e343 ("fs/buffer.c: make block-size be per-page and protected by the page lock"), __block_commit_write no longer uses this parameter inode. Signed-off-by: Bean Huo --- fs/buffer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index bd091329026c..50821dfb02f7 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2180,8 +2180,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len, } EXPORT_SYMBOL(__block_write_begin); -static int __block_commit_write(struct inode *inode, struct folio *folio, - size_t from, size_t to) +static int __block_commit_write(struct folio *folio, size_t from, size_t to) { size_t block_start, block_end; bool partial = false; @@ -2277,7 +2276,7 @@ int block_write_end(struct file *file, struct address_space *mapping, flush_dcache_folio(folio); /* This could be a short (even 0-length) commit */ - __block_commit_write(inode, folio, start, start + copied); + __block_commit_write(folio, start, start + copied); return copied; } @@ -2601,8 +2600,7 @@ EXPORT_SYMBOL(cont_write_begin); int block_commit_write(struct page *page, unsigned from, unsigned to) { struct folio *folio = page_folio(page); - struct inode *inode = folio->mapping->host; - __block_commit_write(inode, folio, from, to); + __block_commit_write(folio, from, to); return 0; } EXPORT_SYMBOL(block_commit_write); @@ -2650,7 +2648,7 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, ret = __block_write_begin_int(folio, 0, end, get_block, NULL); if (!ret) - ret = __block_commit_write(inode, folio, 0, end); + ret = __block_commit_write(folio, 0, end); if (unlikely(ret < 0)) goto out_unlock; From patchwork Mon Jun 26 05:41:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 13292360 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 aib29ajc252.phx1.oracleemaildelivery.com (aib29ajc252.phx1.oracleemaildelivery.com [192.29.103.252]) (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 99C35EB64D7 for ; Mon, 26 Jun 2023 05:42:34 +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=SK95j2tuZC6vZfIq2qO3BKIER3tqAxvbEIyhBEeKgA8=; b=QjRE+W0pQLn7wV/c7eeSOpgcuS93f6db9dIPgfH/WvmGA/DjJkm1L7pmiPCbY6cvkgkMJD6myopo +2muHI4bR2NLYs4PzM26KCsJAyMNWU/3TtigjzaYSdPuDb1GGmsprgr3bkzc9qDVFnGLc4M+9RRX KEMGv/lr3eoFWQuYbK2kqxmU7WxoF8v3IXhbM4PaUyimVTJ7pnhrdzdCxozg/zpu1jTEdhBmzI95 7+gaB+Waw9GEdfL11WnxJ3s5En1IdA/pSekDFLqc1so5v+AdTC4XcH4tSG0NKqpah7AoMBiNhT0d bkS239NAkcByB+DgLSKGPmsG/RnG9n4SveD/lw== 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=SK95j2tuZC6vZfIq2qO3BKIER3tqAxvbEIyhBEeKgA8=; b=rm+YVHf4L2MiYmgVJN+X7CweOw1yORsHrk+bbDch/ZKcZ+h5mC+9iSij8B/TY4I8HJjuiTX/auef Du+FeDcdc2T3otoKatLgUsSIJFw8+kQA6Ra6+hXVeBq6wyo8mhGza+swklCyNIVQiKRhtaHzqCGJ 9FSkKcWa5zDXmF+ruWm/4qdmTNdMPAH3gjIPhR3zhhOcZZI6oNxWM7bMo0w8iAHnB9Q7BqzAE4ge AMG6yhj/c3EBOxY/OfctczOqMC6o25/EAMbu/NO/8JKJPeQF/xFMy9bugl898vlhm9+UZDZZBQTy +l//t0sfDuqQin/vpZq6AzIuzJBUvl3+ER2g8w== Received: by omta-ad3-fd1-301-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com (Oracle Communications Messaging Server 8.1.0.1.20230523 64bit (built May 23 2023)) with ESMTPS id <0RWU00LQQIIXGA80@omta-ad3-fd1-301-us-phoenix-1.omtaad3.vcndpphx.oraclevcn.com> for ocfs2-devel@archiver.kernel.org; Mon, 26 Jun 2023 05:42:33 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; t=1687758123; cv=none; d=strato.com; s=strato-dkim-0002; b=bnJRzWfzHwjyB7ocNXxbvZ76SzDqFZN/I4n6xQ/j31yApH1TFFzJoqny3ZUswsXekA dEfeYFs0XkDl08jamZyv7Q17VemdpiIe7idJ9r7c7kRMDmRDBspOSdwIRW1d/S9LIa9k EQDLecC+wWw22gX2nDwWCw++AOgqpDvAzThjbuv9fTEhb7yDkHz7TfFjPPSWJl2Sf6e8 4cGxoikplIRjy5lQrzuSpSQc0nAV8nk76h+7+s9latytYAd5EJTyU4gz9nP7KtHCsVPl VTSo/N38sS2SB5CkLpm5kIlNz4Y3lNey5Fs4QziOjjkiN272YIQumuuPN+B8aU32l0jm kTUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1687758123; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=A/OYsWzLIZKxnT1gYGuMS7er5Q0yQLzWN1fJj1HH19U=; b=RIl8OAFYRJ7KsB1WkyllCOnDwVeEU/vor31scEtqwExfEomdiUlgO78z0dilwdLgls qo9jMu35Is7LYXO49JsxWy4fK8hYoZEhSH/8oyK7EySOPBqNwz+2ujnLLWDXuIQG8giJ 6U56Qwf3UPkJutNlkZ13wskz4bcs5JJg31gDTZ4FtH7cDCDnP12fAB8nmMolrC3f2I1n CMDsfIIwBBTnWLuzekbvzyYpVSuMwJ+s3Dl50VcXxJI00pdb2puaHqA990yPqE0PpBnQ PyH2J1Hu3RoTh/oG/X8DxcvEWChQY/oAqfrvNO1akiRN/QC2BN/LzpRGqiJGG7XPwvEI R79Q== ARC-Authentication-results: i=1; strato.com; arc=none; dkim=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1687758123; s=strato-dkim-0002; d=iokpp.de; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=A/OYsWzLIZKxnT1gYGuMS7er5Q0yQLzWN1fJj1HH19U=; b=NfcZcgTIIC8nSgDtlQSSa/VC0elwH/QlqHg71C486VKy72d36LtSjg9h1Jj4rHJnYZ QXUVsE30iG4+Qqx/pTlHI8PJdDwWv9S4ylRm2pUujvLRhmKKNlG4kElEbQYvgV+kqBFQ 0I/MbWxALI2QqKHmgy3uQVeRd9hbyjUke/3P4DY3qAMFa6vBJP0hai0mqEYZP1++YQc8 YMiWMxbiQZz03BatPwROeGyPG3krTB6pPFHdMpSaYmek8ML9RqxrxNI8991xSrtwwJno c5bs6usNL532qxfxnnYxusV3a88v/zAKC7cpTbiM/hoVhE+9nFJJcm2/vvpXcWKJkOrU JQKQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1687758123; s=strato-dkim-0003; d=iokpp.de; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=A/OYsWzLIZKxnT1gYGuMS7er5Q0yQLzWN1fJj1HH19U=; b=SF1SPiN2eE0txi4FPUdYG5FT1wVWtyEx21AJODjSRBmvV7KGi6Vt+/ekcbZhmVZLju 7KjrV69IoWMcH5mtFTBw== To: viro@zeniv.linux.org.uk, brauner@kernel.org, akpm@linux-foundation.org, jack@suse.cz, jack@suse.com, tytso@mit.edu, adilger.kernel@dilger.ca, mark@fasheh.com, jlbec@evilplan.org, joseph.qi@linux.alibaba.com, willy@infradead.org, hch@infradead.org Date: Mon, 26 Jun 2023 07:41:53 +0200 Message-id: <20230626054153.839672-3-beanhuo@iokpp.de> X-Mailer: git-send-email 2.34.1 In-reply-to: <20230626054153.839672-1-beanhuo@iokpp.de> References: <20230626054153.839672-1-beanhuo@iokpp.de> MIME-version: 1.0 X-Source-IP: 85.215.255.83 X-Proofpoint-Virus-Version: vendor=nai engine=6500 definitions=10752 signatures=596816 X-Proofpoint-Spam-Details: rule=tap_notspam policy=tap score=0 impostorscore=0 mlxscore=0 mlxlogscore=796 lowpriorityscore=0 phishscore=0 suspectscore=0 malwarescore=0 bulkscore=0 priorityscore=0 adultscore=0 clxscore=110 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306260051 Cc: linux-kernel@vger.kernel.org, Bean Huo , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, ocfs2-devel@oss.oracle.com, beanhuo@micron.com Subject: [Ocfs2-devel] [PATCH v3 2/2] fs: convert block_commit_write to return void 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: Bean Huo via Ocfs2-devel Reply-to: Bean Huo Content-type: text/plain; charset="us-ascii" Content-transfer-encoding: 7bit Errors-to: ocfs2-devel-bounces@oss.oracle.com X-RZG-CLASS-ID: mo02 X-RZG-AUTH: ":LmkFe0i9dN8c2t4QQyGBB/NDXvjDB6pBSedrgBzPc9DUyubU4DD1QLj68UeUr1+U1RrW5o+P9bSFaHg+gZu+uCjL2b+VQTRnVQrIOQ==" X-ServerName: mo4-p02-ob.smtp.rzone.de X-Proofpoint-SPF-Result: None X-Spam: Clean X-Proofpoint-ORIG-GUID: HvCseG7aL3SES3fg-qmJw49E-5703gRW X-Proofpoint-GUID: HvCseG7aL3SES3fg-qmJw49E-5703gRW Reporting-Meta: AAHc49slmunvD69zj5tpO4q5g4TOAefVzHRUMTJKyHGIBDiBygAPZSEH6UYt3WbJ G/OjADulN/KXuCuF9LYBXaCu2c7YhnYECBMoY1ESklNrAzjqYR6NfKdEE1TtvpsU B9H28vn4Bs9hV0xufSVSr5C2AwPsQRmlDevFwlSsLabD5UF+vcTKPIzefSi4HXbL XvUkjlHtSX4lCvsXli3KAIzd0iVLcEa6LOhnVztgKxQSq5/c/qSXgyz9Ov5MU3sz yNOIeCKsH0qyGQoh8nDyGB7gxOF7Wege9bVJ/Dc+zP++jazXDOo6r9UoopnQzq/D P1aIhtPhdq/uluVMVkXWLk3AKEXHYmKJRToQvu4n9Jywtvt4oVMR5wnOlrYg8YBY ZnARNVzHDjrfUs01Trawgf7BSpdftZQTDBwN4TVFTXwmv1Y0uxvV3J7tpyOeKjpM wYkrcZ28p4Jf6A0QG9AVUN68lc4xsus6DtM8FYd9+DC95rO/GMYor76PeO/aoZ0f tYLD/iWvI0AefxZq5U7C+APQWSrbv33o/+NL+vPZqAI= From: Bean Huo From: Bean Huo block_commit_write() always returns 0, this patch changes it to return void. Signed-off-by: Bean Huo Reviewed-by: Jan Kara Acked-by: Theodore Ts'o --- fs/buffer.c | 14 ++++++-------- fs/ext4/move_extent.c | 7 ++----- fs/ocfs2/file.c | 7 +------ fs/udf/file.c | 6 +++--- include/linux/buffer_head.h | 2 +- 5 files changed, 13 insertions(+), 23 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 50821dfb02f7..1568d0c9942d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2180,7 +2180,7 @@ int __block_write_begin(struct page *page, loff_t pos, unsigned len, } EXPORT_SYMBOL(__block_write_begin); -static int __block_commit_write(struct folio *folio, size_t from, size_t to) +static void __block_commit_write(struct folio *folio, size_t from, size_t to) { size_t block_start, block_end; bool partial = false; @@ -2215,7 +2215,6 @@ static int __block_commit_write(struct folio *folio, size_t from, size_t to) */ if (!partial) folio_mark_uptodate(folio); - return 0; } /* @@ -2597,11 +2596,10 @@ int cont_write_begin(struct file *file, struct address_space *mapping, } EXPORT_SYMBOL(cont_write_begin); -int block_commit_write(struct page *page, unsigned from, unsigned to) +void block_commit_write(struct page *page, unsigned from, unsigned to) { struct folio *folio = page_folio(page); __block_commit_write(folio, from, to); - return 0; } EXPORT_SYMBOL(block_commit_write); @@ -2647,11 +2645,11 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, end = size - folio_pos(folio); ret = __block_write_begin_int(folio, 0, end, get_block, NULL); - if (!ret) - ret = __block_commit_write(folio, 0, end); + if (unlikely(ret)) + goto out_unlock; + + __block_commit_write(folio, 0, end); - if (unlikely(ret < 0)) - goto out_unlock; folio_mark_dirty(folio); folio_wait_stable(folio); return 0; diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c index b5af2fc03b2f..f4b4861a74ee 100644 --- a/fs/ext4/move_extent.c +++ b/fs/ext4/move_extent.c @@ -392,14 +392,11 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode, for (i = 0; i < block_len_in_page; i++) { *err = ext4_get_block(orig_inode, orig_blk_offset + i, bh, 0); if (*err < 0) - break; + goto repair_branches; bh = bh->b_this_page; } - if (!*err) - *err = block_commit_write(&folio[0]->page, from, from + replaced_size); - if (unlikely(*err < 0)) - goto repair_branches; + block_commit_write(&folio[0]->page, from, from + replaced_size); /* Even in case of data=writeback it is reasonable to pin * inode to transaction, to prevent unexpected data loss */ diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 91a194596552..9e417cd4fd16 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -808,12 +808,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, /* must not update i_size! */ - ret = block_commit_write(page, block_start + 1, - block_start + 1); - if (ret < 0) - mlog_errno(ret); - else - ret = 0; + block_commit_write(page, block_start + 1, block_start + 1); } /* diff --git a/fs/udf/file.c b/fs/udf/file.c index 243840dc83ad..0292d75e60cc 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c @@ -63,13 +63,13 @@ static vm_fault_t udf_page_mkwrite(struct vm_fault *vmf) else end = PAGE_SIZE; err = __block_write_begin(page, 0, end, udf_get_block); - if (!err) - err = block_commit_write(page, 0, end); - if (err < 0) { + if (err) { unlock_page(page); ret = block_page_mkwrite_return(err); goto out_unlock; } + + block_commit_write(page, 0, end); out_dirty: set_page_dirty(page); wait_for_stable_page(page); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 6cb3e9af78c9..a7377877ff4e 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -288,7 +288,7 @@ int cont_write_begin(struct file *, struct address_space *, loff_t, unsigned, struct page **, void **, get_block_t *, loff_t *); int generic_cont_expand_simple(struct inode *inode, loff_t size); -int block_commit_write(struct page *page, unsigned from, unsigned to); +void block_commit_write(struct page *page, unsigned int from, unsigned int to); int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, get_block_t get_block); /* Convert errno to return value from ->page_mkwrite() call */