Date: Thu, 24 Dec 2009 21:54:45 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r200969 - head/sys/cam/ata Message-ID: <200912242154.nBOLsjpV042325@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Thu Dec 24 21:54:44 2009 New Revision: 200969 URL: http://svn.freebsd.org/changeset/base/200969 Log: Report stripe size only if physical sector size is not equal to logical. Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Thu Dec 24 21:39:30 2009 (r200968) +++ head/sys/cam/ata/ata_da.c Thu Dec 24 21:54:44 2009 (r200969) @@ -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?200912242154.nBOLsjpV042325>