git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
drivers
/
block
/
cciss.c
diff --git
a/drivers/block/cciss.c
b/drivers/block/cciss.c
index
ff900aa
..
93e23d6
100644
(file)
--- a/
drivers/block/cciss.c
+++ b/
drivers/block/cciss.c
@@
-38,7
+38,6
@@
#include <linux/hdreg.h>
#include <linux/spinlock.h>
#include <linux/compat.h>
#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>
#include <asm/uaccess.h>
#include <asm/io.h>
@@
-57,7
+56,6
@@
MODULE_DESCRIPTION("Driver for HP Controller SA5xxx SA6xxx version 2.6.10");
MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400"
" SA6i P600 P800 P400 P400i E200 E200i");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("HP SA5i SA5i+ SA532 SA5300 SA5312 SA641 SA642 SA6400"
" SA6i P600 P800 P400 P400i E200 E200i");
MODULE_LICENSE("GPL");
-MODULE_VERSION("2.6.8");
#include "cciss_cmd.h"
#include "cciss.h"
#include "cciss_cmd.h"
#include "cciss.h"
@@
-997,11
+995,13
@@
static int cciss_ioctl(struct inode *inode, struct file *filep,
status = -EINVAL;
goto cleanup1;
}
status = -EINVAL;
goto cleanup1;
}
- buff = kzalloc(MAXSGENTRIES * sizeof(char *), GFP_KERNEL);
+ buff = (unsigned char **) kmalloc(MAXSGENTRIES *
+ sizeof(char *), GFP_KERNEL);
if (!buff) {
status = -ENOMEM;
goto cleanup1;
}
if (!buff) {
status = -ENOMEM;
goto cleanup1;
}
+ memset(buff, 0, MAXSGENTRIES);
buff_size = (int *) kmalloc(MAXSGENTRIES * sizeof(int),
GFP_KERNEL);
if (!buff_size) {
buff_size = (int *) kmalloc(MAXSGENTRIES * sizeof(int),
GFP_KERNEL);
if (!buff_size) {
@@
-1218,6
+1218,12
@@
static void cciss_softirq_done(struct request *rq)
complete_buffers(rq->bio, rq->errors);
complete_buffers(rq->bio, rq->errors);
+ if (blk_fs_request(rq)) {
+ const int rw = rq_data_dir(rq);
+
+ disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors);
+ }
+
#ifdef CCISS_DEBUG
printk("Done with %p\n", rq);
#endif /* CCISS_DEBUG */
#ifdef CCISS_DEBUG
printk("Done with %p\n", rq);
#endif /* CCISS_DEBUG */
@@
-2186,7
+2192,7
@@
static void start_io( ctlr_info_t *h)
break;
}
break;
}
- /* Get the f
ir
st entry from the Request Q */
+ /* Get the f
ri
st entry from the Request Q */
removeQ(&(h->reqQ), c);
h->Qdepth--;
removeQ(&(h->reqQ), c);
h->Qdepth--;
@@
-2333,7
+2339,6
@@
static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd,
cmd->rq->completion_data = cmd;
cmd->rq->errors = status;
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);
}
blk_complete_request(cmd->rq);
}
@@
-2362,7
+2367,8
@@
queue:
if (!creq)
goto startio;
if (!creq)
goto startio;
- BUG_ON(creq->nr_phys_segments > MAXSGENTRIES);
+ if (creq->nr_phys_segments > MAXSGENTRIES)
+ BUG();
if (( c = cmd_alloc(h, 1)) == NULL)
goto full;
if (( c = cmd_alloc(h, 1)) == NULL)
goto full;
@@
-2730,9
+2736,9
@@
static void __devinit cciss_interrupt_mode(ctlr_info_t *c, struct pci_dev *pdev,
return;
}
}
return;
}
}
-default_int_mode:
#endif /* CONFIG_PCI_MSI */
/* if we get here we're going to use the default interrupt mode */
#endif /* CONFIG_PCI_MSI */
/* if we get here we're going to use the default interrupt mode */
+default_int_mode:
c->intr[SIMPLE_MODE_INT] = pdev->irq;
return;
}
c->intr[SIMPLE_MODE_INT] = pdev->irq;
return;
}
@@
-2941,12
+2947,13
@@
static void cciss_getgeometry(int cntl_num)
int block_size;
int total_size;
int block_size;
int total_size;
- ld_buff = k
z
alloc(sizeof(ReportLunData_struct), GFP_KERNEL);
+ ld_buff = k
m
alloc(sizeof(ReportLunData_struct), GFP_KERNEL);
if (ld_buff == NULL)
{
printk(KERN_ERR "cciss: out of memory\n");
return;
}
if (ld_buff == NULL)
{
printk(KERN_ERR "cciss: out of memory\n");
return;
}
+ memset(ld_buff, 0, sizeof(ReportLunData_struct));
size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL);
if (size_buff == NULL)
{
size_buff = kmalloc(sizeof( ReadCapdata_struct), GFP_KERNEL);
if (size_buff == NULL)
{
@@
-3060,9
+3067,10
@@
static int alloc_cciss_hba(void)
for(i=0; i< MAX_CTLR; i++) {
if (!hba[i]) {
ctlr_info_t *p;
for(i=0; i< MAX_CTLR; i++) {
if (!hba[i]) {
ctlr_info_t *p;
- p = k
z
alloc(sizeof(ctlr_info_t), GFP_KERNEL);
+ p = k
m
alloc(sizeof(ctlr_info_t), GFP_KERNEL);
if (!p)
goto Enomem;
if (!p)
goto Enomem;
+ memset(p, 0, sizeof(ctlr_info_t));
for (n = 0; n < NWD; n++)
p->gendisk[n] = disk[n];
hba[i] = p;
for (n = 0; n < NWD; n++)
p->gendisk[n] = disk[n];
hba[i] = p;
@@
-3251,7
+3259,8
@@
static int __devinit cciss_init_one(struct pci_dev *pdev,
clean4:
#ifdef CONFIG_CISS_SCSI_TAPE
clean4:
#ifdef CONFIG_CISS_SCSI_TAPE
- kfree(hba[i]->scsi_rejects.complete);
+ if(hba[i]->scsi_rejects.complete)
+ kfree(hba[i]->scsi_rejects.complete);
#endif
kfree(hba[i]->cmd_pool_bits);
if(hba[i]->cmd_pool)
#endif
kfree(hba[i]->cmd_pool_bits);
if(hba[i]->cmd_pool)