diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-10 13:53:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-10 13:53:26 -0400 |
commit | ef5bef357cdf49f3a386c7102dbf3be5f7e5c913 (patch) | |
tree | 48d9dc86768e3e146267ea21d0c898f9008275a1 /drivers/scsi/sd.c | |
parent | e26feff647ef34423b048b940540a0059001ddb0 (diff) | |
parent | 41bfcf90101601f9507240ff0435c1b73d28a132 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (37 commits)
[SCSI] zfcp: fix double dbf id usage
[SCSI] zfcp: wait on SCSI work to be finished before proceeding with init dev
[SCSI] zfcp: fix erp list usage without using locks
[SCSI] zfcp: prevent fc_remote_port_delete calls for unregistered rport
[SCSI] zfcp: fix deadlock caused by shared work queue tasks
[SCSI] zfcp: put threshold data in hba trace
[SCSI] zfcp: Simplify zfcp data structures
[SCSI] zfcp: Simplify get_adapter_by_busid
[SCSI] zfcp: remove all typedefs and replace them with standards
[SCSI] zfcp: attach and release SAN nameserver port on demand
[SCSI] zfcp: remove unused references, declarations and flags
[SCSI] zfcp: Update message with input from review
[SCSI] zfcp: add queue_full sysfs attribute
[SCSI] scsi_dh: suppress comparison warning
[SCSI] scsi_dh: add Dell product information into rdac device handler
[SCSI] qla2xxx: remove the unused SCSI_QLOGIC_FC_FIRMWARE option
[SCSI] qla2xxx: fix printk format warnings
[SCSI] qla2xxx: Update version number to 8.02.01-k8.
[SCSI] qla2xxx: Ignore payload reserved-bits during RSCN processing.
[SCSI] qla2xxx: Additional residual-count corrections during UNDERRUN handling.
...
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index c0cf4acda7de..a7b53be63367 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <linux/blkpg.h> | 47 | #include <linux/blkpg.h> |
48 | #include <linux/delay.h> | 48 | #include <linux/delay.h> |
49 | #include <linux/mutex.h> | 49 | #include <linux/mutex.h> |
50 | #include <linux/string_helpers.h> | ||
50 | #include <asm/uaccess.h> | 51 | #include <asm/uaccess.h> |
51 | 52 | ||
52 | #include <scsi/scsi.h> | 53 | #include <scsi/scsi.h> |
@@ -1433,27 +1434,21 @@ got_data: | |||
1433 | */ | 1434 | */ |
1434 | sector_size = 512; | 1435 | sector_size = 512; |
1435 | } | 1436 | } |
1437 | blk_queue_hardsect_size(sdp->request_queue, sector_size); | ||
1438 | |||
1436 | { | 1439 | { |
1437 | /* | 1440 | char cap_str_2[10], cap_str_10[10]; |
1438 | * The msdos fs needs to know the hardware sector size | 1441 | u64 sz = sdkp->capacity << ffz(~sector_size); |
1439 | * So I have created this table. See ll_rw_blk.c | ||
1440 | * Jacques Gelinas (Jacques@solucorp.qc.ca) | ||
1441 | */ | ||
1442 | int hard_sector = sector_size; | ||
1443 | sector_t sz = (sdkp->capacity/2) * (hard_sector/256); | ||
1444 | struct request_queue *queue = sdp->request_queue; | ||
1445 | sector_t mb = sz; | ||
1446 | 1442 | ||
1447 | blk_queue_hardsect_size(queue, hard_sector); | 1443 | string_get_size(sz, STRING_UNITS_2, cap_str_2, |
1448 | /* avoid 64-bit division on 32-bit platforms */ | 1444 | sizeof(cap_str_2)); |
1449 | sector_div(sz, 625); | 1445 | string_get_size(sz, STRING_UNITS_10, cap_str_10, |
1450 | mb -= sz - 974; | 1446 | sizeof(cap_str_10)); |
1451 | sector_div(mb, 1950); | ||
1452 | 1447 | ||
1453 | sd_printk(KERN_NOTICE, sdkp, | 1448 | sd_printk(KERN_NOTICE, sdkp, |
1454 | "%llu %d-byte hardware sectors (%llu MB)\n", | 1449 | "%llu %d-byte hardware sectors: (%s/%s)\n", |
1455 | (unsigned long long)sdkp->capacity, | 1450 | (unsigned long long)sdkp->capacity, |
1456 | hard_sector, (unsigned long long)mb); | 1451 | sector_size, cap_str_10, cap_str_2); |
1457 | } | 1452 | } |
1458 | 1453 | ||
1459 | /* Rescale capacity to 512-byte units */ | 1454 | /* Rescale capacity to 512-byte units */ |