All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ritesh Harjani <ritesh.list@gmail.com>
Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	Jan Kara <jack@suse.com>,
	Alexander Viro <viro@zeniv.linux.org.uk>
Subject: Re: [RFC 3/3] fs/buffer: Make submit_bh & submit_bh_wbc return type as void
Date: Mon, 20 Jun 2022 11:41:46 +0200	[thread overview]
Message-ID: <20220620094146.vlhtxiqv7ncehgfn@quack3.lan> (raw)
In-Reply-To: <ba89f469a59cfaca49478ee391e6bc9dde456e19.1655703467.git.ritesh.list@gmail.com>

On Mon 20-06-22 11:28:42, Ritesh Harjani wrote:
> submit_bh/submit_bh_wbc are non-blocking functions which just submits
> the bio and returns. 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.
> 
> Signed-off-by: Ritesh Harjani <ritesh.list@gmail.com>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/buffer.c                 | 9 ++++-----
>  include/linux/buffer_head.h | 2 +-
>  2 files changed, 5 insertions(+), 6 deletions(-)
> 
> 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);
> -- 
> 2.35.3
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

      parent reply	other threads:[~2022-06-20  9:41 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 ` [RFC 2/3] fs/buffer: " Ritesh Harjani
2022-06-20  6:39   ` 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 [this message]

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=20220620094146.vlhtxiqv7ncehgfn@quack3.lan \
    --to=jack@suse.cz \
    --cc=jack@suse.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=ritesh.list@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.