From owner-svn-src-all@FreeBSD.ORG Thu Dec 24 21:54:45 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311E2106566C; Thu, 24 Dec 2009 21:54:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 209968FC13; Thu, 24 Dec 2009 21:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBOLsjMJ042327; Thu, 24 Dec 2009 21:54:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBOLsjpV042325; Thu, 24 Dec 2009 21:54:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200912242154.nBOLsjpV042325@svn.freebsd.org> From: Alexander Motin Date: Thu, 24 Dec 2009 21:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200969 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2009 21:54:45 -0000 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;