aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/ll_rw_blk.c11
-rw-r--r--fs/bio.c11
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index e30a3c93b70c..1471aca6fa18 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -2177,16 +2177,6 @@ int blk_rq_unmap_user(struct request *rq, struct bio *bio, unsigned int ulen)
2177 2177
2178EXPORT_SYMBOL(blk_rq_unmap_user); 2178EXPORT_SYMBOL(blk_rq_unmap_user);
2179 2179
2180static int blk_rq_map_kern_endio(struct bio *bio, unsigned int bytes_done,
2181 int error)
2182{
2183 if (bio->bi_size)
2184 return 1;
2185
2186 bio_put(bio);
2187 return 0;
2188}
2189
2190/** 2180/**
2191 * blk_rq_map_kern - map kernel data to a request, for REQ_BLOCK_PC usage 2181 * blk_rq_map_kern - map kernel data to a request, for REQ_BLOCK_PC usage
2192 * @q: request queue where request should be inserted 2182 * @q: request queue where request should be inserted
@@ -2213,7 +2203,6 @@ struct request *blk_rq_map_kern(request_queue_t *q, int rw, void *kbuf,
2213 if (!IS_ERR(bio)) { 2203 if (!IS_ERR(bio)) {
2214 if (rw) 2204 if (rw)
2215 bio->bi_rw |= (1 << BIO_RW); 2205 bio->bi_rw |= (1 << BIO_RW);
2216 bio->bi_end_io = blk_rq_map_kern_endio;
2217 2206
2218 rq->bio = rq->biotail = bio; 2207 rq->bio = rq->biotail = bio;
2219 blk_rq_bio_prep(q, rq, bio); 2208 blk_rq_bio_prep(q, rq, bio);
diff --git a/fs/bio.c b/fs/bio.c
index 707b9af2dd01..c0d9140e470c 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -701,6 +701,16 @@ void bio_unmap_user(struct bio *bio)
701 bio_put(bio); 701 bio_put(bio);
702} 702}
703 703
704static int bio_map_kern_endio(struct bio *bio, unsigned int bytes_done, int err)
705{
706 if (bio->bi_size)
707 return 1;
708
709 bio_put(bio);
710 return 0;
711}
712
713
704static struct bio *__bio_map_kern(request_queue_t *q, void *data, 714static struct bio *__bio_map_kern(request_queue_t *q, void *data,
705 unsigned int len, unsigned int gfp_mask) 715 unsigned int len, unsigned int gfp_mask)
706{ 716{
@@ -734,6 +744,7 @@ static struct bio *__bio_map_kern(request_queue_t *q, void *data,
734 offset = 0; 744 offset = 0;
735 } 745 }
736 746
747 bio->bi_end_io = bio_map_kern_endio;
737 return bio; 748 return bio;
738} 749}
739 750