diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/aoe/aoeblk.c | 1 | ||||
-rw-r--r-- | drivers/block/cciss.c | 36 | ||||
-rw-r--r-- | drivers/block/cpqarray.c | 15 |
3 files changed, 31 insertions, 21 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index d433f27e0ce2..aa25f8b09fe3 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c | |||
@@ -68,6 +68,7 @@ static struct attribute *aoe_attrs[] = { | |||
68 | &disk_attr_mac.attr, | 68 | &disk_attr_mac.attr, |
69 | &disk_attr_netif.attr, | 69 | &disk_attr_netif.attr, |
70 | &disk_attr_fwver.attr, | 70 | &disk_attr_fwver.attr, |
71 | NULL | ||
71 | }; | 72 | }; |
72 | 73 | ||
73 | static const struct attribute_group attr_group = { | 74 | static const struct attribute_group attr_group = { |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index dcccaf2782f3..4105c3bf3476 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1300,6 +1300,12 @@ static void cciss_softirq_done(struct request *rq) | |||
1300 | 1300 | ||
1301 | complete_buffers(rq->bio, rq->errors); | 1301 | complete_buffers(rq->bio, rq->errors); |
1302 | 1302 | ||
1303 | if (blk_fs_request(rq)) { | ||
1304 | const int rw = rq_data_dir(rq); | ||
1305 | |||
1306 | disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors); | ||
1307 | } | ||
1308 | |||
1303 | #ifdef CCISS_DEBUG | 1309 | #ifdef CCISS_DEBUG |
1304 | printk("Done with %p\n", rq); | 1310 | printk("Done with %p\n", rq); |
1305 | #endif /* CCISS_DEBUG */ | 1311 | #endif /* CCISS_DEBUG */ |
@@ -1923,7 +1929,6 @@ static void cciss_geometry_inquiry(int ctlr, int logvol, | |||
1923 | { | 1929 | { |
1924 | int return_code; | 1930 | int return_code; |
1925 | unsigned long t; | 1931 | unsigned long t; |
1926 | unsigned long rem; | ||
1927 | 1932 | ||
1928 | memset(inq_buff, 0, sizeof(InquiryData_struct)); | 1933 | memset(inq_buff, 0, sizeof(InquiryData_struct)); |
1929 | if (withirq) | 1934 | if (withirq) |
@@ -1939,26 +1944,23 @@ static void cciss_geometry_inquiry(int ctlr, int logvol, | |||
1939 | printk(KERN_WARNING | 1944 | printk(KERN_WARNING |
1940 | "cciss: reading geometry failed, volume " | 1945 | "cciss: reading geometry failed, volume " |
1941 | "does not support reading geometry\n"); | 1946 | "does not support reading geometry\n"); |
1942 | drv->block_size = block_size; | ||
1943 | drv->nr_blocks = total_size; | ||
1944 | drv->heads = 255; | 1947 | drv->heads = 255; |
1945 | drv->sectors = 32; // Sectors per track | 1948 | drv->sectors = 32; // Sectors per track |
1946 | t = drv->heads * drv->sectors; | ||
1947 | drv->cylinders = total_size; | ||
1948 | rem = do_div(drv->cylinders, t); | ||
1949 | } else { | 1949 | } else { |
1950 | drv->block_size = block_size; | ||
1951 | drv->nr_blocks = total_size; | ||
1952 | drv->heads = inq_buff->data_byte[6]; | 1950 | drv->heads = inq_buff->data_byte[6]; |
1953 | drv->sectors = inq_buff->data_byte[7]; | 1951 | drv->sectors = inq_buff->data_byte[7]; |
1954 | drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8; | 1952 | drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8; |
1955 | drv->cylinders += inq_buff->data_byte[5]; | 1953 | drv->cylinders += inq_buff->data_byte[5]; |
1956 | drv->raid_level = inq_buff->data_byte[8]; | 1954 | drv->raid_level = inq_buff->data_byte[8]; |
1957 | t = drv->heads * drv->sectors; | 1955 | } |
1958 | if (t > 1) { | 1956 | drv->block_size = block_size; |
1959 | drv->cylinders = total_size; | 1957 | drv->nr_blocks = total_size; |
1960 | rem = do_div(drv->cylinders, t); | 1958 | t = drv->heads * drv->sectors; |
1961 | } | 1959 | if (t > 1) { |
1960 | unsigned rem = sector_div(total_size, t); | ||
1961 | if (rem) | ||
1962 | total_size++; | ||
1963 | drv->cylinders = total_size; | ||
1962 | } | 1964 | } |
1963 | } else { /* Get geometry failed */ | 1965 | } else { /* Get geometry failed */ |
1964 | printk(KERN_WARNING "cciss: reading geometry failed\n"); | 1966 | printk(KERN_WARNING "cciss: reading geometry failed\n"); |
@@ -1996,8 +1998,8 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1996 | *block_size = BLOCK_SIZE; | 1998 | *block_size = BLOCK_SIZE; |
1997 | } | 1999 | } |
1998 | if (*total_size != (__u32) 0) | 2000 | if (*total_size != (__u32) 0) |
1999 | printk(KERN_INFO " blocks= %lld block_size= %d\n", | 2001 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
2000 | *total_size, *block_size); | 2002 | (unsigned long long)*total_size, *block_size); |
2001 | kfree(buf); | 2003 | kfree(buf); |
2002 | return; | 2004 | return; |
2003 | } | 2005 | } |
@@ -2031,8 +2033,8 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
2031 | *total_size = 0; | 2033 | *total_size = 0; |
2032 | *block_size = BLOCK_SIZE; | 2034 | *block_size = BLOCK_SIZE; |
2033 | } | 2035 | } |
2034 | printk(KERN_INFO " blocks= %lld block_size= %d\n", | 2036 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
2035 | *total_size, *block_size); | 2037 | (unsigned long long)*total_size, *block_size); |
2036 | kfree(buf); | 2038 | kfree(buf); |
2037 | return; | 2039 | return; |
2038 | } | 2040 | } |
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index 570d2f049323..d5f519ebbc08 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -998,6 +998,7 @@ static inline void complete_buffers(struct bio *bio, int ok) | |||
998 | */ | 998 | */ |
999 | static inline void complete_command(cmdlist_t *cmd, int timeout) | 999 | static inline void complete_command(cmdlist_t *cmd, int timeout) |
1000 | { | 1000 | { |
1001 | struct request *rq = cmd->rq; | ||
1001 | int ok=1; | 1002 | int ok=1; |
1002 | int i, ddir; | 1003 | int i, ddir; |
1003 | 1004 | ||
@@ -1029,12 +1030,18 @@ static inline void complete_command(cmdlist_t *cmd, int timeout) | |||
1029 | pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, | 1030 | pci_unmap_page(hba[cmd->ctlr]->pci_dev, cmd->req.sg[i].addr, |
1030 | cmd->req.sg[i].size, ddir); | 1031 | cmd->req.sg[i].size, ddir); |
1031 | 1032 | ||
1032 | complete_buffers(cmd->rq->bio, ok); | 1033 | complete_buffers(rq->bio, ok); |
1033 | 1034 | ||
1034 | add_disk_randomness(cmd->rq->rq_disk); | 1035 | if (blk_fs_request(rq)) { |
1036 | const int rw = rq_data_dir(rq); | ||
1035 | 1037 | ||
1036 | DBGPX(printk("Done with %p\n", cmd->rq);); | 1038 | disk_stat_add(rq->rq_disk, sectors[rw], rq->nr_sectors); |
1037 | end_that_request_last(cmd->rq, ok ? 1 : -EIO); | 1039 | } |
1040 | |||
1041 | add_disk_randomness(rq->rq_disk); | ||
1042 | |||
1043 | DBGPX(printk("Done with %p\n", rq);); | ||
1044 | end_that_request_last(rq, ok ? 1 : -EIO); | ||
1038 | } | 1045 | } |
1039 | 1046 | ||
1040 | /* | 1047 | /* |