]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/block/cciss.c
[PATCH] autofs4: fix false negative return from expire
[linux-2.6-omap-h63xx.git] / drivers / block / cciss.c
index 12d7b9bdfa93b62ae0664255d2ca7b34b911841c..71ec9e6643836dac7de6c12a894816bd7b0631d8 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/hdreg.h>
 #include <linux/spinlock.h>
 #include <linux/compat.h>
+#include <linux/blktrace_api.h>
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
@@ -2137,7 +2138,7 @@ static void start_io( ctlr_info_t *h)
                        break;
                }
 
-               /* Get the frist entry from the Request Q */ 
+               /* Get the first entry from the Request Q */ 
                removeQ(&(h->reqQ), c);
                h->Qdepth--;
        
@@ -2183,6 +2184,7 @@ static void cciss_softirq_done(struct request *rq)
 {
        CommandList_struct *cmd = rq->completion_data;
        ctlr_info_t *h = hba[cmd->ctlr];
+       unsigned long flags;
        u64bit temp64;
        int i, ddir;
 
@@ -2205,10 +2207,10 @@ static void cciss_softirq_done(struct request *rq)
        printk("Done with %p\n", rq);
 #endif /* CCISS_DEBUG */ 
 
-       spin_lock_irq(&h->lock);
+       spin_lock_irqsave(&h->lock, flags);
        end_that_request_last(rq, rq->errors);
        cmd_free(h, cmd,1);
-       spin_unlock_irq(&h->lock);
+       spin_unlock_irqrestore(&h->lock, flags);
 }
 
 /* checks the status of the job and calls complete buffers to mark all 
@@ -2330,6 +2332,7 @@ static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd,
 
        cmd->rq->completion_data = cmd;
        cmd->rq->errors = status;
+       blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE);
        blk_complete_request(cmd->rq);
 }
 
@@ -2358,8 +2361,7 @@ queue:
        if (!creq)
                goto startio;
 
-       if (creq->nr_phys_segments > MAXSGENTRIES)
-                BUG();
+       BUG_ON(creq->nr_phys_segments > MAXSGENTRIES);
 
        if (( c = cmd_alloc(h, 1)) == NULL)
                goto full;
@@ -3250,8 +3252,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
 
 clean4:
 #ifdef CONFIG_CISS_SCSI_TAPE
-       if(hba[i]->scsi_rejects.complete)
-               kfree(hba[i]->scsi_rejects.complete);
+       kfree(hba[i]->scsi_rejects.complete);
 #endif
        kfree(hba[i]->cmd_pool_bits);
        if(hba[i]->cmd_pool)
@@ -3268,8 +3269,8 @@ clean2:
        unregister_blkdev(hba[i]->major, hba[i]->devname);
 clean1:
        release_io_mem(hba[i]);
-       free_hba(i);
        hba[i]->busy_initializing = 0;
+       free_hba(i);
        return(-1);
 }