diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-28 16:51:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-28 16:51:32 -0500 |
commit | f0f0052069989b80d2a3e50c9cd2f2a650bc1aea (patch) | |
tree | 40ff39bc341aed8318a54d1bd61a381f41844f71 /drivers/block/cpqarray.c | |
parent | 68fbda7de07e56eb90dd6e58a162527411b388b1 (diff) | |
parent | a65b58663d983e588aed8d1bfc75edaac2527fa7 (diff) |
Merge branch 'blk-end-request' of git://git.kernel.dk/linux-2.6-block
* 'blk-end-request' of git://git.kernel.dk/linux-2.6-block: (30 commits)
blk_end_request: changing xsysace (take 4)
blk_end_request: changing ub (take 4)
blk_end_request: cleanup of request completion (take 4)
blk_end_request: cleanup 'uptodate' related code (take 4)
blk_end_request: remove/unexport end_that_request_* (take 4)
blk_end_request: changing scsi (take 4)
blk_end_request: add bidi completion interface (take 4)
blk_end_request: changing ide-cd (take 4)
blk_end_request: add callback feature (take 4)
blk_end_request: changing ide normal caller (take 4)
blk_end_request: changing cpqarray (take 4)
blk_end_request: changing cciss (take 4)
blk_end_request: changing ide-scsi (take 4)
blk_end_request: changing s390 (take 4)
blk_end_request: changing mmc (take 4)
blk_end_request: changing i2o_block (take 4)
blk_end_request: changing viocd (take 4)
blk_end_request: changing xen-blkfront (take 4)
blk_end_request: changing viodasd (take 4)
blk_end_request: changing sx8 (take 4)
...
Diffstat (limited to 'drivers/block/cpqarray.c')
-rw-r--r-- | drivers/block/cpqarray.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index c8132d958795..69199185ff4b 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -167,7 +167,6 @@ static void start_io(ctlr_info_t *h); | |||
167 | 167 | ||
168 | static inline void addQ(cmdlist_t **Qptr, cmdlist_t *c); | 168 | static inline void addQ(cmdlist_t **Qptr, cmdlist_t *c); |
169 | static inline cmdlist_t *removeQ(cmdlist_t **Qptr, cmdlist_t *c); | 169 | static inline cmdlist_t *removeQ(cmdlist_t **Qptr, cmdlist_t *c); |
170 | static inline void complete_buffers(struct bio *bio, int ok); | ||
171 | static inline void complete_command(cmdlist_t *cmd, int timeout); | 170 | static inline void complete_command(cmdlist_t *cmd, int timeout); |
172 | 171 | ||
173 | static irqreturn_t do_ida_intr(int irq, void *dev_id); | 172 | static irqreturn_t do_ida_intr(int irq, void *dev_id); |
@@ -980,26 +979,13 @@ static void start_io(ctlr_info_t *h) | |||
980 | } | 979 | } |
981 | } | 980 | } |
982 | 981 | ||
983 | static inline void complete_buffers(struct bio *bio, int ok) | ||
984 | { | ||
985 | struct bio *xbh; | ||
986 | |||
987 | while (bio) { | ||
988 | xbh = bio->bi_next; | ||
989 | bio->bi_next = NULL; | ||
990 | |||
991 | bio_endio(bio, ok ? 0 : -EIO); | ||
992 | |||
993 | bio = xbh; | ||
994 | } | ||
995 | } | ||
996 | /* | 982 | /* |
997 | * Mark all buffers that cmd was responsible for | 983 | * Mark all buffers that cmd was responsible for |
998 | */ | 984 | */ |
999 | static inline void complete_command(cmdlist_t *cmd, int timeout) | 985 | static inline void complete_command(cmdlist_t *cmd, int timeout) |
1000 | { | 986 | { |
1001 | struct request *rq = cmd->rq; | 987 | struct request *rq = cmd->rq; |
1002 | int ok=1; | 988 | int error = 0; |
1003 | int i, ddir; | 989 | int i, ddir; |
1004 | 990 | ||
1005 | if (cmd->req.hdr.rcode & RCODE_NONFATAL && | 991 | if (cmd->req.hdr.rcode & RCODE_NONFATAL && |
@@ -1011,16 +997,17 @@ static inline void complete_command(cmdlist_t *cmd, int timeout) | |||
1011 | if (cmd->req.hdr.rcode & RCODE_FATAL) { | 997 | if (cmd->req.hdr.rcode & RCODE_FATAL) { |
1012 | printk(KERN_WARNING "Fatal error on ida/c%dd%d\n", | 998 | printk(KERN_WARNING "Fatal error on ida/c%dd%d\n", |
1013 | cmd->ctlr, cmd->hdr.unit); | 999 | cmd->ctlr, cmd->hdr.unit); |
1014 | ok = 0; | 1000 | error = -EIO; |
1015 | } | 1001 | } |
1016 | if (cmd->req.hdr.rcode & RCODE_INVREQ) { | 1002 | if (cmd->req.hdr.rcode & RCODE_INVREQ) { |
1017 | printk(KERN_WARNING "Invalid request on ida/c%dd%d = (cmd=%x sect=%d cnt=%d sg=%d ret=%x)\n", | 1003 | printk(KERN_WARNING "Invalid request on ida/c%dd%d = (cmd=%x sect=%d cnt=%d sg=%d ret=%x)\n", |
1018 | cmd->ctlr, cmd->hdr.unit, cmd->req.hdr.cmd, | 1004 | cmd->ctlr, cmd->hdr.unit, cmd->req.hdr.cmd, |
1019 | cmd->req.hdr.blk, cmd->req.hdr.blk_cnt, | 1005 | cmd->req.hdr.blk, cmd->req.hdr.blk_cnt, |
1020 | cmd->req.hdr.sg_cnt, cmd->req.hdr.rcode); | 1006 | cmd->req.hdr.sg_cnt, cmd->req.hdr.rcode); |
1021 | ok = 0; | 1007 | error = -EIO; |
1022 | } | 1008 | } |
1023 | if (timeout) ok = 0; | 1009 | if (timeout) |
1010 | error = -EIO; | ||
1024 | /* unmap the DMA mapping for all the scatter gather elements */ | 1011 | /* unmap the DMA mapping for all the scatter gather elements */ |
1025 | if (cmd->req.hdr.cmd == IDA_READ) | 1012 | if (cmd->req.hdr.cmd == IDA_READ) |
1026 | ddir = PCI_DMA_FROMDEVICE; | 1013 | ddir = PCI_DMA_FROMDEVICE; |
@@ -1030,18 +1017,9 @@ static inline void complete_command(cmdlist_t *cmd, int timeout) | |||
1030 | pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, | 1017 | pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, |
1031 | cmd->req.sg[i].size, ddir); | 1018 | cmd->req.sg[i].size, ddir); |
1032 | 1019 | ||
1033 | complete_buffers(rq->bio, ok); | ||
1034 | |||
1035 | if (blk_fs_request(rq)) { | ||
1036 | const int rw = rq_data_dir(rq); | ||
1037 | |||
1038 | disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors); | ||
1039 | } | ||
1040 | |||
1041 | add_disk_randomness(rq->rq_disk); | ||
1042 | |||
1043 | DBGPX(printk("Done with %p\n", rq);); | 1020 | DBGPX(printk("Done with %p\n", rq);); |
1044 | end_that_request_last(rq, ok ? 1 : -EIO); | 1021 | if (__blk_end_request(rq, error, blk_rq_bytes(rq))) |
1022 | BUG(); | ||
1045 | } | 1023 | } |
1046 | 1024 | ||
1047 | /* | 1025 | /* |