diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-09-12 06:12:01 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-09-12 06:12:01 -0400 |
commit | 5a7bbad27a410350e64a2d7f5ec18fc73836c14f (patch) | |
tree | 3447cd62dbcbd77b4071e2eb7576f1d7632ef2d3 /drivers/md/linear.c | |
parent | c20e8de27fef9f59869c81c288ad6cf28200e00c (diff) |
block: remove support for bio remapping from ->make_request
There is very little benefit in allowing to let a ->make_request
instance update the bios device and sector and loop around it in
__generic_make_request when we can archive the same through calling
generic_make_request from the driver and letting the loop in
generic_make_request handle it.
Note that various drivers got the return value from ->make_request and
returned non-zero values for errors.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/md/linear.c')
-rw-r--r-- | drivers/md/linear.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index 6cd2c313e800..c6ee491d98e7 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -264,14 +264,14 @@ static int linear_stop (mddev_t *mddev) | |||
264 | return 0; | 264 | return 0; |
265 | } | 265 | } |
266 | 266 | ||
267 | static int linear_make_request (mddev_t *mddev, struct bio *bio) | 267 | static void linear_make_request (mddev_t *mddev, struct bio *bio) |
268 | { | 268 | { |
269 | dev_info_t *tmp_dev; | 269 | dev_info_t *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 (mddev_t *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 (mddev_t *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 | ||
326 | static void linear_status (struct seq_file *seq, mddev_t *mddev) | 323 | static void linear_status (struct seq_file *seq, mddev_t *mddev) |