aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/Kconfig7
-rw-r--r--drivers/block/cciss.c16
-rw-r--r--drivers/block/cpqarray.c78
-rw-r--r--drivers/block/lguest_blk.c9
-rw-r--r--drivers/block/viodasd.c1
-rw-r--r--drivers/block/xsysace.c29
6 files changed, 57 insertions, 83 deletions
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
index a4a311992408..4245b7f80a49 100644
--- a/drivers/block/Kconfig
+++ b/drivers/block/Kconfig
@@ -6,6 +6,12 @@ menuconfig BLK_DEV
6 bool "Block devices" 6 bool "Block devices"
7 depends on BLOCK 7 depends on BLOCK
8 default y 8 default y
9 ---help---
10 Say Y here to get to see options for various different block device
11 drivers. This option alone does not add any kernel code.
12
13 If you say N, all options in this submenu will be skipped and disabled;
14 only do this if you know what you are doing.
9 15
10if BLK_DEV 16if BLK_DEV
11 17
@@ -62,6 +68,7 @@ config AMIGA_Z2RAM
62config BLK_DEV_XD 68config BLK_DEV_XD
63 tristate "XT hard disk support" 69 tristate "XT hard disk support"
64 depends on ISA && ISA_DMA_API 70 depends on ISA && ISA_DMA_API
71 select CHECK_SIGNATURE
65 help 72 help
66 Very old 8 bit hard disk controllers used in the IBM XT computer 73 Very old 8 bit hard disk controllers used in the IBM XT computer
67 will be supported if you say Y here. 74 will be supported if you say Y here.
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index a11b2bd54bbe..084358a828e9 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1977,12 +1977,13 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size,
1977{ 1977{
1978 ReadCapdata_struct *buf; 1978 ReadCapdata_struct *buf;
1979 int return_code; 1979 int return_code;
1980 buf = kmalloc(sizeof(ReadCapdata_struct), GFP_KERNEL); 1980
1981 if (buf == NULL) { 1981 buf = kzalloc(sizeof(ReadCapdata_struct), GFP_KERNEL);
1982 if (!buf) {
1982 printk(KERN_WARNING "cciss: out of memory\n"); 1983 printk(KERN_WARNING "cciss: out of memory\n");
1983 return; 1984 return;
1984 } 1985 }
1985 memset(buf, 0, sizeof(ReadCapdata_struct)); 1986
1986 if (withirq) 1987 if (withirq)
1987 return_code = sendcmd_withirq(CCISS_READ_CAPACITY, 1988 return_code = sendcmd_withirq(CCISS_READ_CAPACITY,
1988 ctlr, buf, sizeof(ReadCapdata_struct), 1989 ctlr, buf, sizeof(ReadCapdata_struct),
@@ -2003,7 +2004,6 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size,
2003 printk(KERN_INFO " blocks= %llu block_size= %d\n", 2004 printk(KERN_INFO " blocks= %llu block_size= %d\n",
2004 (unsigned long long)*total_size+1, *block_size); 2005 (unsigned long long)*total_size+1, *block_size);
2005 kfree(buf); 2006 kfree(buf);
2006 return;
2007} 2007}
2008 2008
2009static void 2009static void
@@ -2011,12 +2011,13 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size,
2011{ 2011{
2012 ReadCapdata_struct_16 *buf; 2012 ReadCapdata_struct_16 *buf;
2013 int return_code; 2013 int return_code;
2014 buf = kmalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL); 2014
2015 if (buf == NULL) { 2015 buf = kzalloc(sizeof(ReadCapdata_struct_16), GFP_KERNEL);
2016 if (!buf) {
2016 printk(KERN_WARNING "cciss: out of memory\n"); 2017 printk(KERN_WARNING "cciss: out of memory\n");
2017 return; 2018 return;
2018 } 2019 }
2019 memset(buf, 0, sizeof(ReadCapdata_struct_16)); 2020
2020 if (withirq) { 2021 if (withirq) {
2021 return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16, 2022 return_code = sendcmd_withirq(CCISS_READ_CAPACITY_16,
2022 ctlr, buf, sizeof(ReadCapdata_struct_16), 2023 ctlr, buf, sizeof(ReadCapdata_struct_16),
@@ -2038,7 +2039,6 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size,
2038 printk(KERN_INFO " blocks= %llu block_size= %d\n", 2039 printk(KERN_INFO " blocks= %llu block_size= %d\n",
2039 (unsigned long long)*total_size+1, *block_size); 2040 (unsigned long long)*total_size+1, *block_size);
2040 kfree(buf); 2041 kfree(buf);
2041 return;
2042} 2042}
2043 2043
2044static int cciss_revalidate(struct gendisk *disk) 2044static int cciss_revalidate(struct gendisk *disk)
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c
index be4e3477d83b..eb9799acf65b 100644
--- a/drivers/block/cpqarray.c
+++ b/drivers/block/cpqarray.c
@@ -420,18 +420,17 @@ static int __init cpqarray_register_ctlr( int i, struct pci_dev *pdev)
420 goto Enomem2; 420 goto Enomem2;
421 } 421 }
422 422
423 hba[i]->cmd_pool = (cmdlist_t *)pci_alloc_consistent( 423 hba[i]->cmd_pool = pci_alloc_consistent(
424 hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t), 424 hba[i]->pci_dev, NR_CMDS * sizeof(cmdlist_t),
425 &(hba[i]->cmd_pool_dhandle)); 425 &(hba[i]->cmd_pool_dhandle));
426 hba[i]->cmd_pool_bits = kmalloc( 426 hba[i]->cmd_pool_bits = kcalloc(
427 ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long), 427 (NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG, sizeof(unsigned long),
428 GFP_KERNEL); 428 GFP_KERNEL);
429 429
430 if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool) 430 if (!hba[i]->cmd_pool_bits || !hba[i]->cmd_pool)
431 goto Enomem1; 431 goto Enomem1;
432 432
433 memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t)); 433 memset(hba[i]->cmd_pool, 0, NR_CMDS * sizeof(cmdlist_t));
434 memset(hba[i]->cmd_pool_bits, 0, ((NR_CMDS+BITS_PER_LONG-1)/BITS_PER_LONG)*sizeof(unsigned long));
435 printk(KERN_INFO "cpqarray: Finding drives on %s", 434 printk(KERN_INFO "cpqarray: Finding drives on %s",
436 hba[i]->devname); 435 hba[i]->devname);
437 436
@@ -1660,45 +1659,30 @@ static void getgeometry(int ctlr)
1660 1659
1661 info_p->log_drv_map = 0; 1660 info_p->log_drv_map = 0;
1662 1661
1663 id_ldrive = kmalloc(sizeof(id_log_drv_t), GFP_KERNEL); 1662 id_ldrive = kzalloc(sizeof(id_log_drv_t), GFP_KERNEL);
1664 if(id_ldrive == NULL) 1663 if (!id_ldrive) {
1665 {
1666 printk( KERN_ERR "cpqarray: out of memory.\n"); 1664 printk( KERN_ERR "cpqarray: out of memory.\n");
1667 return; 1665 goto err_0;
1668 } 1666 }
1669 1667
1670 id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL); 1668 id_ctlr_buf = kzalloc(sizeof(id_ctlr_t), GFP_KERNEL);
1671 if(id_ctlr_buf == NULL) 1669 if (!id_ctlr_buf) {
1672 {
1673 kfree(id_ldrive);
1674 printk( KERN_ERR "cpqarray: out of memory.\n"); 1670 printk( KERN_ERR "cpqarray: out of memory.\n");
1675 return; 1671 goto err_1;
1676 } 1672 }
1677 1673
1678 id_lstatus_buf = kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL); 1674 id_lstatus_buf = kzalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
1679 if(id_lstatus_buf == NULL) 1675 if (!id_lstatus_buf) {
1680 {
1681 kfree(id_ctlr_buf);
1682 kfree(id_ldrive);
1683 printk( KERN_ERR "cpqarray: out of memory.\n"); 1676 printk( KERN_ERR "cpqarray: out of memory.\n");
1684 return; 1677 goto err_2;
1685 } 1678 }
1686 1679
1687 sense_config_buf = kmalloc(sizeof(config_t), GFP_KERNEL); 1680 sense_config_buf = kzalloc(sizeof(config_t), GFP_KERNEL);
1688 if(sense_config_buf == NULL) 1681 if (!sense_config_buf) {
1689 {
1690 kfree(id_lstatus_buf);
1691 kfree(id_ctlr_buf);
1692 kfree(id_ldrive);
1693 printk( KERN_ERR "cpqarray: out of memory.\n"); 1682 printk( KERN_ERR "cpqarray: out of memory.\n");
1694 return; 1683 goto err_3;
1695 } 1684 }
1696 1685
1697 memset(id_ldrive, 0, sizeof(id_log_drv_t));
1698 memset(id_ctlr_buf, 0, sizeof(id_ctlr_t));
1699 memset(id_lstatus_buf, 0, sizeof(sense_log_drv_stat_t));
1700 memset(sense_config_buf, 0, sizeof(config_t));
1701
1702 info_p->phys_drives = 0; 1686 info_p->phys_drives = 0;
1703 info_p->log_drv_map = 0; 1687 info_p->log_drv_map = 0;
1704 info_p->drv_assign_map = 0; 1688 info_p->drv_assign_map = 0;
@@ -1712,13 +1696,8 @@ static void getgeometry(int ctlr)
1712 * so the idastubopen will fail on all logical drives 1696 * so the idastubopen will fail on all logical drives
1713 * on the controller. 1697 * on the controller.
1714 */ 1698 */
1715 /* Free all the buffers and return */
1716 printk(KERN_ERR "cpqarray: error sending ID controller\n"); 1699 printk(KERN_ERR "cpqarray: error sending ID controller\n");
1717 kfree(sense_config_buf); 1700 goto err_4;
1718 kfree(id_lstatus_buf);
1719 kfree(id_ctlr_buf);
1720 kfree(id_ldrive);
1721 return;
1722 } 1701 }
1723 1702
1724 info_p->log_drives = id_ctlr_buf->nr_drvs; 1703 info_p->log_drives = id_ctlr_buf->nr_drvs;
@@ -1764,12 +1743,7 @@ static void getgeometry(int ctlr)
1764 " failed to report status of logical drive %d\n" 1743 " failed to report status of logical drive %d\n"
1765 "Access to this controller has been disabled\n", 1744 "Access to this controller has been disabled\n",
1766 ctlr, log_unit); 1745 ctlr, log_unit);
1767 /* Free all the buffers and return */ 1746 goto err_4;
1768 kfree(sense_config_buf);
1769 kfree(id_lstatus_buf);
1770 kfree(id_ctlr_buf);
1771 kfree(id_ldrive);
1772 return;
1773 } 1747 }
1774 /* 1748 /*
1775 Make sure the logical drive is configured 1749 Make sure the logical drive is configured
@@ -1798,14 +1772,8 @@ static void getgeometry(int ctlr)
1798 sizeof(config_t), 0, 0, log_unit); 1772 sizeof(config_t), 0, 0, log_unit);
1799 if (ret_code == IO_ERROR) { 1773 if (ret_code == IO_ERROR) {
1800 info_p->log_drv_map = 0; 1774 info_p->log_drv_map = 0;
1801 /* Free all the buffers and return */
1802 printk(KERN_ERR "cpqarray: error sending sense config\n"); 1775 printk(KERN_ERR "cpqarray: error sending sense config\n");
1803 kfree(sense_config_buf); 1776 goto err_4;
1804 kfree(id_lstatus_buf);
1805 kfree(id_ctlr_buf);
1806 kfree(id_ldrive);
1807 return;
1808
1809 } 1777 }
1810 1778
1811 info_p->phys_drives = 1779 info_p->phys_drives =
@@ -1820,12 +1788,18 @@ static void getgeometry(int ctlr)
1820 log_index = log_index + 1; 1788 log_index = log_index + 1;
1821 } /* end of if logical drive configured */ 1789 } /* end of if logical drive configured */
1822 } /* end of for log_unit */ 1790 } /* end of for log_unit */
1791
1792 /* Free all the buffers and return */
1793err_4:
1823 kfree(sense_config_buf); 1794 kfree(sense_config_buf);
1824 kfree(id_ldrive); 1795err_3:
1825 kfree(id_lstatus_buf); 1796 kfree(id_lstatus_buf);
1797err_2:
1826 kfree(id_ctlr_buf); 1798 kfree(id_ctlr_buf);
1799err_1:
1800 kfree(id_ldrive);
1801err_0:
1827 return; 1802 return;
1828
1829} 1803}
1830 1804
1831static void __exit cpqarray_exit(void) 1805static void __exit cpqarray_exit(void)
diff --git a/drivers/block/lguest_blk.c b/drivers/block/lguest_blk.c
index 93e3c4001bf5..160cf14431ac 100644
--- a/drivers/block/lguest_blk.c
+++ b/drivers/block/lguest_blk.c
@@ -308,9 +308,12 @@ static int lguestblk_probe(struct lguest_device *lgdev)
308 } 308 }
309 309
310 /* This allocates a "struct gendisk" where we pack all the information 310 /* This allocates a "struct gendisk" where we pack all the information
311 * about the disk which the rest of Linux sees. We ask for one minor 311 * about the disk which the rest of Linux sees. The argument is the
312 * number; I do wonder if we should be asking for more. */ 312 * number of minor devices desired: we need one minor for the main
313 bd->disk = alloc_disk(1); 313 * disk, and one for each partition. Of course, we can't possibly know
314 * how many partitions are on the disk (add_disk does that).
315 */
316 bd->disk = alloc_disk(16);
314 if (!bd->disk) { 317 if (!bd->disk) {
315 err = -ENOMEM; 318 err = -ENOMEM;
316 goto out_unregister_blkdev; 319 goto out_unregister_blkdev;
diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c
index 85916e2665d4..af3969a9c963 100644
--- a/drivers/block/viodasd.c
+++ b/drivers/block/viodasd.c
@@ -41,7 +41,6 @@
41#include <linux/dma-mapping.h> 41#include <linux/dma-mapping.h>
42#include <linux/completion.h> 42#include <linux/completion.h>
43#include <linux/device.h> 43#include <linux/device.h>
44#include <linux/kernel.h>
45 44
46#include <asm/uaccess.h> 45#include <asm/uaccess.h>
47#include <asm/vio.h> 46#include <asm/vio.h>
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index cb27e8863d7c..3ede0b63da13 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -902,26 +902,17 @@ static int ace_release(struct inode *inode, struct file *filp)
902 return 0; 902 return 0;
903} 903}
904 904
905static int ace_ioctl(struct inode *inode, struct file *filp, 905static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
906 unsigned int cmd, unsigned long arg)
907{ 906{
908 struct ace_device *ace = inode->i_bdev->bd_disk->private_data; 907 struct ace_device *ace = bdev->bd_disk->private_data;
909 struct hd_geometry __user *geo = (struct hd_geometry __user *)arg;
910 struct hd_geometry g;
911 dev_dbg(ace->dev, "ace_ioctl()\n");
912
913 switch (cmd) {
914 case HDIO_GETGEO:
915 g.heads = ace->cf_id.heads;
916 g.sectors = ace->cf_id.sectors;
917 g.cylinders = ace->cf_id.cyls;
918 g.start = 0;
919 return copy_to_user(geo, &g, sizeof(g)) ? -EFAULT : 0;
920 908
921 default: 909 dev_dbg(ace->dev, "ace_getgeo()\n");
922 return -ENOTTY; 910
923 } 911 geo->heads = ace->cf_id.heads;
924 return -ENOTTY; 912 geo->sectors = ace->cf_id.sectors;
913 geo->cylinders = ace->cf_id.cyls;
914
915 return 0;
925} 916}
926 917
927static struct block_device_operations ace_fops = { 918static struct block_device_operations ace_fops = {
@@ -930,7 +921,7 @@ static struct block_device_operations ace_fops = {
930 .release = ace_release, 921 .release = ace_release,
931 .media_changed = ace_media_changed, 922 .media_changed = ace_media_changed,
932 .revalidate_disk = ace_revalidate_disk, 923 .revalidate_disk = ace_revalidate_disk,
933 .ioctl = ace_ioctl, 924 .getgeo = ace_getgeo,
934}; 925};
935 926
936/* -------------------------------------------------------------------- 927/* --------------------------------------------------------------------