From owner-svn-src-stable-7@FreeBSD.ORG Thu Apr 22 12:12:52 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E365106566B; Thu, 22 Apr 2010 12:12:52 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DB168FC12; Thu, 22 Apr 2010 12:12:52 +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 o3MCCqPt072629; Thu, 22 Apr 2010 12:12:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3MCCqtc072627; Thu, 22 Apr 2010 12:12:52 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201004221212.o3MCCqtc072627@svn.freebsd.org> From: Andriy Gapon Date: Thu, 22 Apr 2010 12:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207060 - stable/7/sys/cam/scsi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2010 12:12:52 -0000 Author: avg Date: Thu Apr 22 12:12:52 2010 New Revision: 207060 URL: http://svn.freebsd.org/changeset/base/207060 Log: MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and d_mediasize Note that there is a redundant assignment of d_maxsize. PR: kern/138789 Modified: stable/7/sys/cam/scsi/scsi_cd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_cd.c Thu Apr 22 11:46:42 2010 (r207059) +++ stable/7/sys/cam/scsi/scsi_cd.c Thu Apr 22 12:12:52 2010 (r207060) @@ -2773,8 +2773,12 @@ cdcheckmedia(struct cam_periph *periph) softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC); cdprevent(periph, PR_ALLOW); return (error); - } else + } else { softc->flags |= CD_FLAG_VALID_MEDIA; + softc->disk->d_sectorsize = softc->params.blksize; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * softc->params.disksize; + } /* * Now we check the table of contents. This (currently) is only @@ -2864,9 +2868,6 @@ cdcheckmedia(struct cam_periph *periph) softc->flags |= CD_FLAG_VALID_TOC; softc->disk->d_maxsize = DFLTPHYS; - softc->disk->d_sectorsize = softc->params.blksize; - softc->disk->d_mediasize = - (off_t)softc->params.blksize * softc->params.disksize; bailout: