PERFORCE change 171412 for review
Alexander Motin
mav at FreeBSD.org
Sat Dec 5 16:12:22 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=171412
Change 171412 by mav at 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;
More information about the p4-projects
mailing list