Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Jan 2010 13:58:18 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r201586 - stable/8/sys/cam/ata
Message-ID:  <201001051358.o05DwII0016559@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001051358.o05DwII0016559>