Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172952
b: refs/heads/master
c: 29009a0
h: refs/heads/master
v: v3
  • Loading branch information
Stephen M. Cameron authored and Jens Axboe committed Nov 13, 2009
1 parent 3aaaadb commit 7dac341
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b838bde922730b9cfeaa93ba80bd31173941495
refs/heads/master: 29009a036f2feb07d8a9b3c715a6365dddd82a7a
38 changes: 18 additions & 20 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -4376,30 +4376,28 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,

static void cciss_shutdown(struct pci_dev *pdev)
{
ctlr_info_t *tmp_ptr;
int i;
char flush_buf[4];
ctlr_info_t *h;
char *flush_buf;
int return_code;

tmp_ptr = pci_get_drvdata(pdev);
if (tmp_ptr == NULL)
return;
i = tmp_ptr->ctlr;
if (hba[i] == NULL)
h = pci_get_drvdata(pdev);
flush_buf = kzalloc(4, GFP_KERNEL);
if (!flush_buf) {
printk(KERN_WARNING
"cciss:%d cache not flushed, out of memory.\n",
h->ctlr);
return;

/* Turn board interrupts off and send the flush cache command */
/* sendcmd will turn off interrupt, and send the flush...
* To write all data in the battery backed cache to disks */
memset(flush_buf, 0, 4);
return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0,
CTLR_LUNID, TYPE_CMD);
if (return_code == IO_OK) {
printk(KERN_INFO "Completed flushing cache on controller %d\n", i);
} else {
printk(KERN_WARNING "Error flushing cache on controller %d\n", i);
}
free_irq(hba[i]->intr[2], hba[i]);
/* write all data in the battery backed cache to disk */
memset(flush_buf, 0, 4);
return_code = sendcmd_withirq(CCISS_CACHE_FLUSH, h->ctlr, flush_buf,
4, 0, CTLR_LUNID, TYPE_CMD);
kfree(flush_buf);
if (return_code != IO_OK)
printk(KERN_WARNING "cciss%d: Error flushing cache\n",
h->ctlr);
h->access.set_intr_mask(h, CCISS_INTR_OFF);
free_irq(h->intr[2], h);
}

static void __devexit cciss_remove_one(struct pci_dev *pdev)
Expand Down

0 comments on commit 7dac341

Please sign in to comment.