aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKiyoshi Ueda <k-ueda@ct.jp.nec.com>2007-12-11 17:50:03 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-01-28 04:36:58 -0500
commit3daeea29f9348263e0dda89a565074390475bdf8 (patch)
tree24a3f3e63c0e348b8218ff2a3b2da1582166a43d /drivers
parent5a330e39b13fe8d368d015338a4267129f502a55 (diff)
blk_end_request: changing cciss (take 4)
This patch converts cciss to use blk_end_request interfaces. Related 'uptodate' arguments are converted to 'error'. cciss is a little bit different from "normal" drivers. cciss directly calls bio_endio() and disk_stat_add() when completing request. But those can be replaced with __end_that_request_first(). After the replacement, request completion procedures of those drivers become like the following: o end_that_request_first() o add_disk_randomness() o end_that_request_last() This can be converted to blk_end_request() by following the rule (a) mentioned in the patch subject "[PATCH 01/30] blk_end_request: add new request completion interface". Cc: Mike Miller <mike.miller@hp.com> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/cciss.c25
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 509b6490413b..ef50068def88 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1187,17 +1187,6 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
1187 } 1187 }
1188} 1188}
1189 1189
1190static inline void complete_buffers(struct bio *bio, int status)
1191{
1192 while (bio) {
1193 struct bio *xbh = bio->bi_next;
1194
1195 bio->bi_next = NULL;
1196 bio_endio(bio, status ? 0 : -EIO);
1197 bio = xbh;
1198 }
1199}
1200
1201static void cciss_check_queues(ctlr_info_t *h) 1190static void cciss_check_queues(ctlr_info_t *h)
1202{ 1191{
1203 int start_queue = h->next_to_run; 1192 int start_queue = h->next_to_run;
@@ -1263,21 +1252,14 @@ static void cciss_softirq_done(struct request *rq)
1263 pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir); 1252 pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir);
1264 } 1253 }
1265 1254
1266 complete_buffers(rq->bio, (rq->errors == 0));
1267
1268 if (blk_fs_request(rq)) {
1269 const int rw = rq_data_dir(rq);
1270
1271 disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
1272 }
1273
1274#ifdef CCISS_DEBUG 1255#ifdef CCISS_DEBUG
1275 printk("Done with %p\n", rq); 1256 printk("Done with %p\n", rq);
1276#endif /* CCISS_DEBUG */ 1257#endif /* CCISS_DEBUG */
1277 1258
1278 add_disk_randomness(rq->rq_disk); 1259 if (blk_end_request(rq, (rq->errors == 0) ? 0 : -EIO, blk_rq_bytes(rq)))
1260 BUG();
1261
1279 spin_lock_irqsave(&h->lock, flags); 1262 spin_lock_irqsave(&h->lock, flags);
1280 end_that_request_last(rq, (rq->errors == 0));
1281 cmd_free(h, cmd, 1); 1263 cmd_free(h, cmd, 1);
1282 cciss_check_queues(h); 1264 cciss_check_queues(h);
1283 spin_unlock_irqrestore(&h->lock, flags); 1265 spin_unlock_irqrestore(&h->lock, flags);
@@ -2544,7 +2526,6 @@ after_error_processing:
2544 } 2526 }
2545 cmd->rq->data_len = 0; 2527 cmd->rq->data_len = 0;
2546 cmd->rq->completion_data = cmd; 2528 cmd->rq->completion_data = cmd;
2547 blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE);
2548 blk_complete_request(cmd->rq); 2529 blk_complete_request(cmd->rq);
2549} 2530}
2550 2531