diff options
Diffstat (limited to 'drivers/block/cpqarray.c')
-rw-r--r-- | drivers/block/cpqarray.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 570d2f049323..d5f519ebbc08 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -998,6 +998,7 @@ static inline void complete_buffers(struct bio *bio, int ok) | |||
998 | */ | 998 | */ |
999 | static inline void complete_command(cmdlist_t *cmd, int timeout) | 999 | static inline void complete_command(cmdlist_t *cmd, int timeout) |
1000 | { | 1000 | { |
1001 | struct request *rq = cmd->rq; | ||
1001 | int ok=1; | 1002 | int ok=1; |
1002 | int i, ddir; | 1003 | int i, ddir; |
1003 | 1004 | ||
@@ -1029,12 +1030,18 @@ static inline void complete_command(cmdlist_t *cmd, int timeout) | |||
1029 | pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, | 1030 | pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, |
1030 | cmd->req.sg[i].size, ddir); | 1031 | cmd->req.sg[i].size, ddir); |
1031 | 1032 | ||
1032 | complete_buffers(cmd->rq->bio, ok); | 1033 | complete_buffers(rq->bio, ok); |
1033 | 1034 | ||
1034 | add_disk_randomness(cmd->rq->rq_disk); | 1035 | if (blk_fs_request(rq)) { |
1036 | const int rw = rq_data_dir(rq); | ||
1035 | 1037 | ||
1036 | DBGPX(printk("Done with %p\n", cmd->rq);); | 1038 | disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors); |
1037 | end_that_request_last(cmd->rq, ok ? 1 : -EIO); | 1039 | } |
1040 | |||
1041 | add_disk_randomness(rq->rq_disk); | ||
1042 | |||
1043 | DBGPX(printk("Done with %p\n", rq);); | ||
1044 | end_that_request_last(rq, ok ? 1 : -EIO); | ||
1038 | } | 1045 | } |
1039 | 1046 | ||
1040 | /* | 1047 | /* |