dm.c (a3d77d35be6f416a250c528c3ed5c70013a915e8) | dm.c (45cbcd798354251b99694086af9d57c99e89bb43) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 468 unchanged lines hidden (view full) --- 477 478 if (!bio_flagged(bio, BIO_UPTODATE) && !error) 479 error = -EIO; 480 481 if (endio) { 482 r = endio(tio->ti, bio, error, &tio->info); 483 if (r < 0) 484 error = r; | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm.h" --- 468 unchanged lines hidden (view full) --- 477 478 if (!bio_flagged(bio, BIO_UPTODATE) && !error) 479 error = -EIO; 480 481 if (endio) { 482 r = endio(tio->ti, bio, error, &tio->info); 483 if (r < 0) 484 error = r; |
485 else if (r > 0) 486 /* the target wants another shot at the io */ | 485 else if (r == DM_ENDIO_INCOMPLETE) 486 /* The target will handle the io */ |
487 return 1; | 487 return 1; |
488 else if (r) { 489 DMWARN("unimplemented target endio return value: %d", r); 490 BUG(); 491 } |
|
488 } 489 490 dec_pending(tio->io, error); 491 492 /* 493 * Store md for cleanup instead of tio which is about to get freed. 494 */ 495 bio->bi_private = md->bs; --- 41 unchanged lines hidden (view full) --- 537 /* 538 * Map the clone. If r == 0 we don't need to do 539 * anything, the target has assumed ownership of 540 * this io. 541 */ 542 atomic_inc(&tio->io->io_count); 543 sector = clone->bi_sector; 544 r = ti->type->map(ti, clone, &tio->info); | 492 } 493 494 dec_pending(tio->io, error); 495 496 /* 497 * Store md for cleanup instead of tio which is about to get freed. 498 */ 499 bio->bi_private = md->bs; --- 41 unchanged lines hidden (view full) --- 541 /* 542 * Map the clone. If r == 0 we don't need to do 543 * anything, the target has assumed ownership of 544 * this io. 545 */ 546 atomic_inc(&tio->io->io_count); 547 sector = clone->bi_sector; 548 r = ti->type->map(ti, clone, &tio->info); |
545 if (r > 0) { | 549 if (r == DM_MAPIO_REMAPPED) { |
546 /* the bio has been remapped so dispatch it */ 547 548 blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, 549 tio->io->bio->bi_bdev->bd_dev, sector, 550 clone->bi_sector); 551 552 generic_make_request(clone); 553 } else if (r < 0) { 554 /* error the io and bail out */ 555 md = tio->io->md; 556 dec_pending(tio->io, r); 557 /* 558 * Store bio_set for cleanup. 559 */ 560 clone->bi_private = md->bs; 561 bio_put(clone); 562 free_tio(md, tio); | 550 /* the bio has been remapped so dispatch it */ 551 552 blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, 553 tio->io->bio->bi_bdev->bd_dev, sector, 554 clone->bi_sector); 555 556 generic_make_request(clone); 557 } else if (r < 0) { 558 /* error the io and bail out */ 559 md = tio->io->md; 560 dec_pending(tio->io, r); 561 /* 562 * Store bio_set for cleanup. 563 */ 564 clone->bi_private = md->bs; 565 bio_put(clone); 566 free_tio(md, tio); |
567 } else if (r) { 568 DMWARN("unimplemented target map return value: %d", r); 569 BUG(); |
|
563 } 564} 565 566struct clone_info { 567 struct mapped_device *md; 568 struct dm_table *map; 569 struct bio *bio; 570 struct dm_io *io; --- 891 unchanged lines hidden --- | 570 } 571} 572 573struct clone_info { 574 struct mapped_device *md; 575 struct dm_table *map; 576 struct bio *bio; 577 struct dm_io *io; --- 891 unchanged lines hidden --- |