linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ritesh Harjani <ritesh.list@gmail.com>
To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org
Cc: Jan Kara <jack@suse.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Ritesh Harjani <ritesh.list@gmail.com>
Subject: [RFC 2/3] fs/buffer: Drop useless return value of submit_bh
Date: Mon, 20 Jun 2022 11:28:41 +0530	[thread overview]
Message-ID: <77274d2a2030f6ee06901496f9c5fbe8779127a3.1655703467.git.ritesh.list@gmail.com> (raw)
In-Reply-To: <cover.1655703466.git.ritesh.list@gmail.com>

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 <ritesh.list@gmail.com>
---
 fs/buffer.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

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);
 
-- 
2.35.3


  parent reply	other threads:[~2022-06-20  5:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20  5:58 [RFC 0/3] submit_bh: Drop unnecessary return values and API users Ritesh Harjani
2022-06-20  5:58 ` [RFC 1/3] jbd2: Drop useless return value of submit_bh Ritesh Harjani
2022-06-20  6:39   ` Christoph Hellwig
2022-06-20  9:39   ` Jan Kara
2022-06-21  1:39   ` Matthew Wilcox
2022-07-04  9:01     ` Ritesh Harjani
2022-07-18 17:55       ` Ritesh Harjani
2022-06-20  5:58 ` Ritesh Harjani [this message]
2022-06-20  6:39   ` [RFC 2/3] fs/buffer: " Christoph Hellwig
2022-06-20  9:40   ` Jan Kara
2022-06-20  5:58 ` [RFC 3/3] fs/buffer: Make submit_bh & submit_bh_wbc return type as void Ritesh Harjani
2022-06-20  6:40   ` Christoph Hellwig
2022-06-20  9:41   ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=77274d2a2030f6ee06901496f9c5fbe8779127a3.1655703467.git.ritesh.list@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).