Move bio_io_error directly to __process_bio, from its caller. This saves some code duplication in further patches. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) Index: linux-2.6.28-clean/drivers/md/dm.c =================================================================== --- linux-2.6.28-clean.orig/drivers/md/dm.c 2009-01-12 15:16:59.000000000 +0100 +++ linux-2.6.28-clean/drivers/md/dm.c 2009-01-12 15:17:03.000000000 +0100 @@ -778,14 +778,16 @@ static int __clone_and_map(struct clone_ /* * Split the bio into several clones and submit it to targets. */ -static int __process_bio(struct mapped_device *md, struct bio *bio) +static void __process_bio(struct mapped_device *md, struct bio *bio) { struct clone_info ci; int error = 0; ci.map = dm_get_table(md); - if (unlikely(!ci.map)) - return -EIO; + if (unlikely(!ci.map)) { + bio_io_error(bio); + return; + } ci.md = md; ci.bio = bio; @@ -805,8 +807,6 @@ static int __process_bio(struct mapped_d /* drop the extra reference count */ dec_pending(ci.io, error); dm_table_put(ci.map); - - return 0; } /*----------------------------------------------------------------- * CRUD END @@ -906,8 +906,9 @@ static int dm_request(struct request_que down_read(&md->io_lock); } - r = __process_bio(md, bio); + __process_bio(md, bio); up_read(&md->io_lock); + return 0; out_req: if (r < 0) @@ -1361,8 +1362,7 @@ static void __flush_deferred_io(struct m struct bio *c; while ((c = bio_list_pop(&md->deferred))) { - if (__process_bio(md, c)) - bio_io_error(c); + __process_bio(md, c); } clear_bit(DMF_BLOCK_IO, &md->flags);