aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-04 20:06:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-04 20:06:58 -0400
commitb4fdcb02f1e39c27058a885905bd0277370ba441 (patch)
treefd4cfd1994f21f44afe5e7904681fb5ac09f81b8 /drivers
parent044595d4e448305fbaec472eb7d22636d24e7d8c (diff)
parent6dd9ad7df2019b1e33a372a501907db293ebcd0d (diff)
Merge branch 'for-3.2/core' of git://git.kernel.dk/linux-block
* 'for-3.2/core' of git://git.kernel.dk/linux-block: (29 commits) block: don't call blk_drain_queue() if elevator is not up blk-throttle: use queue_is_locked() instead of lockdep_is_held() blk-throttle: Take blkcg->lock while traversing blkcg->policy_list blk-throttle: Free up policy node associated with deleted rule block: warn if tag is greater than real_max_depth. block: make gendisk hold a reference to its queue blk-flush: move the queue kick into blk-flush: fix invalid BUG_ON in blk_insert_flush block: Remove the control of complete cpu from bio. block: fix a typo in the blk-cgroup.h file block: initialize the bounce pool if high memory may be added later block: fix request_queue lifetime handling by making blk_queue_cleanup() properly shutdown block: drop @tsk from attempt_plug_merge() and explain sync rules block: make get_request[_wait]() fail if queue is dead block: reorganize throtl_get_tg() and blk_throtl_bio() block: reorganize queue draining block: drop unnecessary blk_get/put_queue() in scsi_cmd_ioctl() and blk_get_tg() block: pass around REQ_* flags instead of broken down booleans during request alloc/free block: move blk_throtl prototypes to block/blk.h block: fix genhd refcounting in blkio_policy_parse_and_set() ... Fix up trivial conflicts due to "mddev_t" -> "struct mddev" conversion and making the request functions be of type "void" instead of "int" in - drivers/md/{faulty.c,linear.c,md.c,md.h,multipath.c,raid0.c,raid1.c,raid10.c,raid5.c} - drivers/staging/zram/zram_drv.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/aoe/aoeblk.c14
-rw-r--r--drivers/block/brd.c4
-rw-r--r--drivers/block/drbd/drbd_int.h2
-rw-r--r--drivers/block/drbd/drbd_req.c8
-rw-r--r--drivers/block/loop.c140
-rw-r--r--drivers/block/pktcdvd.c11
-rw-r--r--drivers/block/ps3vram.c6
-rw-r--r--drivers/block/umem.c4
-rw-r--r--drivers/md/dm.c25
-rw-r--r--drivers/md/faulty.c14
-rw-r--r--drivers/md/linear.c17
-rw-r--r--drivers/md/md.c12
-rw-r--r--drivers/md/md.h2
-rw-r--r--drivers/md/multipath.c8
-rw-r--r--drivers/md/raid0.c22
-rw-r--r--drivers/md/raid1.c9
-rw-r--r--drivers/md/raid10.c19
-rw-r--r--drivers/md/raid5.c8
-rw-r--r--drivers/s390/block/dcssblk.c7
-rw-r--r--drivers/s390/block/xpram.c5
-rw-r--r--drivers/staging/zram/zram_drv.c5
21 files changed, 106 insertions, 236 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 528f6318ded1..167ba0af47f5 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -159,7 +159,7 @@ aoeblk_release(struct gendisk *disk, fmode_t mode)
159 return 0; 159 return 0;
160} 160}
161 161
162static int 162static void
163aoeblk_make_request(struct request_queue *q, struct bio *bio) 163aoeblk_make_request(struct request_queue *q, struct bio *bio)
164{ 164{
165 struct sk_buff_head queue; 165 struct sk_buff_head queue;
@@ -172,25 +172,25 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
172 if (bio == NULL) { 172 if (bio == NULL) {
173 printk(KERN_ERR "aoe: bio is NULL\n"); 173 printk(KERN_ERR "aoe: bio is NULL\n");
174 BUG(); 174 BUG();
175 return 0; 175 return;
176 } 176 }
177 d = bio->bi_bdev->bd_disk->private_data; 177 d = bio->bi_bdev->bd_disk->private_data;
178 if (d == NULL) { 178 if (d == NULL) {
179 printk(KERN_ERR "aoe: bd_disk->private_data is NULL\n"); 179 printk(KERN_ERR "aoe: bd_disk->private_data is NULL\n");
180 BUG(); 180 BUG();
181 bio_endio(bio, -ENXIO); 181 bio_endio(bio, -ENXIO);
182 return 0; 182 return;
183 } else if (bio->bi_io_vec == NULL) { 183 } else if (bio->bi_io_vec == NULL) {
184 printk(KERN_ERR "aoe: bi_io_vec is NULL\n"); 184 printk(KERN_ERR "aoe: bi_io_vec is NULL\n");
185 BUG(); 185 BUG();
186 bio_endio(bio, -ENXIO); 186 bio_endio(bio, -ENXIO);
187 return 0; 187 return;
188 } 188 }
189 buf = mempool_alloc(d->bufpool, GFP_NOIO); 189 buf = mempool_alloc(d->bufpool, GFP_NOIO);
190 if (buf == NULL) { 190 if (buf == NULL) {
191 printk(KERN_INFO "aoe: buf allocation failure\n"); 191 printk(KERN_INFO "aoe: buf allocation failure\n");
192 bio_endio(bio, -ENOMEM); 192 bio_endio(bio, -ENOMEM);
193 return 0; 193 return;
194 } 194 }
195 memset(buf, 0, sizeof(*buf)); 195 memset(buf, 0, sizeof(*buf));
196 INIT_LIST_HEAD(&buf->bufs); 196 INIT_LIST_HEAD(&buf->bufs);
@@ -211,7 +211,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
211 spin_unlock_irqrestore(&d->lock, flags); 211 spin_unlock_irqrestore(&d->lock, flags);
212 mempool_free(buf, d->bufpool); 212 mempool_free(buf, d->bufpool);
213 bio_endio(bio, -ENXIO); 213 bio_endio(bio, -ENXIO);
214 return 0; 214 return;
215 } 215 }
216 216
217 list_add_tail(&buf->bufs, &d->bufq); 217 list_add_tail(&buf->bufs, &d->bufq);
@@ -222,8 +222,6 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
222 222
223 spin_unlock_irqrestore(&d->lock, flags); 223 spin_unlock_irqrestore(&d->lock, flags);
224 aoenet_xmit(&queue); 224 aoenet_xmit(&queue);
225
226 return 0;
227} 225}
228 226
229static int 227static int
diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index dba1c32e1ddf..d22119d49e53 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -323,7 +323,7 @@ out:
323 return err; 323 return err;
324} 324}
325 325
326static int brd_make_request(struct request_queue *q, struct bio *bio) 326static void brd_make_request(struct request_queue *q, struct bio *bio)
327{ 327{
328 struct block_device *bdev = bio->bi_bdev; 328 struct block_device *bdev = bio->bi_bdev;
329 struct brd_device *brd = bdev->bd_disk->private_data; 329 struct brd_device *brd = bdev->bd_disk->private_data;
@@ -359,8 +359,6 @@ static int brd_make_request(struct request_queue *q, struct bio *bio)
359 359
360out: 360out:
361 bio_endio(bio, err); 361 bio_endio(bio, err);
362
363 return 0;
364} 362}
365 363
366#ifdef CONFIG_BLK_DEV_XIP 364#ifdef CONFIG_BLK_DEV_XIP
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 1706d60b8c99..9cf20355ceec 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1506,7 +1506,7 @@ extern void drbd_free_mdev(struct drbd_conf *mdev);
1506extern int proc_details; 1506extern int proc_details;
1507 1507
1508/* drbd_req */ 1508/* drbd_req */
1509extern int drbd_make_request(struct request_queue *q, struct bio *bio); 1509extern void drbd_make_request(struct request_queue *q, struct bio *bio);
1510extern int drbd_read_remote(struct drbd_conf *mdev, struct drbd_request *req); 1510extern int drbd_read_remote(struct drbd_conf *mdev, struct drbd_request *req);
1511extern int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec); 1511extern int drbd_merge_bvec(struct request_queue *q, struct bvec_merge_data *bvm, struct bio_vec *bvec);
1512extern int is_valid_ar_handle(struct drbd_request *, sector_t); 1512extern int is_valid_ar_handle(struct drbd_request *, sector_t);
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 3424d675b769..4a0f314086e5 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -1073,7 +1073,7 @@ static int drbd_fail_request_early(struct drbd_conf *mdev, int is_write)
1073 return 0; 1073 return 0;
1074} 1074}
1075 1075
1076int drbd_make_request(struct request_queue *q, struct bio *bio) 1076void drbd_make_request(struct request_queue *q, struct bio *bio)
1077{ 1077{
1078 unsigned int s_enr, e_enr; 1078 unsigned int s_enr, e_enr;
1079 struct drbd_conf *mdev = (struct drbd_conf *) q->queuedata; 1079 struct drbd_conf *mdev = (struct drbd_conf *) q->queuedata;
@@ -1081,7 +1081,7 @@ int drbd_make_request(struct request_queue *q, struct bio *bio)
1081 1081
1082 if (drbd_fail_request_early(mdev, bio_data_dir(bio) & WRITE)) { 1082 if (drbd_fail_request_early(mdev, bio_data_dir(bio) & WRITE)) {
1083 bio_endio(bio, -EPERM); 1083 bio_endio(bio, -EPERM);
1084 return 0; 1084 return;
1085 } 1085 }
1086 1086
1087 start_time = jiffies; 1087 start_time = jiffies;
@@ -1100,7 +1100,8 @@ int drbd_make_request(struct request_queue *q, struct bio *bio)
1100 1100
1101 if (likely(s_enr == e_enr)) { 1101 if (likely(s_enr == e_enr)) {
1102 inc_ap_bio(mdev, 1); 1102 inc_ap_bio(mdev, 1);
1103 return drbd_make_request_common(mdev, bio, start_time); 1103 drbd_make_request_common(mdev, bio, start_time);
1104 return;
1104 } 1105 }
1105 1106
1106 /* can this bio be split generically? 1107 /* can this bio be split generically?
@@ -1148,7 +1149,6 @@ int drbd_make_request(struct request_queue *q, struct bio *bio)
1148 1149
1149 bio_pair_release(bp); 1150 bio_pair_release(bp);
1150 } 1151 }
1151 return 0;
1152} 1152}
1153 1153
1154/* This is called by bio_add_page(). With this function we reduce 1154/* This is called by bio_add_page(). With this function we reduce
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 4720c7ade0ae..c77983ea86c8 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -203,74 +203,6 @@ lo_do_transfer(struct loop_device *lo, int cmd,
203} 203}
204 204
205/** 205/**
206 * do_lo_send_aops - helper for writing data to a loop device
207 *
208 * This is the fast version for backing filesystems which implement the address
209 * space operations write_begin and write_end.
210 */
211static int do_lo_send_aops(struct loop_device *lo, struct bio_vec *bvec,
212 loff_t pos, struct page *unused)
213{
214 struct file *file = lo->lo_backing_file; /* kudos to NFsckingS */
215 struct address_space *mapping = file->f_mapping;
216 pgoff_t index;
217 unsigned offset, bv_offs;
218 int len, ret;
219
220 mutex_lock(&mapping->host->i_mutex);
221 index = pos >> PAGE_CACHE_SHIFT;
222 offset = pos & ((pgoff_t)PAGE_CACHE_SIZE - 1);
223 bv_offs = bvec->bv_offset;
224 len = bvec->bv_len;
225 while (len > 0) {
226 sector_t IV;
227 unsigned size, copied;
228 int transfer_result;
229 struct page *page;
230 void *fsdata;
231
232 IV = ((sector_t)index << (PAGE_CACHE_SHIFT - 9))+(offset >> 9);
233 size = PAGE_CACHE_SIZE - offset;
234 if (size > len)
235 size = len;
236
237 ret = pagecache_write_begin(file, mapping, pos, size, 0,
238 &page, &fsdata);
239 if (ret)
240 goto fail;
241
242 file_update_time(file);
243
244 transfer_result = lo_do_transfer(lo, WRITE, page, offset,
245 bvec->bv_page, bv_offs, size, IV);
246 copied = size;
247 if (unlikely(transfer_result))
248 copied = 0;
249
250 ret = pagecache_write_end(file, mapping, pos, size, copied,
251 page, fsdata);
252 if (ret < 0 || ret != copied)
253 goto fail;
254
255 if (unlikely(transfer_result))
256 goto fail;
257
258 bv_offs += copied;
259 len -= copied;
260 offset = 0;
261 index++;
262 pos += copied;
263 }
264 ret = 0;
265out:
266 mutex_unlock(&mapping->host->i_mutex);
267 return ret;
268fail:
269 ret = -1;
270 goto out;
271}
272
273/**
274 * __do_lo_send_write - helper for writing data to a loop device 206 * __do_lo_send_write - helper for writing data to a loop device
275 * 207 *
276 * This helper just factors out common code between do_lo_send_direct_write() 208 * This helper just factors out common code between do_lo_send_direct_write()
@@ -297,10 +229,8 @@ static int __do_lo_send_write(struct file *file,
297/** 229/**
298 * do_lo_send_direct_write - helper for writing data to a loop device 230 * do_lo_send_direct_write - helper for writing data to a loop device
299 * 231 *
300 * This is the fast, non-transforming version for backing filesystems which do 232 * This is the fast, non-transforming version that does not need double
301 * not implement the address space operations write_begin and write_end. 233 * buffering.
302 * It uses the write file operation which should be present on all writeable
303 * filesystems.
304 */ 234 */
305static int do_lo_send_direct_write(struct loop_device *lo, 235static int do_lo_send_direct_write(struct loop_device *lo,
306 struct bio_vec *bvec, loff_t pos, struct page *page) 236 struct bio_vec *bvec, loff_t pos, struct page *page)
@@ -316,15 +246,9 @@ static int do_lo_send_direct_write(struct loop_device *lo,
316/** 246/**
317 * do_lo_send_write - helper for writing data to a loop device 247 * do_lo_send_write - helper for writing data to a loop device
318 * 248 *
319 * This is the slow, transforming version for filesystems which do not 249 * This is the slow, transforming version that needs to double buffer the
320 * implement the address space operations write_begin and write_end. It 250 * data as it cannot do the transformations in place without having direct
321 * uses the write file operation which should be present on all writeable 251 * access to the destination pages of the backing file.
322 * filesystems.
323 *
324 * Using fops->write is slower than using aops->{prepare,commit}_write in the
325 * transforming case because we need to double buffer the data as we cannot do
326 * the transformations in place as we do not have direct access to the
327 * destination pages of the backing file.
328 */ 252 */
329static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec, 253static int do_lo_send_write(struct loop_device *lo, struct bio_vec *bvec,
330 loff_t pos, struct page *page) 254 loff_t pos, struct page *page)
@@ -350,17 +274,16 @@ static int lo_send(struct loop_device *lo, struct bio *bio, loff_t pos)
350 struct page *page = NULL; 274 struct page *page = NULL;
351 int i, ret = 0; 275 int i, ret = 0;
352 276
353 do_lo_send = do_lo_send_aops; 277 if (lo->transfer != transfer_none) {
354 if (!(lo->lo_flags & LO_FLAGS_USE_AOPS)) { 278 page = alloc_page(GFP_NOIO | __GFP_HIGHMEM);
279 if (unlikely(!page))
280 goto fail;
281 kmap(page);
282 do_lo_send = do_lo_send_write;
283 } else {
355 do_lo_send = do_lo_send_direct_write; 284 do_lo_send = do_lo_send_direct_write;
356 if (lo->transfer != transfer_none) {
357 page = alloc_page(GFP_NOIO | __GFP_HIGHMEM);
358 if (unlikely(!page))
359 goto fail;
360 kmap(page);
361 do_lo_send = do_lo_send_write;
362 }
363 } 285 }
286
364 bio_for_each_segment(bvec, bio, i) { 287 bio_for_each_segment(bvec, bio, i) {
365 ret = do_lo_send(lo, bvec, pos, page); 288 ret = do_lo_send(lo, bvec, pos, page);
366 if (ret < 0) 289 if (ret < 0)
@@ -514,7 +437,7 @@ static struct bio *loop_get_bio(struct loop_device *lo)
514 return bio_list_pop(&lo->lo_bio_list); 437 return bio_list_pop(&lo->lo_bio_list);
515} 438}
516 439
517static int loop_make_request(struct request_queue *q, struct bio *old_bio) 440static void loop_make_request(struct request_queue *q, struct bio *old_bio)
518{ 441{
519 struct loop_device *lo = q->queuedata; 442 struct loop_device *lo = q->queuedata;
520 int rw = bio_rw(old_bio); 443 int rw = bio_rw(old_bio);
@@ -532,12 +455,11 @@ static int loop_make_request(struct request_queue *q, struct bio *old_bio)
532 loop_add_bio(lo, old_bio); 455 loop_add_bio(lo, old_bio);
533 wake_up(&lo->lo_event); 456 wake_up(&lo->lo_event);
534 spin_unlock_irq(&lo->lo_lock); 457 spin_unlock_irq(&lo->lo_lock);
535 return 0; 458 return;
536 459
537out: 460out:
538 spin_unlock_irq(&lo->lo_lock); 461 spin_unlock_irq(&lo->lo_lock);
539 bio_io_error(old_bio); 462 bio_io_error(old_bio);
540 return 0;
541} 463}
542 464
543struct switch_request { 465struct switch_request {
@@ -849,35 +771,23 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
849 mapping = file->f_mapping; 771 mapping = file->f_mapping;
850 inode = mapping->host; 772 inode = mapping->host;
851 773
852 if (!(file->f_mode & FMODE_WRITE))
853 lo_flags |= LO_FLAGS_READ_ONLY;
854
855 error = -EINVAL; 774 error = -EINVAL;
856 if (S_ISREG(inode->i_mode) || S_ISBLK(inode->i_mode)) { 775 if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode))
857 const struct address_space_operations *aops = mapping->a_ops; 776 goto out_putf;
858
859 if (aops->write_begin)
860 lo_flags |= LO_FLAGS_USE_AOPS;
861 if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write)
862 lo_flags |= LO_FLAGS_READ_ONLY;
863 777
864 lo_blocksize = S_ISBLK(inode->i_mode) ? 778 if (!(file->f_mode & FMODE_WRITE) || !(mode & FMODE_WRITE) ||
865 inode->i_bdev->bd_block_size : PAGE_SIZE; 779 !file->f_op->write)
780 lo_flags |= LO_FLAGS_READ_ONLY;
866 781
867 error = 0; 782 lo_blocksize = S_ISBLK(inode->i_mode) ?
868 } else { 783 inode->i_bdev->bd_block_size : PAGE_SIZE;
869 goto out_putf;
870 }
871 784
785 error = -EFBIG;
872 size = get_loop_size(lo, file); 786 size = get_loop_size(lo, file);
873 787 if ((loff_t)(sector_t)size != size)
874 if ((loff_t)(sector_t)size != size) {
875 error = -EFBIG;
876 goto out_putf; 788 goto out_putf;
877 }
878 789
879 if (!(mode & FMODE_WRITE)) 790 error = 0;
880 lo_flags |= LO_FLAGS_READ_ONLY;
881 791
882 set_device_ro(bdev, (lo_flags & LO_FLAGS_READ_ONLY) != 0); 792 set_device_ro(bdev, (lo_flags & LO_FLAGS_READ_ONLY) != 0);
883 793
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index e133f094ab08..a63b0a2b7805 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2444,7 +2444,7 @@ static void pkt_end_io_read_cloned(struct bio *bio, int err)
2444 pkt_bio_finished(pd); 2444 pkt_bio_finished(pd);
2445} 2445}
2446 2446
2447static int pkt_make_request(struct request_queue *q, struct bio *bio) 2447static void pkt_make_request(struct request_queue *q, struct bio *bio)
2448{ 2448{
2449 struct pktcdvd_device *pd; 2449 struct pktcdvd_device *pd;
2450 char b[BDEVNAME_SIZE]; 2450 char b[BDEVNAME_SIZE];
@@ -2473,7 +2473,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
2473 cloned_bio->bi_end_io = pkt_end_io_read_cloned; 2473 cloned_bio->bi_end_io = pkt_end_io_read_cloned;
2474 pd->stats.secs_r += bio->bi_size >> 9; 2474 pd->stats.secs_r += bio->bi_size >> 9;
2475 pkt_queue_bio(pd, cloned_bio); 2475 pkt_queue_bio(pd, cloned_bio);
2476 return 0; 2476 return;
2477 } 2477 }
2478 2478
2479 if (!test_bit(PACKET_WRITABLE, &pd->flags)) { 2479 if (!test_bit(PACKET_WRITABLE, &pd->flags)) {
@@ -2509,7 +2509,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
2509 pkt_make_request(q, &bp->bio1); 2509 pkt_make_request(q, &bp->bio1);
2510 pkt_make_request(q, &bp->bio2); 2510 pkt_make_request(q, &bp->bio2);
2511 bio_pair_release(bp); 2511 bio_pair_release(bp);
2512 return 0; 2512 return;
2513 } 2513 }
2514 } 2514 }
2515 2515
@@ -2533,7 +2533,7 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
2533 } 2533 }
2534 spin_unlock(&pkt->lock); 2534 spin_unlock(&pkt->lock);
2535 spin_unlock(&pd->cdrw.active_list_lock); 2535 spin_unlock(&pd->cdrw.active_list_lock);
2536 return 0; 2536 return;
2537 } else { 2537 } else {
2538 blocked_bio = 1; 2538 blocked_bio = 1;
2539 } 2539 }
@@ -2584,10 +2584,9 @@ static int pkt_make_request(struct request_queue *q, struct bio *bio)
2584 */ 2584 */
2585 wake_up(&pd->wqueue); 2585 wake_up(&pd->wqueue);
2586 } 2586 }
2587 return 0; 2587 return;
2588end_io: 2588end_io:
2589 bio_io_error(bio); 2589 bio_io_error(bio);
2590 return 0;
2591} 2590}
2592 2591
2593 2592
diff --git a/drivers/block/ps3vram.c b/drivers/block/ps3vram.c
index b3bdb8af89cf..7fad7af87eb2 100644
--- a/drivers/block/ps3vram.c
+++ b/drivers/block/ps3vram.c
@@ -596,7 +596,7 @@ out:
596 return next; 596 return next;
597} 597}
598 598
599static int ps3vram_make_request(struct request_queue *q, struct bio *bio) 599static void ps3vram_make_request(struct request_queue *q, struct bio *bio)
600{ 600{
601 struct ps3_system_bus_device *dev = q->queuedata; 601 struct ps3_system_bus_device *dev = q->queuedata;
602 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev); 602 struct ps3vram_priv *priv = ps3_system_bus_get_drvdata(dev);
@@ -610,13 +610,11 @@ static int ps3vram_make_request(struct request_queue *q, struct bio *bio)
610 spin_unlock_irq(&priv->lock); 610 spin_unlock_irq(&priv->lock);
611 611
612 if (busy) 612 if (busy)
613 return 0; 613 return;
614 614
615 do { 615 do {
616 bio = ps3vram_do_bio(dev, bio); 616 bio = ps3vram_do_bio(dev, bio);
617 } while (bio); 617 } while (bio);
618
619 return 0;
620} 618}
621 619
622static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev) 620static int __devinit ps3vram_probe(struct ps3_system_bus_device *dev)
diff --git a/drivers/block/umem.c b/drivers/block/umem.c
index 031ca720d926..aa2712060bfb 100644
--- a/drivers/block/umem.c
+++ b/drivers/block/umem.c
@@ -513,7 +513,7 @@ static void process_page(unsigned long data)
513 } 513 }
514} 514}
515 515
516static int mm_make_request(struct request_queue *q, struct bio *bio) 516static void mm_make_request(struct request_queue *q, struct bio *bio)
517{ 517{
518 struct cardinfo *card = q->queuedata; 518 struct cardinfo *card = q->queuedata;
519 pr_debug("mm_make_request %llu %u\n", 519 pr_debug("mm_make_request %llu %u\n",
@@ -525,7 +525,7 @@ static int mm_make_request(struct request_queue *q, struct bio *bio)
525 card->biotail = &bio->bi_next; 525 card->biotail = &bio->bi_next;
526 spin_unlock_irq(&card->lock); 526 spin_unlock_irq(&card->lock);
527 527
528 return 0; 528 return;
529} 529}
530 530
531static irqreturn_t mm_interrupt(int irq, void *__card) 531static irqreturn_t mm_interrupt(int irq, void *__card)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 6b6616a41baa..4720f68f817e 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -192,9 +192,6 @@ struct mapped_device {
192 /* forced geometry settings */ 192 /* forced geometry settings */
193 struct hd_geometry geometry; 193 struct hd_geometry geometry;
194 194
195 /* For saving the address of __make_request for request based dm */
196 make_request_fn *saved_make_request_fn;
197
198 /* sysfs handle */ 195 /* sysfs handle */
199 struct kobject kobj; 196 struct kobject kobj;
200 197
@@ -1403,7 +1400,7 @@ out:
1403 * The request function that just remaps the bio built up by 1400 * The request function that just remaps the bio built up by
1404 * dm_merge_bvec. 1401 * dm_merge_bvec.
1405 */ 1402 */
1406static int _dm_request(struct request_queue *q, struct bio *bio) 1403static void _dm_request(struct request_queue *q, struct bio *bio)
1407{ 1404{
1408 int rw = bio_data_dir(bio); 1405 int rw = bio_data_dir(bio);
1409 struct mapped_device *md = q->queuedata; 1406 struct mapped_device *md = q->queuedata;
@@ -1424,19 +1421,12 @@ static int _dm_request(struct request_queue *q, struct bio *bio)
1424 queue_io(md, bio); 1421 queue_io(md, bio);
1425 else 1422 else
1426 bio_io_error(bio); 1423 bio_io_error(bio);
1427 return 0; 1424 return;
1428 } 1425 }
1429 1426
1430 __split_and_process_bio(md, bio); 1427 __split_and_process_bio(md, bio);
1431 up_read(&md->io_lock); 1428 up_read(&md->io_lock);
1432 return 0; 1429 return;
1433}
1434
1435static int dm_make_request(struct request_queue *q, struct bio *bio)
1436{
1437 struct mapped_device *md = q->queuedata;
1438
1439 return md->saved_make_request_fn(q, bio); /* call __make_request() */
1440} 1430}
1441 1431
1442static int dm_request_based(struct mapped_device *md) 1432static int dm_request_based(struct mapped_device *md)
@@ -1444,14 +1434,14 @@ static int dm_request_based(struct mapped_device *md)
1444 return blk_queue_stackable(md->queue); 1434 return blk_queue_stackable(md->queue);
1445} 1435}
1446 1436
1447static int dm_request(struct request_queue *q, struct bio *bio) 1437static void dm_request(struct request_queue *q, struct bio *bio)
1448{ 1438{
1449 struct mapped_device *md = q->queuedata; 1439 struct mapped_device *md = q->queuedata;
1450 1440
1451 if (dm_request_based(md)) 1441 if (dm_request_based(md))
1452 return dm_make_request(q, bio); 1442 blk_queue_bio(q, bio);
1453 1443 else
1454 return _dm_request(q, bio); 1444 _dm_request(q, bio);
1455} 1445}
1456 1446
1457void dm_dispatch_request(struct request *rq) 1447void dm_dispatch_request(struct request *rq)
@@ -2191,7 +2181,6 @@ static int dm_init_request_based_queue(struct mapped_device *md)
2191 return 0; 2181 return 0;
2192 2182
2193 md->queue = q; 2183 md->queue = q;
2194 md->saved_make_request_fn = md->queue->make_request_fn;
2195 dm_init_md_queue(md); 2184 dm_init_md_queue(md);
2196 blk_queue_softirq_done(md->queue, dm_softirq_done); 2185 blk_queue_softirq_done(md->queue, dm_softirq_done);
2197 blk_queue_prep_rq(md->queue, dm_prep_fn); 2186 blk_queue_prep_rq(md->queue, dm_prep_fn);
diff --git a/drivers/md/faulty.c b/drivers/md/faulty.c
index 60816b132c2e..918fb8ac6607 100644
--- a/drivers/md/faulty.c
+++ b/drivers/md/faulty.c
@@ -169,7 +169,7 @@ static void add_sector(struct faulty_conf *conf, sector_t start, int mode)
169 conf->nfaults = n+1; 169 conf->nfaults = n+1;
170} 170}
171 171
172static int make_request(struct mddev *mddev, struct bio *bio) 172static void make_request(struct mddev *mddev, struct bio *bio)
173{ 173{
174 struct faulty_conf *conf = mddev->private; 174 struct faulty_conf *conf = mddev->private;
175 int failit = 0; 175 int failit = 0;
@@ -181,7 +181,7 @@ static int make_request(struct mddev *mddev, struct bio *bio)
181 * just fail immediately 181 * just fail immediately
182 */ 182 */
183 bio_endio(bio, -EIO); 183 bio_endio(bio, -EIO);
184 return 0; 184 return;
185 } 185 }
186 186
187 if (check_sector(conf, bio->bi_sector, bio->bi_sector+(bio->bi_size>>9), 187 if (check_sector(conf, bio->bi_sector, bio->bi_sector+(bio->bi_size>>9),
@@ -211,15 +211,15 @@ static int make_request(struct mddev *mddev, struct bio *bio)
211 } 211 }
212 if (failit) { 212 if (failit) {
213 struct bio *b = bio_clone_mddev(bio, GFP_NOIO, mddev); 213 struct bio *b = bio_clone_mddev(bio, GFP_NOIO, mddev);
214
214 b->bi_bdev = conf->rdev->bdev; 215 b->bi_bdev = conf->rdev->bdev;
215 b->bi_private = bio; 216 b->bi_private = bio;
216 b->bi_end_io = faulty_fail; 217 b->bi_end_io = faulty_fail;
217 generic_make_request(b); 218 bio = b;
218 return 0; 219 } else
219 } else {
220 bio->bi_bdev = conf->rdev->bdev; 220 bio->bi_bdev = conf->rdev->bdev;
221 return 1; 221
222 } 222 generic_make_request(bio);
223} 223}
224 224
225static void status(struct seq_file *seq, struct mddev *mddev) 225static void status(struct seq_file *seq, struct mddev *mddev)
diff --git a/drivers/md/linear.c b/drivers/md/linear.c
index 10c5844460cb..a82035867519 100644
--- a/drivers/md/linear.c
+++ b/drivers/md/linear.c
@@ -264,14 +264,14 @@ static int linear_stop (struct mddev *mddev)
264 return 0; 264 return 0;
265} 265}
266 266
267static int linear_make_request (struct mddev *mddev, struct bio *bio) 267static void linear_make_request(struct mddev *mddev, struct bio *bio)
268{ 268{
269 struct dev_info *tmp_dev; 269 struct dev_info *tmp_dev;
270 sector_t start_sector; 270 sector_t start_sector;
271 271
272 if (unlikely(bio->bi_rw & REQ_FLUSH)) { 272 if (unlikely(bio->bi_rw & REQ_FLUSH)) {
273 md_flush_request(mddev, bio); 273 md_flush_request(mddev, bio);
274 return 0; 274 return;
275 } 275 }
276 276
277 rcu_read_lock(); 277 rcu_read_lock();
@@ -293,7 +293,7 @@ static int linear_make_request (struct mddev *mddev, struct bio *bio)
293 (unsigned long long)start_sector); 293 (unsigned long long)start_sector);
294 rcu_read_unlock(); 294 rcu_read_unlock();
295 bio_io_error(bio); 295 bio_io_error(bio);
296 return 0; 296 return;
297 } 297 }
298 if (unlikely(bio->bi_sector + (bio->bi_size >> 9) > 298 if (unlikely(bio->bi_sector + (bio->bi_size >> 9) >
299 tmp_dev->end_sector)) { 299 tmp_dev->end_sector)) {
@@ -307,20 +307,17 @@ static int linear_make_request (struct mddev *mddev, struct bio *bio)
307 307
308 bp = bio_split(bio, end_sector - bio->bi_sector); 308 bp = bio_split(bio, end_sector - bio->bi_sector);
309 309
310 if (linear_make_request(mddev, &bp->bio1)) 310 linear_make_request(mddev, &bp->bio1);
311 generic_make_request(&bp->bio1); 311 linear_make_request(mddev, &bp->bio2);
312 if (linear_make_request(mddev, &bp->bio2))
313 generic_make_request(&bp->bio2);
314 bio_pair_release(bp); 312 bio_pair_release(bp);
315 return 0; 313 return;
316 } 314 }
317 315
318 bio->bi_bdev = tmp_dev->rdev->bdev; 316 bio->bi_bdev = tmp_dev->rdev->bdev;
319 bio->bi_sector = bio->bi_sector - start_sector 317 bio->bi_sector = bio->bi_sector - start_sector
320 + tmp_dev->rdev->data_offset; 318 + tmp_dev->rdev->data_offset;
321 rcu_read_unlock(); 319 rcu_read_unlock();
322 320 generic_make_request(bio);
323 return 1;
324} 321}
325 322
326static void linear_status (struct seq_file *seq, struct mddev *mddev) 323static void linear_status (struct seq_file *seq, struct mddev *mddev)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 266e82ebaf11..2acb32827fde 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -332,18 +332,17 @@ static DEFINE_SPINLOCK(all_mddevs_lock);
332 * call has finished, the bio has been linked into some internal structure 332 * call has finished, the bio has been linked into some internal structure
333 * and so is visible to ->quiesce(), so we don't need the refcount any more. 333 * and so is visible to ->quiesce(), so we don't need the refcount any more.
334 */ 334 */
335static int md_make_request(struct request_queue *q, struct bio *bio) 335static void md_make_request(struct request_queue *q, struct bio *bio)
336{ 336{
337 const int rw = bio_data_dir(bio); 337 const int rw = bio_data_dir(bio);
338 struct mddev *mddev = q->queuedata; 338 struct mddev *mddev = q->queuedata;
339 int rv;
340 int cpu; 339 int cpu;
341 unsigned int sectors; 340 unsigned int sectors;
342 341
343 if (mddev == NULL || mddev->pers == NULL 342 if (mddev == NULL || mddev->pers == NULL
344 || !mddev->ready) { 343 || !mddev->ready) {
345 bio_io_error(bio); 344 bio_io_error(bio);
346 return 0; 345 return;
347 } 346 }
348 smp_rmb(); /* Ensure implications of 'active' are visible */ 347 smp_rmb(); /* Ensure implications of 'active' are visible */
349 rcu_read_lock(); 348 rcu_read_lock();
@@ -368,7 +367,7 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
368 * go away inside make_request 367 * go away inside make_request
369 */ 368 */
370 sectors = bio_sectors(bio); 369 sectors = bio_sectors(bio);
371 rv = mddev->pers->make_request(mddev, bio); 370 mddev->pers->make_request(mddev, bio);
372 371
373 cpu = part_stat_lock(); 372 cpu = part_stat_lock();
374 part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]); 373 part_stat_inc(cpu, &mddev->gendisk->part0, ios[rw]);
@@ -377,8 +376,6 @@ static int md_make_request(struct request_queue *q, struct bio *bio)
377 376
378 if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended) 377 if (atomic_dec_and_test(&mddev->active_io) && mddev->suspended)
379 wake_up(&mddev->sb_wait); 378 wake_up(&mddev->sb_wait);
380
381 return rv;
382} 379}
383 380
384/* mddev_suspend makes sure no new requests are submitted 381/* mddev_suspend makes sure no new requests are submitted
@@ -477,8 +474,7 @@ static void md_submit_flush_data(struct work_struct *ws)
477 bio_endio(bio, 0); 474 bio_endio(bio, 0);
478 else { 475 else {
479 bio->bi_rw &= ~REQ_FLUSH; 476 bio->bi_rw &= ~REQ_FLUSH;
480 if (mddev->pers->make_request(mddev, bio)) 477 mddev->pers->make_request(mddev, bio);
481 generic_make_request(bio);
482 } 478 }
483 479
484 mddev->flush_bio = NULL; 480 mddev->flush_bio = NULL;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 51c1d91557e0..cf742d9306ec 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -419,7 +419,7 @@ struct md_personality
419 int level; 419 int level;
420 struct list_head list; 420 struct list_head list;
421 struct module *owner; 421 struct module *owner;
422 int (*make_request)(struct mddev *mddev, struct bio *bio); 422 void (*make_request)(struct mddev *mddev, struct bio *bio);
423 int (*run)(struct mddev *mddev); 423 int (*run)(struct mddev *mddev);
424 int (*stop)(struct mddev *mddev); 424 int (*stop)(struct mddev *mddev);
425 void (*status)(struct seq_file *seq, struct mddev *mddev); 425 void (*status)(struct seq_file *seq, struct mddev *mddev);
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index d32c785e17d4..ad20a28fbf2a 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -106,7 +106,7 @@ static void multipath_end_request(struct bio *bio, int error)
106 rdev_dec_pending(rdev, conf->mddev); 106 rdev_dec_pending(rdev, conf->mddev);
107} 107}
108 108
109static int multipath_make_request(struct mddev *mddev, struct bio * bio) 109static void multipath_make_request(struct mddev *mddev, struct bio * bio)
110{ 110{
111 struct mpconf *conf = mddev->private; 111 struct mpconf *conf = mddev->private;
112 struct multipath_bh * mp_bh; 112 struct multipath_bh * mp_bh;
@@ -114,7 +114,7 @@ static int multipath_make_request(struct mddev *mddev, struct bio * bio)
114 114
115 if (unlikely(bio->bi_rw & REQ_FLUSH)) { 115 if (unlikely(bio->bi_rw & REQ_FLUSH)) {
116 md_flush_request(mddev, bio); 116 md_flush_request(mddev, bio);
117 return 0; 117 return;
118 } 118 }
119 119
120 mp_bh = mempool_alloc(conf->pool, GFP_NOIO); 120 mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
@@ -126,7 +126,7 @@ static int multipath_make_request(struct mddev *mddev, struct bio * bio)
126 if (mp_bh->path < 0) { 126 if (mp_bh->path < 0) {
127 bio_endio(bio, -EIO); 127 bio_endio(bio, -EIO);
128 mempool_free(mp_bh, conf->pool); 128 mempool_free(mp_bh, conf->pool);
129 return 0; 129 return;
130 } 130 }
131 multipath = conf->multipaths + mp_bh->path; 131 multipath = conf->multipaths + mp_bh->path;
132 132
@@ -137,7 +137,7 @@ static int multipath_make_request(struct mddev *mddev, struct bio * bio)
137 mp_bh->bio.bi_end_io = multipath_end_request; 137 mp_bh->bio.bi_end_io = multipath_end_request;
138 mp_bh->bio.bi_private = mp_bh; 138 mp_bh->bio.bi_private = mp_bh;
139 generic_make_request(&mp_bh->bio); 139 generic_make_request(&mp_bh->bio);
140 return 0; 140 return;
141} 141}
142 142
143static void multipath_status (struct seq_file *seq, struct mddev *mddev) 143static void multipath_status (struct seq_file *seq, struct mddev *mddev)
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 0eb08a4df759..27e19e2b51d4 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -468,7 +468,7 @@ static inline int is_io_in_chunk_boundary(struct mddev *mddev,
468 } 468 }
469} 469}
470 470
471static int raid0_make_request(struct mddev *mddev, struct bio *bio) 471static void raid0_make_request(struct mddev *mddev, struct bio *bio)
472{ 472{
473 unsigned int chunk_sects; 473 unsigned int chunk_sects;
474 sector_t sector_offset; 474 sector_t sector_offset;
@@ -477,7 +477,7 @@ static int raid0_make_request(struct mddev *mddev, struct bio *bio)
477 477
478 if (unlikely(bio->bi_rw & REQ_FLUSH)) { 478 if (unlikely(bio->bi_rw & REQ_FLUSH)) {
479 md_flush_request(mddev, bio); 479 md_flush_request(mddev, bio);
480 return 0; 480 return;
481 } 481 }
482 482
483 chunk_sects = mddev->chunk_sectors; 483 chunk_sects = mddev->chunk_sectors;
@@ -497,13 +497,10 @@ static int raid0_make_request(struct mddev *mddev, struct bio *bio)
497 else 497 else
498 bp = bio_split(bio, chunk_sects - 498 bp = bio_split(bio, chunk_sects -
499 sector_div(sector, chunk_sects)); 499 sector_div(sector, chunk_sects));
500 if (raid0_make_request(mddev, &bp->bio1)) 500 raid0_make_request(mddev, &bp->bio1);
501 generic_make_request(&bp->bio1); 501 raid0_make_request(mddev, &bp->bio2);
502 if (raid0_make_request(mddev, &bp->bio2))
503 generic_make_request(&bp->bio2);
504
505 bio_pair_release(bp); 502 bio_pair_release(bp);
506 return 0; 503 return;
507 } 504 }
508 505
509 sector_offset = bio->bi_sector; 506 sector_offset = bio->bi_sector;
@@ -513,10 +510,9 @@ static int raid0_make_request(struct mddev *mddev, struct bio *bio)
513 bio->bi_bdev = tmp_dev->bdev; 510 bio->bi_bdev = tmp_dev->bdev;
514 bio->bi_sector = sector_offset + zone->dev_start + 511 bio->bi_sector = sector_offset + zone->dev_start +
515 tmp_dev->data_offset; 512 tmp_dev->data_offset;
516 /* 513
517 * Let the main block layer submit the IO and resolve recursion: 514 generic_make_request(bio);
518 */ 515 return;
519 return 1;
520 516
521bad_map: 517bad_map:
522 printk("md/raid0:%s: make_request bug: can't convert block across chunks" 518 printk("md/raid0:%s: make_request bug: can't convert block across chunks"
@@ -525,7 +521,7 @@ bad_map:
525 (unsigned long long)bio->bi_sector, bio->bi_size >> 10); 521 (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
526 522
527 bio_io_error(bio); 523 bio_io_error(bio);
528 return 0; 524 return;
529} 525}
530 526
531static void raid0_status(struct seq_file *seq, struct mddev *mddev) 527static void raid0_status(struct seq_file *seq, struct mddev *mddev)
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 4602fc57c961..cae874646d9e 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -807,7 +807,7 @@ do_sync_io:
807 pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size); 807 pr_debug("%dB behind alloc failed, doing sync I/O\n", bio->bi_size);
808} 808}
809 809
810static int make_request(struct mddev *mddev, struct bio * bio) 810static void make_request(struct mddev *mddev, struct bio * bio)
811{ 811{
812 struct r1conf *conf = mddev->private; 812 struct r1conf *conf = mddev->private;
813 struct mirror_info *mirror; 813 struct mirror_info *mirror;
@@ -892,7 +892,7 @@ read_again:
892 if (rdisk < 0) { 892 if (rdisk < 0) {
893 /* couldn't find anywhere to read from */ 893 /* couldn't find anywhere to read from */
894 raid_end_bio_io(r1_bio); 894 raid_end_bio_io(r1_bio);
895 return 0; 895 return;
896 } 896 }
897 mirror = conf->mirrors + rdisk; 897 mirror = conf->mirrors + rdisk;
898 898
@@ -950,7 +950,7 @@ read_again:
950 goto read_again; 950 goto read_again;
951 } else 951 } else
952 generic_make_request(read_bio); 952 generic_make_request(read_bio);
953 return 0; 953 return;
954 } 954 }
955 955
956 /* 956 /*
@@ -1151,8 +1151,6 @@ read_again:
1151 1151
1152 if (do_sync || !bitmap || !plugged) 1152 if (do_sync || !bitmap || !plugged)
1153 md_wakeup_thread(mddev->thread); 1153 md_wakeup_thread(mddev->thread);
1154
1155 return 0;
1156} 1154}
1157 1155
1158static void status(struct seq_file *seq, struct mddev *mddev) 1156static void status(struct seq_file *seq, struct mddev *mddev)
@@ -2193,7 +2191,6 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
2193 bio->bi_next = NULL; 2191 bio->bi_next = NULL;
2194 bio->bi_flags &= ~(BIO_POOL_MASK-1); 2192 bio->bi_flags &= ~(BIO_POOL_MASK-1);
2195 bio->bi_flags |= 1 << BIO_UPTODATE; 2193 bio->bi_flags |= 1 << BIO_UPTODATE;
2196 bio->bi_comp_cpu = -1;
2197 bio->bi_rw = READ; 2194 bio->bi_rw = READ;
2198 bio->bi_vcnt = 0; 2195 bio->bi_vcnt = 0;
2199 bio->bi_idx = 0; 2196 bio->bi_idx = 0;
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index c025a8276dc1..dde6dd4b47ec 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -842,7 +842,7 @@ static void unfreeze_array(struct r10conf *conf)
842 spin_unlock_irq(&conf->resync_lock); 842 spin_unlock_irq(&conf->resync_lock);
843} 843}
844 844
845static int make_request(struct mddev *mddev, struct bio * bio) 845static void make_request(struct mddev *mddev, struct bio * bio)
846{ 846{
847 struct r10conf *conf = mddev->private; 847 struct r10conf *conf = mddev->private;
848 struct mirror_info *mirror; 848 struct mirror_info *mirror;
@@ -861,7 +861,7 @@ static int make_request(struct mddev *mddev, struct bio * bio)
861 861
862 if (unlikely(bio->bi_rw & REQ_FLUSH)) { 862 if (unlikely(bio->bi_rw & REQ_FLUSH)) {
863 md_flush_request(mddev, bio); 863 md_flush_request(mddev, bio);
864 return 0; 864 return;
865 } 865 }
866 866
867 /* If this request crosses a chunk boundary, we need to 867 /* If this request crosses a chunk boundary, we need to
@@ -893,10 +893,8 @@ static int make_request(struct mddev *mddev, struct bio * bio)
893 conf->nr_waiting++; 893 conf->nr_waiting++;
894 spin_unlock_irq(&conf->resync_lock); 894 spin_unlock_irq(&conf->resync_lock);
895 895
896 if (make_request(mddev, &bp->bio1)) 896 make_request(mddev, &bp->bio1);
897 generic_make_request(&bp->bio1); 897 make_request(mddev, &bp->bio2);
898 if (make_request(mddev, &bp->bio2))
899 generic_make_request(&bp->bio2);
900 898
901 spin_lock_irq(&conf->resync_lock); 899 spin_lock_irq(&conf->resync_lock);
902 conf->nr_waiting--; 900 conf->nr_waiting--;
@@ -904,14 +902,14 @@ static int make_request(struct mddev *mddev, struct bio * bio)
904 spin_unlock_irq(&conf->resync_lock); 902 spin_unlock_irq(&conf->resync_lock);
905 903
906 bio_pair_release(bp); 904 bio_pair_release(bp);
907 return 0; 905 return;
908 bad_map: 906 bad_map:
909 printk("md/raid10:%s: make_request bug: can't convert block across chunks" 907 printk("md/raid10:%s: make_request bug: can't convert block across chunks"
910 " or bigger than %dk %llu %d\n", mdname(mddev), chunk_sects/2, 908 " or bigger than %dk %llu %d\n", mdname(mddev), chunk_sects/2,
911 (unsigned long long)bio->bi_sector, bio->bi_size >> 10); 909 (unsigned long long)bio->bi_sector, bio->bi_size >> 10);
912 910
913 bio_io_error(bio); 911 bio_io_error(bio);
914 return 0; 912 return;
915 } 913 }
916 914
917 md_write_start(mddev, bio); 915 md_write_start(mddev, bio);
@@ -954,7 +952,7 @@ read_again:
954 slot = r10_bio->read_slot; 952 slot = r10_bio->read_slot;
955 if (disk < 0) { 953 if (disk < 0) {
956 raid_end_bio_io(r10_bio); 954 raid_end_bio_io(r10_bio);
957 return 0; 955 return;
958 } 956 }
959 mirror = conf->mirrors + disk; 957 mirror = conf->mirrors + disk;
960 958
@@ -1002,7 +1000,7 @@ read_again:
1002 goto read_again; 1000 goto read_again;
1003 } else 1001 } else
1004 generic_make_request(read_bio); 1002 generic_make_request(read_bio);
1005 return 0; 1003 return;
1006 } 1004 }
1007 1005
1008 /* 1006 /*
@@ -1176,7 +1174,6 @@ retry_write:
1176 1174
1177 if (do_sync || !mddev->bitmap || !plugged) 1175 if (do_sync || !mddev->bitmap || !plugged)
1178 md_wakeup_thread(mddev->thread); 1176 md_wakeup_thread(mddev->thread);
1179 return 0;
1180} 1177}
1181 1178
1182static void status(struct seq_file *seq, struct mddev *mddev) 1179static void status(struct seq_file *seq, struct mddev *mddev)
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index f6fe053a5bed..bb1b46143fb6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -3688,7 +3688,7 @@ static struct stripe_head *__get_priority_stripe(struct r5conf *conf)
3688 return sh; 3688 return sh;
3689} 3689}
3690 3690
3691static int make_request(struct mddev *mddev, struct bio * bi) 3691static void make_request(struct mddev *mddev, struct bio * bi)
3692{ 3692{
3693 struct r5conf *conf = mddev->private; 3693 struct r5conf *conf = mddev->private;
3694 int dd_idx; 3694 int dd_idx;
@@ -3701,7 +3701,7 @@ static int make_request(struct mddev *mddev, struct bio * bi)
3701 3701
3702 if (unlikely(bi->bi_rw & REQ_FLUSH)) { 3702 if (unlikely(bi->bi_rw & REQ_FLUSH)) {
3703 md_flush_request(mddev, bi); 3703 md_flush_request(mddev, bi);
3704 return 0; 3704 return;
3705 } 3705 }
3706 3706
3707 md_write_start(mddev, bi); 3707 md_write_start(mddev, bi);
@@ -3709,7 +3709,7 @@ static int make_request(struct mddev *mddev, struct bio * bi)
3709 if (rw == READ && 3709 if (rw == READ &&
3710 mddev->reshape_position == MaxSector && 3710 mddev->reshape_position == MaxSector &&
3711 chunk_aligned_read(mddev,bi)) 3711 chunk_aligned_read(mddev,bi))
3712 return 0; 3712 return;
3713 3713
3714 logical_sector = bi->bi_sector & ~((sector_t)STRIPE_SECTORS-1); 3714 logical_sector = bi->bi_sector & ~((sector_t)STRIPE_SECTORS-1);
3715 last_sector = bi->bi_sector + (bi->bi_size>>9); 3715 last_sector = bi->bi_sector + (bi->bi_size>>9);
@@ -3844,8 +3844,6 @@ static int make_request(struct mddev *mddev, struct bio * bi)
3844 3844
3845 bio_endio(bi, 0); 3845 bio_endio(bi, 0);
3846 } 3846 }
3847
3848 return 0;
3849} 3847}
3850 3848
3851static sector_t raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks); 3849static sector_t raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks);
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c
index 9b43ae94beba..a5a55da2a1ac 100644
--- a/drivers/s390/block/dcssblk.c
+++ b/drivers/s390/block/dcssblk.c
@@ -27,7 +27,7 @@
27 27
28static int dcssblk_open(struct block_device *bdev, fmode_t mode); 28static int dcssblk_open(struct block_device *bdev, fmode_t mode);
29static int dcssblk_release(struct gendisk *disk, fmode_t mode); 29static int dcssblk_release(struct gendisk *disk, fmode_t mode);
30static int dcssblk_make_request(struct request_queue *q, struct bio *bio); 30static void dcssblk_make_request(struct request_queue *q, struct bio *bio);
31static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum, 31static int dcssblk_direct_access(struct block_device *bdev, sector_t secnum,
32 void **kaddr, unsigned long *pfn); 32 void **kaddr, unsigned long *pfn);
33 33
@@ -814,7 +814,7 @@ out:
814 return rc; 814 return rc;
815} 815}
816 816
817static int 817static void
818dcssblk_make_request(struct request_queue *q, struct bio *bio) 818dcssblk_make_request(struct request_queue *q, struct bio *bio)
819{ 819{
820 struct dcssblk_dev_info *dev_info; 820 struct dcssblk_dev_info *dev_info;
@@ -871,10 +871,9 @@ dcssblk_make_request(struct request_queue *q, struct bio *bio)
871 bytes_done += bvec->bv_len; 871 bytes_done += bvec->bv_len;
872 } 872 }
873 bio_endio(bio, 0); 873 bio_endio(bio, 0);
874 return 0; 874 return;
875fail: 875fail:
876 bio_io_error(bio); 876 bio_io_error(bio);
877 return 0;
878} 877}
879 878
880static int 879static int
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index 1f6a4d894e73..98f3e4ade924 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -181,7 +181,7 @@ static unsigned long xpram_highest_page_index(void)
181/* 181/*
182 * Block device make request function. 182 * Block device make request function.
183 */ 183 */
184static int xpram_make_request(struct request_queue *q, struct bio *bio) 184static void xpram_make_request(struct request_queue *q, struct bio *bio)
185{ 185{
186 xpram_device_t *xdev = bio->bi_bdev->bd_disk->private_data; 186 xpram_device_t *xdev = bio->bi_bdev->bd_disk->private_data;
187 struct bio_vec *bvec; 187 struct bio_vec *bvec;
@@ -221,10 +221,9 @@ static int xpram_make_request(struct request_queue *q, struct bio *bio)
221 } 221 }
222 set_bit(BIO_UPTODATE, &bio->bi_flags); 222 set_bit(BIO_UPTODATE, &bio->bi_flags);
223 bio_endio(bio, 0); 223 bio_endio(bio, 0);
224 return 0; 224 return;
225fail: 225fail:
226 bio_io_error(bio); 226 bio_io_error(bio);
227 return 0;
228} 227}
229 228
230static int xpram_getgeo(struct block_device *bdev, struct hd_geometry *geo) 229static int xpram_getgeo(struct block_device *bdev, struct hd_geometry *geo)
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index b9926ee0052c..09de99fbb7e0 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -556,7 +556,7 @@ static inline int valid_io_request(struct zram *zram, struct bio *bio)
556/* 556/*
557 * Handler function for all zram I/O requests. 557 * Handler function for all zram I/O requests.
558 */ 558 */
559static int zram_make_request(struct request_queue *queue, struct bio *bio) 559static void zram_make_request(struct request_queue *queue, struct bio *bio)
560{ 560{
561 struct zram *zram = queue->queuedata; 561 struct zram *zram = queue->queuedata;
562 562
@@ -575,13 +575,12 @@ static int zram_make_request(struct request_queue *queue, struct bio *bio)
575 __zram_make_request(zram, bio, bio_data_dir(bio)); 575 __zram_make_request(zram, bio, bio_data_dir(bio));
576 up_read(&zram->init_lock); 576 up_read(&zram->init_lock);
577 577
578 return 0; 578 return;
579 579
580error_unlock: 580error_unlock:
581 up_read(&zram->init_lock); 581 up_read(&zram->init_lock);
582error: 582error:
583 bio_io_error(bio); 583 bio_io_error(bio);
584 return 0;
585} 584}
586 585
587void __zram_reset_device(struct zram *zram) 586void __zram_reset_device(struct zram *zram)