From patchwork Mon Jun 20 09:04:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 12887146 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47EDEC433EF for ; Mon, 20 Jun 2022 09:04:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240465AbiFTJE4 (ORCPT ); Mon, 20 Jun 2022 05:04:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240453AbiFTJEy (ORCPT ); Mon, 20 Jun 2022 05:04:54 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99A58DF4; Mon, 20 Jun 2022 02:04:53 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id k7so9180134plg.7; Mon, 20 Jun 2022 02:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IGedjyJtOwhuKaMc6tFtvZiQjA/4iP2eLJyYJB25T2c=; b=f16Ctp/rQzwImm0eOheSgm0oPUuIymrb9sJiPlfBawLu91YcBShqXugdHCfmyMmASs 33qMCqs8aolPdlmB01FMj8LSRw12sggBcX3OrOu8NwnxcCZO4WojEj2IvX9WwQmYk3JS F+Jmi0y/wDCCISvnOcvcrF2RtF6QOgl4yNM+WNTCgwehgb1EUv5t6euK3DSja+Xz+JTw xQgXtVk4bMiLs6dRhXCO6HFQ/iCN4cHBngF70NfRkWz4vED+ByAPD0GiALEu5XUbHSXp tAv126OvR64bzmXqiPL+JQU0uUZvJDzHQGhpkpds6o+TEBLa4GSzoLIIxnVNjLK/iYMN Mj8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IGedjyJtOwhuKaMc6tFtvZiQjA/4iP2eLJyYJB25T2c=; b=QPkUXyvSlGPAlNSNu5qVtzKMtjrXK5DwgHGhlU6mvUwa5WNFgUsNhgYjfD4mCqfV/V 8sgYww6P+QYk29yJayCIo2VNEqYkH1Xic3ACI4ug3zA2L3bKWbWPFs5vSi9wu3toOEhv AeJ/qXSlR35ob9H9OUmNDAGyKjc3GnAPehGorVxp6W8aGVBmEjzzg6s2i1FHyumMmV96 JFfjnHw0z4WkgGZSUZF3a1N1n0SrlW7NyUatYbwY5LruBcIlE2VFxYbu2QbXTcJC+z7p BuwgDUllZwzlP1N6xVVU93PePvZkHazbSdf+odauk38u1tH8+V/J3LWK8k/DwplG9QRt 2m5Q== X-Gm-Message-State: AJIora9Cux24RDCxr5neHkMXTek/7VBoLY8j6Zy3M+Pk3SVvRQb6qCtP B8Gntu7BMTJqPgXwLukVdfDXWO+V6PU= X-Google-Smtp-Source: AGRyM1uJ05tB7F46GdOnpfPTix+8IlPfQMhu0Hw6oIcsFs+XaQtmsV6Drgm2z5mdzoIQ96Su3UCyhg== X-Received: by 2002:a17:90b:1b10:b0:1e8:2966:3232 with SMTP id nu16-20020a17090b1b1000b001e829663232mr36765228pjb.103.1655715892967; Mon, 20 Jun 2022 02:04:52 -0700 (PDT) Received: from localhost ([2406:7400:63:5d34:e6c2:4c64:12ae:aa11]) by smtp.gmail.com with ESMTPSA id g23-20020a17090a579700b001eaec814132sm8770115pji.3.2022.06.20.02.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 02:04:52 -0700 (PDT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , Ritesh Harjani Subject: [PATCHv2 1/4] jbd2: Drop useless return value of submit_bh Date: Mon, 20 Jun 2022 14:34:34 +0530 Message-Id: <57b9cb59e50dfdf68eef82ef38944fbceba4e585.1655715329.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org submit_bh always returns 0. This patch cleans up 2 of it's caller in jbd2 to drop submit_bh's useless return value. Once all submit_bh callers are cleaned up, we can make it's return type as void. Reviewed-by: Christoph Hellwig Signed-off-by: Ritesh Harjani --- fs/jbd2/commit.c | 11 +++++------ fs/jbd2/journal.c | 6 ++---- 2 files changed, 7 insertions(+), 10 deletions(-) -- 2.35.3 diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index eb315e81f1a6..688fd960d01f 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -122,8 +122,8 @@ static int journal_submit_commit_record(journal_t *journal, { struct commit_header *tmp; struct buffer_head *bh; - int ret; struct timespec64 now; + int write_flags = REQ_SYNC; *cbh = NULL; @@ -155,13 +155,12 @@ static int journal_submit_commit_record(journal_t *journal, if (journal->j_flags & JBD2_BARRIER && !jbd2_has_feature_async_commit(journal)) - ret = submit_bh(REQ_OP_WRITE, - REQ_SYNC | REQ_PREFLUSH | REQ_FUA, bh); - else - ret = submit_bh(REQ_OP_WRITE, REQ_SYNC, bh); + write_flags |= REQ_PREFLUSH | REQ_FUA; + + submit_bh(REQ_OP_WRITE, write_flags, bh); *cbh = bh; - return ret; + return 0; } /* diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index c0cbeeaec2d1..81a282e676bc 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1606,7 +1606,7 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags) { struct buffer_head *bh = journal->j_sb_buffer; journal_superblock_t *sb = journal->j_superblock; - int ret; + int ret = 0; /* Buffer got discarded which means block device got invalidated */ if (!buffer_mapped(bh)) { @@ -1636,14 +1636,12 @@ static int jbd2_write_superblock(journal_t *journal, int write_flags) sb->s_checksum = jbd2_superblock_csum(journal, sb); get_bh(bh); bh->b_end_io = end_buffer_write_sync; - ret = submit_bh(REQ_OP_WRITE, write_flags, bh); + submit_bh(REQ_OP_WRITE, write_flags, bh); wait_on_buffer(bh); if (buffer_write_io_error(bh)) { clear_buffer_write_io_error(bh); set_buffer_uptodate(bh); ret = -EIO; - } - if (ret) { printk(KERN_ERR "JBD2: Error %d detected when updating " "journal superblock for %s.\n", ret, journal->j_devname); From patchwork Mon Jun 20 09:04:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 12887147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADC32C43334 for ; Mon, 20 Jun 2022 09:05:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240513AbiFTJFK (ORCPT ); Mon, 20 Jun 2022 05:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240474AbiFTJFI (ORCPT ); Mon, 20 Jun 2022 05:05:08 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DC0D103C; Mon, 20 Jun 2022 02:04:58 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id m2so1917886plx.3; Mon, 20 Jun 2022 02:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JcQlji3Cx+j7uayBebQyTWGNyA+9EAfDG0gMAxfScdY=; b=hMF0YeBQsMuGkQucRNSSxO6r56Chmy9P8vzkEn5YcXpVN+G3biF3IBUwvoC+a9NwBw 6MeDckSTwmdtr21aSRYyxNtrOuVMTtP+ZlAHHpHdZF9q+UfJKiypKlgWgu5NnS1K/x1z yZ5ljee7VnjnYje+S3SUgeTL5CNSpXOGhBTMtxY4GMjmb/f42QwcNAQZ6OGOPlGAlx4J NHu/2YGcmGkdChA794qn9JcYiNRMCQ2nmqe+RiqCPZ/w+jiNjq/SjOfdMJOug70i9/5M HSREI9P2YFbpfRoClHygDV2cXFoCYs/3+jd/8qY84/W6EqP4rkuCig9yW6Nh9DCePZVc q3aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JcQlji3Cx+j7uayBebQyTWGNyA+9EAfDG0gMAxfScdY=; b=1ZjpgBP9I0DjlDIeDmnqd8+hfzY8eNSJvTV+Mb5XyD+BKpfS62Q0xplAO/Gh4TvYWk BWxSY+hiVbaVp+dg6hdzsbIECFizumx7uMr81d2todYsQDFp+S9zEezWVpb4f3kUgmq9 7iCpArF7xBnSIbybB7BCIW/LVfdJvzCr5gr+EO/dIIL/w/KEsVOmgJPNQPG+WVRulOxp T+ceeA4C8st6w91e1SFRHpwnWsGvsFJVxqXM2Kg6ZuBkfVSAve+l7OilT3A9zaSbk2F0 6WP4uIDIpTN+VgLuYdRAu7DjzRQzz/L+FmCCGxaEgdJDkIJ+ynYmYMY2RsoseXKKgGqy InPw== X-Gm-Message-State: AJIora+maaRTTOw6k1olVgKGF6Vs0xzdKoYZge+oMQkuBD922frzRMyx UUfdbe8LMUqAijt322xILqyFGK7O3yk= X-Google-Smtp-Source: AGRyM1t0Qv4vd6sWgSWK05Xy69C8ijWQ12ehSDvnJyGZPM8ovJa+4zEhwBim5llOyOSUTUVIfYPz/g== X-Received: by 2002:a17:902:e74b:b0:166:4d34:3be3 with SMTP id p11-20020a170902e74b00b001664d343be3mr23078957plf.102.1655715897943; Mon, 20 Jun 2022 02:04:57 -0700 (PDT) Received: from localhost ([2406:7400:63:5d34:e6c2:4c64:12ae:aa11]) by smtp.gmail.com with ESMTPSA id i67-20020a62c146000000b00524c5c236a6sm2308583pfg.33.2022.06.20.02.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 02:04:57 -0700 (PDT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , Ritesh Harjani , kernel test robot Subject: [PATCHv2 2/4] fs/ntfs: Drop useless return value of submit_bh from ntfs_submit_bh_for_read Date: Mon, 20 Jun 2022 14:34:35 +0530 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org submit_bh always returns 0. This patch drops the useless return value of submit_bh from ntfs_submit_bh_for_read(). Once all of submit_bh callers are cleaned up, we can make it's return type as void. Reported-by: kernel test robot Signed-off-by: Ritesh Harjani Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig --- fs/ntfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.35.3 diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index a8abe2296514..2389bfa654a2 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -532,12 +532,12 @@ static inline int __ntfs_grab_cache_pages(struct address_space *mapping, goto out; } -static inline int ntfs_submit_bh_for_read(struct buffer_head *bh) +static inline void ntfs_submit_bh_for_read(struct buffer_head *bh) { lock_buffer(bh); get_bh(bh); bh->b_end_io = end_buffer_read_sync; - return submit_bh(REQ_OP_READ, 0, bh); + submit_bh(REQ_OP_READ, 0, bh); } /** From patchwork Mon Jun 20 09:04:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 12887148 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56C68CCA479 for ; Mon, 20 Jun 2022 09:05:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240546AbiFTJFQ (ORCPT ); Mon, 20 Jun 2022 05:05:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240498AbiFTJFJ (ORCPT ); Mon, 20 Jun 2022 05:05:09 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CB5F558D; Mon, 20 Jun 2022 02:05:03 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d17so686248pfq.9; Mon, 20 Jun 2022 02:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XS460ssN5m8qIg3j92C0hAPAV/Z5ErmQruhxnIIvXYY=; b=CiCtG6+GH5kziOsKycnqctyJHyCpazKfIc4YHjwpme8uwPmn1ldfoRY5P0BNShFdmc IqOmxBdJwBCBHpsGGJtI/130YEWeNPuOSz9g69Ba0JMJqBP/5oLpndCqJErSm9YDKwZS WKMIeCHxqErAHt3Dx+TxWEDsp3+HVS06+JDFeNFqiIisCsfSHDhSRrxGdf+5Na8Xpt+Q 0zGJgB7+hA36TkKW9NvubAQqiGcWAml0M7GRuixFegn4gS0oqTnYAusGHxukPQOFAbyy X7bYDstD+aCPNxGO1E+0eGYT2rf0amFvEmEbCiPLlhyWvZ9Idf/EpWj0Yc3zM4A4LEe1 P/cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XS460ssN5m8qIg3j92C0hAPAV/Z5ErmQruhxnIIvXYY=; b=32ENWMKPJVsXS0c+1tmYwaorMXyqewi4nCwfuOak7aQvysbvx0MpdPHYiYQvH2xwz3 opJmf7sqX57vRPBxDGbqesrZJvaMDqZkXI/dKy3EDZXpGlsVzm8+jvQfVBF5s8qbN1EZ +TsIzMo4Lr3STRjrDsxkvZiDLKIZngGHqxNw2sRzzOcXv3QtFT6C1plzc7TVxP6MPnQn 9Vd4FC6tc0UC+tDkzfKd2MFFcvJ5coJEpXZmEv1eGSPYWkmgrfQbN5HEWnWZUeMB0cVE fdUIUuTCeXkdJ2eR+Xb2zWMEnHtKwWTCU7jQyjSSs4Dw0101/4x4eyejV7wVOvWe49lF 5m1w== X-Gm-Message-State: AJIora+HMPvkzeaw/JrWFZzV/tS5mAvHTpAcVJOTtDFMZcn/E1Acue+H 9oscwW9KypelLKfgi2MxHm+g3W+wL78= X-Google-Smtp-Source: AGRyM1vS8kGELbdV19Vr9wEXmhMd8sWuZgDKEJEyqEtTXc0eThP/isu3vjt9Jgjx/pOpBYIaKLoEow== X-Received: by 2002:a65:6a05:0:b0:3db:27cb:9123 with SMTP id m5-20020a656a05000000b003db27cb9123mr20834886pgu.497.1655715903020; Mon, 20 Jun 2022 02:05:03 -0700 (PDT) Received: from localhost ([2406:7400:63:5d34:e6c2:4c64:12ae:aa11]) by smtp.gmail.com with ESMTPSA id y10-20020a170902d64a00b0015e8d4eb2c5sm8099729plh.271.2022.06.20.02.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 02:05:02 -0700 (PDT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , Ritesh Harjani Subject: [PATCHv2 3/4] fs/buffer: Drop useless return value of submit_bh Date: Mon, 20 Jun 2022 14:34:36 +0530 Message-Id: <0930c57e0943c4ec7a184725a3d036f917081da6.1655715329.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org submit_bh always returns 0. This patch drops the useless return value of submit_bh from __sync_dirty_buffer(). Once all of submit_bh callers are cleaned up, we can make it's return type as void. Reviewed-by: Christoph Hellwig Signed-off-by: Ritesh Harjani --- fs/buffer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) -- 2.35.3 diff --git a/fs/buffer.c b/fs/buffer.c index 898c7f301b1b..313283af15b6 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -3121,8 +3121,6 @@ EXPORT_SYMBOL(write_dirty_buffer); */ int __sync_dirty_buffer(struct buffer_head *bh, int op_flags) { - int ret = 0; - WARN_ON(atomic_read(&bh->b_count) < 1); lock_buffer(bh); if (test_clear_buffer_dirty(bh)) { @@ -3137,14 +3135,14 @@ int __sync_dirty_buffer(struct buffer_head *bh, int op_flags) get_bh(bh); bh->b_end_io = end_buffer_write_sync; - ret = submit_bh(REQ_OP_WRITE, op_flags, bh); + submit_bh(REQ_OP_WRITE, op_flags, bh); wait_on_buffer(bh); - if (!ret && !buffer_uptodate(bh)) - ret = -EIO; + if (!buffer_uptodate(bh)) + return -EIO; } else { unlock_buffer(bh); } - return ret; + return 0; } EXPORT_SYMBOL(__sync_dirty_buffer); From patchwork Mon Jun 20 09:04:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ritesh Harjani (IBM)" X-Patchwork-Id: 12887149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B54FCCA47E for ; Mon, 20 Jun 2022 09:05:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240557AbiFTJFS (ORCPT ); Mon, 20 Jun 2022 05:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240469AbiFTJFK (ORCPT ); Mon, 20 Jun 2022 05:05:10 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D23C0C44; Mon, 20 Jun 2022 02:05:08 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id a17so7206026pls.6; Mon, 20 Jun 2022 02:05:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zQQNu+xKu/aVWNgACtcsO4n2RX9MyLtbnx8C7isp5xU=; b=QgK0kNAr3B5qx7NDnBmojccPnx5eeut3zS14vACDT6Ehmr8fbX3xcq3Uf2pAo4z9OR Akf8MhSifrNDgvtsRBXiT4fmyVbrnzRn1VkIKx+BHd6baoXU+2Yntf69JUOU9GJa8QfP kHOdtnq76Qd2HUjeFeiEKjY1H2OloZXNI2I8W5QFbgcE8n63FKU/GgW3dk+O9UC0zbkJ r0iWa8OocBiImBTJBQTjEgbI8ItgCfOPL+ezG+1aGzZ9bWxdt+pQRR5XD4vs6zzoqtf6 QXpKDhqwO+WmaNZWN5XzO9GOeXo6w8G0L6E7WdQ+puMlYFh7WZeyqLLtSJWVtoqb9BcJ a5dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zQQNu+xKu/aVWNgACtcsO4n2RX9MyLtbnx8C7isp5xU=; b=Ww71GqKcdKR5R28GdotGH9hBwDf9hFvVb7HE8ZnXaMnwSmsH8fQx8n8khKn5uX0etB c3EOiQLJ7EkRcsFI1UpK/KB1vchrZ2I2CLb0+MnFdeIQSdpZ1Fuh2Tu5pr4/AJn5oRtN xy4isvxQPCm/FWMb1REn+MjRt5CBv9S/JBHbpb+KHLX+0KxEjnV3RPj0yei1mIZhV689 L2uA6qoYYfbNDXC8iM/jYl6Aain9ikC+/MQpRPk9NUtKxuU7d9m4dg0cm7CxruF9UtkP qdvksVg/ar5Prwx6hKAMg2Hfq/WY+KDy5dHOmebtaPxPHFg8ZT9WeUSG7WZqU+ToLFox WWrA== X-Gm-Message-State: AJIora9aY6VfHt8AxZyFO6XXk9lR1t16Bb3Cl+AoZMIXBD0E9lpmx7aQ Y3+zGQROabyk0pwu2iXy8kRTixoQpJc= X-Google-Smtp-Source: AGRyM1vqpVK35b08eJmEdgb51J1AUhZIb4mlFzs0dAdNQBNbaujlaNErJbc80pxjIFiDchcUVzJ75w== X-Received: by 2002:a17:902:7610:b0:16a:805:6ac9 with SMTP id k16-20020a170902761000b0016a08056ac9mr15459124pll.119.1655715908114; Mon, 20 Jun 2022 02:05:08 -0700 (PDT) Received: from localhost ([2406:7400:63:5d34:e6c2:4c64:12ae:aa11]) by smtp.gmail.com with ESMTPSA id f9-20020a170902684900b0016a07e3b0c0sm5819982pln.148.2022.06.20.02.05.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 02:05:07 -0700 (PDT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , Ritesh Harjani Subject: [PATCHv2 4/4] fs/buffer: Make submit_bh & submit_bh_wbc return type as void Date: Mon, 20 Jun 2022 14:34:37 +0530 Message-Id: <5c8fd257bd86f8f2a3f97b72ef46c85c4f5030b1.1655715329.git.ritesh.list@gmail.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org submit_bh/submit_bh_wbc are non-blocking functions which just submit the bio and return. The caller of submit_bh/submit_bh_wbc needs to wait on buffer till I/O completion and then check buffer head's b_state field to know if there was any I/O error. Hence there is no need for these functions to have any return type. Even now they always returns 0. Hence drop the return value and make their return type as void to avoid any confusion. Reviewed-by: Christoph Hellwig Signed-off-by: Ritesh Harjani --- fs/buffer.c | 9 ++++----- include/linux/buffer_head.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) -- 2.35.3 diff --git a/fs/buffer.c b/fs/buffer.c index 313283af15b6..6671abc98e21 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -52,7 +52,7 @@ #include "internal.h" static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); -static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, +static void submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, struct writeback_control *wbc); #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) @@ -2994,7 +2994,7 @@ static void end_bio_bh_io_sync(struct bio *bio) bio_put(bio); } -static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, +static void submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, struct writeback_control *wbc) { struct bio *bio; @@ -3037,12 +3037,11 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, } submit_bio(bio); - return 0; } -int submit_bh(int op, int op_flags, struct buffer_head *bh) +void submit_bh(int op, int op_flags, struct buffer_head *bh) { - return submit_bh_wbc(op, op_flags, bh, NULL); + submit_bh_wbc(op, op_flags, bh, NULL); } EXPORT_SYMBOL(submit_bh); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index c9d1463bb20f..392d7d5aec05 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -205,7 +205,7 @@ void ll_rw_block(int, int, int, struct buffer_head * bh[]); int sync_dirty_buffer(struct buffer_head *bh); int __sync_dirty_buffer(struct buffer_head *bh, int op_flags); void write_dirty_buffer(struct buffer_head *bh, int op_flags); -int submit_bh(int, int, struct buffer_head *); +void submit_bh(int op, int op_flags, struct buffer_head *bh); void write_boundary_block(struct block_device *bdev, sector_t bblock, unsigned blocksize); int bh_uptodate_or_lock(struct buffer_head *bh);