From 01d86f023be81c6b96cca5a3db2383469b0e7a41 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 17 Apr 2004 03:27:06 -0700 Subject: [PATCH] [PATCH] kill submit_{bh,bio} return value From: Jeff Garzik Nobody ever checks the return value of submit_bh(), and submit_bh() is the only caller that checks the submit_bio() return value. This changes the kernel I/O submission path -- a fast path -- so this cleanup is also a microoptimization. --- drivers/block/ll_rw_blk.c | 3 +-- fs/buffer.c | 4 ++-- include/linux/buffer_head.h | 2 +- include/linux/fs.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index 5ee752d64f4a4..85dac0809fb2e 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -2429,7 +2429,7 @@ EXPORT_SYMBOL(generic_make_request); * interfaces, @bio must be presetup and ready for I/O. * */ -int submit_bio(int rw, struct bio *bio) +void submit_bio(int rw, struct bio *bio) { int count = bio_sectors(bio); @@ -2451,7 +2451,6 @@ int submit_bio(int rw, struct bio *bio) } generic_make_request(bio); - return 1; } EXPORT_SYMBOL(submit_bio); diff --git a/fs/buffer.c b/fs/buffer.c index 99f1ce112ea9f..b06f2059a4853 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -2684,7 +2684,7 @@ static int end_bio_bh_io_sync(struct bio *bio, unsigned int bytes_done, int err) return 0; } -int submit_bh(int rw, struct buffer_head * bh) +void submit_bh(int rw, struct buffer_head * bh) { struct bio *bio; @@ -2722,7 +2722,7 @@ int submit_bh(int rw, struct buffer_head * bh) bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; - return submit_bio(rw, bio); + submit_bio(rw, bio); } /** diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 110584f07883d..afe2d3ad1e4e2 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -177,7 +177,7 @@ void free_buffer_head(struct buffer_head * bh); void FASTCALL(unlock_buffer(struct buffer_head *bh)); void ll_rw_block(int, int, struct buffer_head * bh[]); void sync_dirty_buffer(struct buffer_head *bh); -int submit_bh(int, struct buffer_head *); +void submit_bh(int, struct buffer_head *); void write_boundary_block(struct block_device *bdev, sector_t bblock, unsigned blocksize); diff --git a/include/linux/fs.h b/include/linux/fs.h index c9fb9bbe154ae..1467a19015e04 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1359,7 +1359,7 @@ extern struct file * get_empty_filp(void); extern void file_move(struct file *f, struct list_head *list); extern void file_kill(struct file *f); struct bio; -extern int submit_bio(int, struct bio *); +extern void submit_bio(int, struct bio *); extern int bdev_read_only(struct block_device *); extern int set_blocksize(struct block_device *, int); extern int sb_set_blocksize(struct super_block *, int); -- 2.53.0