Commit 5bdf402a authored by Ritesh Harjani (IBM)'s avatar Ritesh Harjani (IBM) Committed by Theodore Ts'o

fs/buffer: make submit_bh & submit_bh_wbc return type as void

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarRitesh Harjani (IBM) <ritesh.list@gmail.com>
Link: https://lore.kernel.org/r/cb66ef823374cdd94d2d03083ce13de844fffd41.1660788334.git.ritesh.list@gmail.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent ab620620
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
#include "internal.h" #include "internal.h"
static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); 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, static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
struct writeback_control *wbc); struct writeback_control *wbc);
#define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) #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) ...@@ -2673,8 +2673,8 @@ static void end_bio_bh_io_sync(struct bio *bio)
bio_put(bio); bio_put(bio);
} }
static int submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, static void submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
struct writeback_control *wbc) struct writeback_control *wbc)
{ {
const enum req_op op = opf & REQ_OP_MASK; const enum req_op op = opf & REQ_OP_MASK;
struct bio *bio; struct bio *bio;
...@@ -2717,12 +2717,11 @@ static int submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh, ...@@ -2717,12 +2717,11 @@ static int submit_bh_wbc(blk_opf_t opf, struct buffer_head *bh,
} }
submit_bio(bio); 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); EXPORT_SYMBOL(submit_bh);
......
...@@ -229,7 +229,7 @@ void ll_rw_block(blk_opf_t, int, struct buffer_head * bh[]); ...@@ -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);
int __sync_dirty_buffer(struct buffer_head *bh, blk_opf_t op_flags); 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); 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, void write_boundary_block(struct block_device *bdev,
sector_t bblock, unsigned blocksize); sector_t bblock, unsigned blocksize);
int bh_uptodate_or_lock(struct buffer_head *bh); int bh_uptodate_or_lock(struct buffer_head *bh);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment