Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Dec 2009 16:12:21 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 171412 for review
Message-ID:  <200912051612.nB5GCL5k039050@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=171412

Change 171412 by mav@mav_mavtest on 2009/12/05 16:11:46

	Use controller advertized maximum transaction size, same as for da.

Affected files ...

.. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#31 edit

Differences ...

==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#31 (text+ko) ====

@@ -726,6 +726,12 @@
 	softc->disk->d_name = "cd";
 	softc->disk->d_unit = periph->unit_number;
 	softc->disk->d_drv1 = periph;
+	if (cpi.maxio == 0)
+		softc->disk->d_maxsize = DFLTPHYS;	/* traditional default */
+	else if (cpi.maxio > MAXPHYS)
+		softc->disk->d_maxsize = MAXPHYS;	/* for safety */
+	else
+		softc->disk->d_maxsize = cpi.maxio;
 	softc->disk->d_flags = 0;
 	disk_create(softc->disk, DISK_VERSION);
 	cam_periph_lock(periph);
@@ -2768,7 +2774,6 @@
 	softc = (struct cd_softc *)periph->softc;
 
 	cdprevent(periph, PR_PREVENT);
-	softc->disk->d_maxsize = DFLTPHYS;
 	softc->disk->d_sectorsize = 2048;
 	softc->disk->d_mediasize = 0;
 
@@ -2870,7 +2875,6 @@
 	}
 
 	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;



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