[BLOCK] CCISS: update for blk softirq completions

Signed-off-by: Jens Axboe <axboe@suse.de>

+46 -26
+46 -26
drivers/block/cciss.c
··· 2178 2178 2179 2179 start_io(h); 2180 2180 } 2181 + 2182 + static void cciss_softirq_done(struct request *rq) 2183 + { 2184 + CommandList_struct *cmd = rq->completion_data; 2185 + ctlr_info_t *h = hba[cmd->ctlr]; 2186 + u64bit temp64; 2187 + int i, ddir; 2188 + 2189 + if (cmd->Request.Type.Direction == XFER_READ) 2190 + ddir = PCI_DMA_FROMDEVICE; 2191 + else 2192 + ddir = PCI_DMA_TODEVICE; 2193 + 2194 + /* command did not need to be retried */ 2195 + /* unmap the DMA mapping for all the scatter gather elements */ 2196 + for(i=0; i<cmd->Header.SGList; i++) { 2197 + temp64.val32.lower = cmd->SG[i].Addr.lower; 2198 + temp64.val32.upper = cmd->SG[i].Addr.upper; 2199 + pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir); 2200 + } 2201 + 2202 + complete_buffers(rq->bio, rq->errors); 2203 + 2204 + #ifdef CCISS_DEBUG 2205 + printk("Done with %p\n", rq); 2206 + #endif /* CCISS_DEBUG */ 2207 + 2208 + spin_lock_irq(&h->lock); 2209 + end_that_request_last(rq, rq->errors); 2210 + cmd_free(h, cmd,1); 2211 + spin_unlock_irq(&h->lock); 2212 + } 2213 + 2181 2214 /* checks the status of the job and calls complete buffers to mark all 2182 - * buffers for the completed job. 2215 + * buffers for the completed job. Note that this function does not need 2216 + * to hold the hba/queue lock. 2183 2217 */ 2184 2218 static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd, 2185 2219 int timeout) 2186 2220 { 2187 2221 int status = 1; 2188 - int i; 2189 2222 int retry_cmd = 0; 2190 - u64bit temp64; 2191 2223 2192 2224 if (timeout) 2193 2225 status = 0; ··· 2327 2295 resend_cciss_cmd(h,cmd); 2328 2296 return; 2329 2297 } 2330 - /* command did not need to be retried */ 2331 - /* unmap the DMA mapping for all the scatter gather elements */ 2332 - for(i=0; i<cmd->Header.SGList; i++) { 2333 - temp64.val32.lower = cmd->SG[i].Addr.lower; 2334 - temp64.val32.upper = cmd->SG[i].Addr.upper; 2335 - pci_unmap_page(hba[cmd->ctlr]->pdev, 2336 - temp64.val, cmd->SG[i].Len, 2337 - (cmd->Request.Type.Direction == XFER_READ) ? 2338 - PCI_DMA_FROMDEVICE : PCI_DMA_TODEVICE); 2339 - } 2340 - complete_buffers(cmd->rq->bio, status); 2341 2298 2342 - #ifdef CCISS_DEBUG 2343 - printk("Done with %p\n", cmd->rq); 2344 - #endif /* CCISS_DEBUG */ 2345 - 2346 - end_that_request_last(cmd->rq, status ? 1 : -EIO); 2347 - cmd_free(h,cmd,1); 2299 + cmd->rq->completion_data = cmd; 2300 + cmd->rq->errors = status; 2301 + blk_complete_request(cmd->rq); 2348 2302 } 2349 2303 2350 2304 /* ··· 3217 3199 drv->queue = q; 3218 3200 3219 3201 q->backing_dev_info.ra_pages = READ_AHEAD; 3220 - blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask); 3202 + blk_queue_bounce_limit(q, hba[i]->pdev->dma_mask); 3221 3203 3222 - /* This is a hardware imposed limit. */ 3223 - blk_queue_max_hw_segments(q, MAXSGENTRIES); 3204 + /* This is a hardware imposed limit. */ 3205 + blk_queue_max_hw_segments(q, MAXSGENTRIES); 3224 3206 3225 - /* This is a limit in the driver and could be eliminated. */ 3226 - blk_queue_max_phys_segments(q, MAXSGENTRIES); 3207 + /* This is a limit in the driver and could be eliminated. */ 3208 + blk_queue_max_phys_segments(q, MAXSGENTRIES); 3227 3209 3228 - blk_queue_max_sectors(q, 512); 3210 + blk_queue_max_sectors(q, 512); 3211 + 3212 + blk_queue_softirq_done(q, cciss_softirq_done); 3229 3213 3230 3214 q->queuedata = hba[i]; 3231 3215 sprintf(disk->disk_name, "cciss/c%dd%d", i, j);