Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40117
b: refs/heads/master
c: 3f7705e
h: refs/heads/master
i:
  40115: e829c5b
v: v3
  • Loading branch information
Matthew Wilcox authored and Linus Torvalds committed Oct 21, 2006
1 parent b4a923f commit 12f73a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 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: 8a7822a61ca9c22f464c0b79f455e62cccee747e
refs/heads/master: 3f7705eab6722ad1a346d748c4aad55755d6c241
22 changes: 9 additions & 13 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1923,7 +1923,6 @@ static void cciss_geometry_inquiry(int ctlr, int logvol,
{
int return_code;
unsigned long t;
unsigned long rem;

memset(inq_buff, 0, sizeof(InquiryData_struct));
if (withirq)
Expand All @@ -1939,26 +1938,23 @@ static void cciss_geometry_inquiry(int ctlr, int logvol,
printk(KERN_WARNING
"cciss: reading geometry failed, volume "
"does not support reading geometry\n");
drv->block_size = block_size;
drv->nr_blocks = total_size;
drv->heads = 255;
drv->sectors = 32; // Sectors per track
t = drv->heads * drv->sectors;
drv->cylinders = total_size;
rem = do_div(drv->cylinders, t);
} else {
drv->block_size = block_size;
drv->nr_blocks = total_size;
drv->heads = inq_buff->data_byte[6];
drv->sectors = inq_buff->data_byte[7];
drv->cylinders = (inq_buff->data_byte[4] & 0xff) << 8;
drv->cylinders += inq_buff->data_byte[5];
drv->raid_level = inq_buff->data_byte[8];
t = drv->heads * drv->sectors;
if (t > 1) {
drv->cylinders = total_size;
rem = do_div(drv->cylinders, t);
}
}
drv->block_size = block_size;
drv->nr_blocks = total_size;
t = drv->heads * drv->sectors;
if (t > 1) {
unsigned rem = sector_div(total_size, t);
if (rem)
total_size++;
drv->cylinders = total_size;
}
} else { /* Get geometry failed */
printk(KERN_WARNING "cciss: reading geometry failed\n");
Expand Down

0 comments on commit 12f73a4

Please sign in to comment.