svn commit: r201586 - stable/8/sys/cam/ata
Alexander Motin
mav at FreeBSD.org
Tue Jan 5 13:58:18 UTC 2010
Author: mav
Date: Tue Jan 5 13:58:18 2010
New Revision: 201586
URL: http://svn.freebsd.org/changeset/base/201586
Log:
MFC 200969:
Report stripe size only if physical sector size is not equal to logical.
Modified:
stable/8/sys/cam/ata/ata_da.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/cam/ata/ata_da.c
==============================================================================
--- stable/8/sys/cam/ata/ata_da.c Tue Jan 5 13:56:58 2010 (r201585)
+++ stable/8/sys/cam/ata/ata_da.c Tue Jan 5 13:58:18 2010 (r201586)
@@ -687,9 +687,14 @@ adaregister(struct cam_periph *periph, v
softc->disk->d_sectorsize = softc->params.secsize;
softc->disk->d_mediasize = (off_t)softc->params.sectors *
softc->params.secsize;
- softc->disk->d_stripesize = ata_physical_sector_size(&cgd->ident_data);
- softc->disk->d_stripeoffset = softc->disk->d_stripesize -
- ata_logical_sector_offset(&cgd->ident_data);
+ if (ata_physical_sector_size(&cgd->ident_data) !=
+ softc->params.secsize) {
+ softc->disk->d_stripesize =
+ ata_physical_sector_size(&cgd->ident_data);
+ softc->disk->d_stripeoffset = (softc->disk->d_stripesize -
+ ata_logical_sector_offset(&cgd->ident_data)) %
+ softc->disk->d_stripesize;
+ }
/* XXX: these are not actually "firmware" values, so they may be wrong */
softc->disk->d_fwsectors = softc->params.secs_per_track;
softc->disk->d_fwheads = softc->params.heads;
More information about the svn-src-stable
mailing list