From patchwork Thu Aug 18 05: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: 12946765 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 BFEDBC28B2B for ; Thu, 18 Aug 2022 05:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243118AbiHRFFL (ORCPT ); Thu, 18 Aug 2022 01:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242769AbiHRFFG (ORCPT ); Thu, 18 Aug 2022 01:05:06 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79D869F1B6; Wed, 17 Aug 2022 22:05:04 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id jm11so579839plb.13; Wed, 17 Aug 2022 22:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=CIXPojNt+yIDbPYg2qBN1uuNsthwKBFWVWuxVjGTqgo=; b=TRzMhtMr+7LC87xERlKGV5G6CxzQx5xbGT9HbWz+Gnh28ZyzkvcbsRPRjazJEIfiPk OchvFk0j2y8dQA88uW4rT4kDzx19T1pUsNZTk0MmswMmjf+7h4D+dWq1lTTjhjcPJ5wB nEzMroSn59Bcyv5lVTp17tbHffMFvptE4IG9vpy2Vc5NH43IpTuAGu8UoS4ZY5OOAs4C 52QKxhNOeeYFJ+RfiJa44rn6QxL3GzYy7YfHwhkr/vobUhRYio1ywP8+xrhQ4H1WEIlo Z8Sv4XRhLzksyrD29r08JtoRZkrFEjnasi7Dp4jqFmClN8/q9FN6OfT0vEs35q+EyXVq Tb7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=CIXPojNt+yIDbPYg2qBN1uuNsthwKBFWVWuxVjGTqgo=; b=tbOF1zF/n/MrSHnrkGKyHdBvKPF1ki9O6k80cpqASgYqbiiB101RN7OX4U4kuOeq2w hu1xH0tjHCScL2QbVEBa7W3EHipaLJZNMesnDRFjq7mHiykuCN+qErp0d7fZMTm7M1bx yQ8KlW3c0fFsViNR2by4opeYxZoQnZqu9SWsT/fYNeBy1itld4WkBzN7Lat/WJ3sFxR6 QAT1eVlCwJgf5k5bfnDc/ZMjPKkHm894gIvYaZkuYtqqRN7tIqKJPINTdVr+BMIJ0CZ1 ZpEWaOtxBpNAuS4uUXT6uDINau4PwHn0D2obHr9mlMtpUKhrntJEJ9kYFt7ZZnSLaly/ 9oaQ== X-Gm-Message-State: ACgBeo1chpgMQF16Zcmt+VbvOXmWIGy0avf+DEwZBHJNsVS0DfLetyIW m7sSLFtZFTBP+1Sf9zo2ts+wGk/5CNw= X-Google-Smtp-Source: AA6agR6AL0hNqRWZBg/FFHYRTLG1VbwkZ8VSQJ/nomhHtQdOhWavTe/L/Dc9wFHjH4XDt5Vf6166vg== X-Received: by 2002:a17:902:dac9:b0:172:af95:2db4 with SMTP id q9-20020a170902dac900b00172af952db4mr1414037plx.70.1660799103779; Wed, 17 Aug 2022 22:05:03 -0700 (PDT) Received: from localhost ([2406:7400:63:e947:599c:6cd1:507f:801e]) by smtp.gmail.com with ESMTPSA id j8-20020a170902da8800b0016edff78844sm330530plx.277.2022.08.17.22.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 22:05:03 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , linux-ntfs-dev@lists.sourceforge.net, "Ritesh Harjani (IBM)" , Jan Kara Subject: [PATCHv3 1/4] jbd2: Drop useless return value of submit_bh Date: Thu, 18 Aug 2022 10:34:37 +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 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 Reviewed-by: Jan Kara Signed-off-by: Ritesh Harjani (IBM) --- fs/jbd2/commit.c | 10 ++++------ fs/jbd2/journal.c | 9 ++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index b2b2bc9b88d9..6b51d2dc56e2 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; + blk_opf_t write_flags = REQ_OP_WRITE | REQ_SYNC; *cbh = NULL; @@ -155,13 +155,11 @@ 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(write_flags, bh); *cbh = bh; - return ret; + return 0; } /* diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 6350d3857c89..f669ae1ff7a2 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1606,7 +1606,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t 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,7 +1636,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t 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); @@ -1644,9 +1644,8 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags) ret = -EIO; } if (ret) { - printk(KERN_ERR "JBD2: Error %d detected when updating " - "journal superblock for %s.\n", ret, - journal->j_devname); + printk(KERN_ERR "JBD2: I/O error when updating journal superblock for %s.\n", + journal->j_devname); if (!is_journal_aborted(journal)) jbd2_journal_abort(journal, ret); } From patchwork Thu Aug 18 05:04:38 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: 12946766 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 BA77CC28B2B for ; Thu, 18 Aug 2022 05:05:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242769AbiHRFF2 (ORCPT ); Thu, 18 Aug 2022 01:05:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243236AbiHRFFV (ORCPT ); Thu, 18 Aug 2022 01:05:21 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 769439F1B6; Wed, 17 Aug 2022 22:05:09 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id s3-20020a17090a2f0300b001facfc6fdbcso85270pjd.1; Wed, 17 Aug 2022 22:05:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=H9LcEe7zEKnk+9IZlOILIvCS3X4aqgzROjS1RylQ0vk=; b=O/GJsSfPhcy+Of5V4UT7yETG3vCUIKm/Q238ob/rxctPqNVehoIR3RmJ3RgcRUdpcX S4UZK+IlX5dnQkYXUh1o+/CuHKEyQNWWH42EF+o/gUCvH9OujxjeshxB7zJzAgMh2cOa fhtH/xMYrjyIjNqrmJScuPl5rjE1aSbs/TpHCllSyhfGYNZfuvf0PBbYhoV2rUIx2Ekt 7ATiy8SBxZslgNESHJSYxSGzlKu1esTYc9xgwghrgNkCshhAUtwvN8wH8mgrem0E6EUT LQuMnIs1J7vLeS8jyyEivfyHK/+dpG+ONneCI6HVNVCFFtsb8fYOI72H91fSE7kbJvwH 4P0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=H9LcEe7zEKnk+9IZlOILIvCS3X4aqgzROjS1RylQ0vk=; b=mKO2jm7uTW7I1xO5p4eKcAIxCjZRYVm2GBXM+q4+yyoZF6vSyTPpBnlguhAE67u5KH PZ5CBuciwrjOHPRkGGgZ5KyiL8/G5V6RbetqRlAx6fIAKcmveu2V4GenNTcew4l8vuXq DGgnXYJhJ8U62XCsaHlkscw4BtS83KgWqOC11ONv7HdWqDrRMlD8P9EwVPtIUM/qcNsQ DDiNW/vwM7BPB66dRNpBMl2MDYKxEGqKQSA3iKyRUO2/+QDQz8+669+vPkgovok+j5T6 V2tlxpLNHT203BqoNTm+9ExLtmuhzAsUvNHkai8Ht91Ul/sZ7SWG/RNDyfw0danEGiVQ vF7g== X-Gm-Message-State: ACgBeo3wf2NPM1vMd7ydVf4WOscoEWi5bkzVXwika0mRBPPUhXDkrBiD C8Rp1OSWalLpbt3/vWQ3cG2K04pjYCE= X-Google-Smtp-Source: AA6agR4nrtFCShyY4xJTyNMckutRPqP+qbkHjfhCB1bh7rFxF4YlvMnYZf+6wwEr1XuCgxsoFOlsmQ== X-Received: by 2002:a17:90a:c782:b0:1f7:a4ed:11a1 with SMTP id gn2-20020a17090ac78200b001f7a4ed11a1mr1413246pjb.12.1660799108853; Wed, 17 Aug 2022 22:05:08 -0700 (PDT) Received: from localhost ([2406:7400:63:e947:599c:6cd1:507f:801e]) by smtp.gmail.com with ESMTPSA id b19-20020aa79513000000b0052e26b8f610sm468903pfp.89.2022.08.17.22.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 22:05:08 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , linux-ntfs-dev@lists.sourceforge.net, "Ritesh Harjani (IBM)" , Jan Kara , kernel test robot Subject: [PATCHv3 2/4] fs/ntfs: Drop useless return value of submit_bh from ntfs_submit_bh_for_read Date: Thu, 18 Aug 2022 10:34:38 +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. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Reported-by: kernel test robot Signed-off-by: Ritesh Harjani --- fs/ntfs/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index 58b660dbbee9..c481b14e4fd9 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c @@ -527,12 +527,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, bh); + submit_bh(REQ_OP_READ, bh); } /** From patchwork Thu Aug 18 05:04:39 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: 12946767 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 E9254C28B2B for ; Thu, 18 Aug 2022 05:05:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243227AbiHRFF3 (ORCPT ); Thu, 18 Aug 2022 01:05:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243322AbiHRFFW (ORCPT ); Thu, 18 Aug 2022 01:05:22 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95FB7A6C5F; Wed, 17 Aug 2022 22:05:14 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id f21so645044pjt.2; Wed, 17 Aug 2022 22:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=lFuT8sSYLisADIw9ypCi2dSipGCRvABVMWuXbHp7qjo=; b=X0zxD3ZngJqjrX8kUd/aa/EKxd3QJ4ZJS8mx9d3QoEEhujzjKKJkTW4N7x+zbs3gNd 9SoeKQr1iZugICY2hKCKXK/enkv2R5Pm2Z2JEbRe8V+okITZGaCW9FPphK1iGjqgYVPc CTiVlRQKlSDrVf885a7/I+7QeQwXgonXuveQJCACCyjo//48vHBq0KyFawLzag40hr9V Rto0b8EqF36V1cvL4b52DOByjqvyZpjGnGkSG7qzLT8KIRwDoNFKEuP9dtAHJOtN9AR5 Mcbe6SrYtfCAoDKsafGB+ov7oAxkIKGg5EAsgncs6v8649kcePvW/ZanY4XJgtw3aWVU iXkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=lFuT8sSYLisADIw9ypCi2dSipGCRvABVMWuXbHp7qjo=; b=FxV/pmk2Qjq4NEvvhjwVAyM27rJknW++5l4OX4GNWNQel2MVSRIdcS1uw9n8gBTR2h FS5ssFVMsPku9UkszncLaTyNq1Db9i/FU9jpczSCHL2VURDAXsWqlXkTkyTRT+Q7spNT ob3Fc//mD9LN73B9Ayml1tadRIjVmyIkINDzFoVjib2ubSqlBrHn6xt9mrd73d7+3N/7 f8XdKA+fjvdgYu59h1YPs6ioNpCpBTiwfTqvQVQxO+v7r8oZoMjrKPQn6swnHPZS39TH VaG6NbU3i5kjPTWCxiWPc65RnM1relarZTvdf7WsXH6lSPuUSXpbx9Xnb6hJgT4ekdv8 XGFQ== X-Gm-Message-State: ACgBeo3UrSNilIMleTLzm4mLIgNPmNofLF9hw1u7epdliTm/REJ5Bksf 8Aq21pv2tSKKufAx04O1nWdDFmiLzKY= X-Google-Smtp-Source: AA6agR5c77dm8IiYPzs/0gbhhy7RFfLV4ONF1BmzOkWorGSf/RPH/2cgmWzAjGAvys1oNQiiiqMrkg== X-Received: by 2002:a17:902:ab98:b0:172:a566:d462 with SMTP id f24-20020a170902ab9800b00172a566d462mr1195248plr.53.1660799113945; Wed, 17 Aug 2022 22:05:13 -0700 (PDT) Received: from localhost ([2406:7400:63:e947:599c:6cd1:507f:801e]) by smtp.gmail.com with ESMTPSA id w1-20020a170902e88100b0016f196209c9sm343614plg.123.2022.08.17.22.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 22:05:13 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , linux-ntfs-dev@lists.sourceforge.net, "Ritesh Harjani (IBM)" Subject: [PATCHv3 3/4] fs/buffer: Drop useless return value of submit_bh Date: Thu, 18 Aug 2022 10:34:39 +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 __sync_dirty_buffer(). Once all of submit_bh callers are cleaned up, we can make it's return type as void. Signed-off-by: Ritesh Harjani (IBM) Reviewed-by: Jan Kara --- fs/buffer.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 55e762a58eb6..c21b72c06eb0 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2801,8 +2801,6 @@ EXPORT_SYMBOL(write_dirty_buffer); */ int __sync_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags) { - int ret = 0; - WARN_ON(atomic_read(&bh->b_count) < 1); lock_buffer(bh); if (test_clear_buffer_dirty(bh)) { @@ -2817,14 +2815,14 @@ int __sync_dirty_buffer(struct buffer_head *bh, blk_opf_t 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 Thu Aug 18 05:04:40 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: 12946768 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 BE4A2C32773 for ; Thu, 18 Aug 2022 05:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243276AbiHRFFb (ORCPT ); Thu, 18 Aug 2022 01:05:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243497AbiHRFFY (ORCPT ); Thu, 18 Aug 2022 01:05:24 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12924A1A70; Wed, 17 Aug 2022 22:05:19 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id 2so632970pll.0; Wed, 17 Aug 2022 22:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=7o9q6zRE/LnQajbGEZFofVIBdR8mGxbes8De4o3wgBI=; b=lTSZFbH1W3gB1hd+vKpaQ4maRyY+LejWXlwd8H4J5CGwKw8gYcZMMrVXDDIAM6R42K HVugf2myQsympLMaiRGNSFJx2pj77DEPcrMKzjwO+0ZoMcVddx0C/RyNW2MSAiF4EM2O rF6dcc1iWppY9YZosFq/E/bNI0sDOeaTKnk7Ih5QhIwkjWWIzKgPp6XDXR2S1ajSl5iZ iUfCitWt9NyHUvD5qLVTjDp8kg8/6PGSH1B6ZtNK2z2lWUc8CyKES6uH+tNTfXsYJGsl gJev7Z/45P7Of2cRD8FjFTYu72lHzesHE8I42VEnUqFKkxDe6KZcuRfzIzmpun1Pn9JV l/dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=7o9q6zRE/LnQajbGEZFofVIBdR8mGxbes8De4o3wgBI=; b=kyxBhgIEwc2nQxGOhFsJQdASz3IRL5+YSy1qTlLnj6eODaOsa9oBNkYjGmPleeOWaN JrSrifD6Zz7LD6Ku7kvzj0+AETVWYtJgRMHgE65+aIyT3Couo7E83gMI2pwP1YzX7PW1 ZJlHKoSaPH45fcWsdxzoOIx2FfidDS3f7eBWn4AOl0XvTG4NeHUH+5Xziz3GvpmJmOUF n7kCMuIBUjyECmC9+0k7SoHx11JyfAYGogsyGmmI9I8D2UU1wWwp5w+v7f3DA85KXKd4 EvA9DC8rAdsptRD8t1+ukRoMP+7Uy2YZ2wGhCjDI+yzxo1ffh/duyExPAUTwWfrUhc9f 8H+Q== X-Gm-Message-State: ACgBeo2osWgjxW8WOfYfglAqGXLamnHfDLOm1sKGK16kLs6GA456IHQ6 NOyMOb4TdsHoLRby1eXdaZ9IFkxtegA= X-Google-Smtp-Source: AA6agR7zRkfBlCwk+TxT4r9iiOceSAqhD0U8vSEdSqityZUqM089DSmox1f0QHE5lfMVykKYq9sWWQ== X-Received: by 2002:a17:902:ea0d:b0:170:cabd:b28 with SMTP id s13-20020a170902ea0d00b00170cabd0b28mr1146909plg.115.1660799119348; Wed, 17 Aug 2022 22:05:19 -0700 (PDT) Received: from localhost ([2406:7400:63:e947:599c:6cd1:507f:801e]) by smtp.gmail.com with ESMTPSA id h17-20020a170902f55100b0016e808dbe55sm350841plf.96.2022.08.17.22.05.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 22:05:18 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , linux-ntfs-dev@lists.sourceforge.net, "Ritesh Harjani (IBM)" , Jan Kara Subject: [PATCHv3 4/4] fs/buffer: Make submit_bh & submit_bh_wbc return type as void Date: Thu, 18 Aug 2022 10:34:40 +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/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 Reviewed-by: Jan Kara Signed-off-by: Ritesh Harjani (IBM) --- fs/buffer.c | 13 ++++++------- include/linux/buffer_head.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index c21b72c06eb0..0a7ba84c1905 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -52,8 +52,8 @@ #include "internal.h" static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); -static int submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, - struct writeback_control *wbc); +static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, + struct writeback_control *wbc); #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) @@ -2673,8 +2673,8 @@ static void end_bio_bh_io_sync(struct bio *bio) bio_put(bio); } -static int submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, - struct writeback_control *wbc) +static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, + struct writeback_control *wbc) { const enum req_op op = opf & REQ_OP_MASK; struct bio *bio; @@ -2717,12 +2717,11 @@ static int submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, } submit_bio(bio); - return 0; } -int submit_bh(blk_opf_t opf, struct buffer_head *bh) +void submit_bh(blk_opf_t opf, struct buffer_head *bh) { - return submit_bh_wbc(opf, bh, NULL); + submit_bh_wbc(opf, bh, NULL); } EXPORT_SYMBOL(submit_bh); diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index def8b8d30ccc..b1373844c43d 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -229,7 +229,7 @@ void ll_rw_block(blk_opf_t, int, struct buffer_head * bh[]); int sync_dirty_buffer(struct buffer_head *bh); int __sync_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags); void write_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags); -int submit_bh(blk_opf_t, struct buffer_head *); +void submit_bh(blk_opf_t, struct buffer_head *); void write_boundary_block(struct block_device *bdev, sector_t bblock, unsigned blocksize); int bh_uptodate_or_lock(struct buffer_head *bh);