PERFORCE change 116755 for review
Scott Long
scottl at FreeBSD.org
Wed Mar 28 18:03:57 UTC 2007
http://perforce.freebsd.org/chv.cgi?CH=116755
Change 116755 by scottl at scottl-x64 on 2007/03/28 18:03:15
Work around malloc locking constraints.
Affected files ...
.. //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#15 edit
Differences ...
==== //depot/projects/scottl-camlock/src/sys/cam/scsi/scsi_cd.c#15 (text+ko) ====
@@ -725,6 +725,7 @@
* WORM peripheral driver. WORM drives will also have the WORM
* driver attached to them.
*/
+ cam_periph_unlock(periph);
softc->disk = disk_alloc();
softc->disk->d_devstat = devstat_new_entry("cd",
periph->unit_number, 0,
@@ -740,6 +741,7 @@
softc->disk->d_drv1 = periph;
softc->disk->d_flags = 0;
disk_create(softc->disk, DISK_VERSION);
+ cam_periph_lock(periph);
/*
* Add an async callback so that we get
@@ -1358,7 +1360,8 @@
softc->changer->flags |= CHANGER_MANUAL_CALL;
cdrunchangerqueue(softc->changer);
} else
- tsleep(&softc->changer, PRIBIO, "cgticb", 0);
+ msleep(&softc->changer, periph->sim->mtx,
+ PRIBIO, "cgticb", 0);
}
}
return(cam_periph_getccb(periph, priority));
@@ -2885,8 +2888,11 @@
ccb = cdgetccb(periph, /* priority */ 1);
+ /* XXX Should be M_WAITOK */
rcap_buf = malloc(sizeof(struct scsi_read_capacity_data),
- M_TEMP, M_WAITOK);
+ M_TEMP, M_NOWAIT);
+ if (rcap_buf == NULL)
+ return (ENOMEM);
scsi_read_capacity(&ccb->csio,
/*retries*/ 1,
More information about the p4-projects
mailing list