summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-05-14 21:48:53 +0000
committerscottl <scottl@FreeBSD.org>2007-05-14 21:48:53 +0000
commitdf8de31591e57ce88e7c35716ba233b00c120316 (patch)
tree18031a3dbfa4e78431255febc9dd084cbe13f288 /sys/cam/cam_xpt.c
parentba2a70ab9b68b48d14ba24cbe6c5f447a2e94e2a (diff)
downloadFreeBSD-src-df8de31591e57ce88e7c35716ba233b00c120316.zip
FreeBSD-src-df8de31591e57ce88e7c35716ba233b00c120316.tar.gz
Eliminate the use of M_TEMP.
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index f3d3ab2..882ce61 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -1533,7 +1533,7 @@ xpt_init(void *dummy)
*/
xsoftc.xpt_config_hook =
(struct intr_config_hook *)malloc(sizeof(struct intr_config_hook),
- M_TEMP, M_NOWAIT | M_ZERO);
+ M_CAMXPT, M_NOWAIT | M_ZERO);
if (xsoftc.xpt_config_hook == NULL) {
printf("xpt_init: Cannot malloc config hook "
"- failing attach\n");
@@ -1542,7 +1542,7 @@ xpt_init(void *dummy)
xsoftc.xpt_config_hook->ich_func = xpt_config;
if (config_intrhook_establish(xsoftc.xpt_config_hook) != 0) {
- free (xsoftc.xpt_config_hook, M_TEMP);
+ free (xsoftc.xpt_config_hook, M_CAMXPT);
printf("xpt_init: config_intrhook_establish failed "
"- failing attach\n");
}
@@ -5243,7 +5243,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
/* Save some state for use while we probe for devices */
scan_info = (xpt_scan_bus_info *)
- malloc(sizeof(xpt_scan_bus_info), M_TEMP, M_NOWAIT);
+ malloc(sizeof(xpt_scan_bus_info), M_CAMXPT, M_NOWAIT);
scan_info->request_ccb = request_ccb;
scan_info->cpi = &work_ccb->cpi;
@@ -5277,7 +5277,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
printf("xpt_scan_bus: xpt_create_path failed"
" with status %#x, bus scan halted\n",
status);
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_free_ccb(work_ccb);
xpt_done(request_ccb);
@@ -5285,7 +5285,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
}
work_ccb = xpt_alloc_ccb_nowait();
if (work_ccb == NULL) {
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
xpt_free_path(path);
request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
xpt_done(request_ccb);
@@ -5398,7 +5398,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
xpt_free_ccb(request_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = CAM_REQ_CMP;
xpt_done(request_ccb);
break;
@@ -5417,7 +5417,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
xpt_free_ccb(request_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
- free(scan_info, M_TEMP);
+ free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_done(request_ccb);
break;
@@ -5518,17 +5518,17 @@ xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
}
if (request_ccb == NULL) {
- request_ccb = malloc(sizeof(union ccb), M_TEMP, M_NOWAIT);
+ request_ccb = malloc(sizeof(union ccb), M_CAMXPT, M_NOWAIT);
if (request_ccb == NULL) {
xpt_print(path, "xpt_scan_lun: can't allocate CCB, "
"can't continue\n");
return;
}
- new_path = malloc(sizeof(*new_path), M_TEMP, M_NOWAIT);
+ new_path = malloc(sizeof(*new_path), M_CAMXPT, M_NOWAIT);
if (new_path == NULL) {
xpt_print(path, "xpt_scan_lun: can't allocate path, "
"can't continue\n");
- free(request_ccb, M_TEMP);
+ free(request_ccb, M_CAMXPT);
return;
}
status = xpt_compile_path(new_path, xpt_periph,
@@ -5539,8 +5539,8 @@ xpt_scan_lun(struct cam_periph *periph, struct cam_path *path,
if (status != CAM_REQ_CMP) {
xpt_print(path, "xpt_scan_lun: can't compile path, "
"can't continue\n");
- free(request_ccb, M_TEMP);
- free(new_path, M_TEMP);
+ free(request_ccb, M_CAMXPT);
+ free(new_path, M_CAMXPT);
return;
}
xpt_setup_ccb(&request_ccb->ccb_h, new_path, /*priority*/ 1);
@@ -5575,8 +5575,8 @@ static void
xptscandone(struct cam_periph *periph, union ccb *done_ccb)
{
xpt_release_path(done_ccb->ccb_h.path);
- free(done_ccb->ccb_h.path, M_TEMP);
- free(done_ccb, M_TEMP);
+ free(done_ccb->ccb_h.path, M_CAMXPT);
+ free(done_ccb, M_CAMXPT);
}
static cam_status
@@ -5598,7 +5598,7 @@ proberegister(struct cam_periph *periph, void *arg)
return(CAM_REQ_CMP_ERR);
}
- softc = (probe_softc *)malloc(sizeof(*softc), M_TEMP, M_NOWAIT);
+ softc = (probe_softc *)malloc(sizeof(*softc), M_CAMXPT, M_NOWAIT);
if (softc == NULL) {
printf("proberegister: Unable to probe new device. "
@@ -5751,7 +5751,7 @@ probestart(struct cam_periph *periph, union ccb *start_ccb)
if (softc->action == PROBE_INQUIRY_BASIC_DV1
|| softc->action == PROBE_INQUIRY_BASIC_DV2) {
- inq_buf = malloc(inquiry_len, M_TEMP, M_NOWAIT);
+ inq_buf = malloc(inquiry_len, M_CAMXPT, M_NOWAIT);
}
if (inq_buf == NULL) {
xpt_print(periph->path, "malloc failure- skipping Basic"
@@ -5785,7 +5785,7 @@ probestart(struct cam_periph *periph, union ccb *start_ccb)
mode_buf_len = sizeof(struct scsi_mode_header_6)
+ sizeof(struct scsi_mode_blk_desc)
+ sizeof(struct scsi_control_page);
- mode_buf = malloc(mode_buf_len, M_TEMP, M_NOWAIT);
+ mode_buf = malloc(mode_buf_len, M_CAMXPT, M_NOWAIT);
if (mode_buf != NULL) {
scsi_mode_sense(csio,
/*retries*/4,
@@ -5817,7 +5817,7 @@ probestart(struct cam_periph *periph, union ccb *start_ccb)
if ((device->quirk->quirks & CAM_QUIRK_NOSERIAL) == 0)
serial_buf = (struct scsi_vpd_unit_serial_number *)
- malloc(sizeof(*serial_buf), M_TEMP,
+ malloc(sizeof(*serial_buf), M_CAMXPT,
M_NOWAIT | M_ZERO);
if (serial_buf != NULL) {
@@ -6107,7 +6107,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
/*count*/1, /*run_queue*/TRUE);
}
xpt_release_ccb(done_ccb);
- free(mode_hdr, M_TEMP);
+ free(mode_hdr, M_CAMXPT);
softc->action = PROBE_SERIAL_NUM;
xpt_schedule(periph, priority);
return;
@@ -6194,7 +6194,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
xpt_async(AC_LOST_DEVICE, path, NULL);
}
if (serial_buf != NULL)
- free(serial_buf, M_TEMP);
+ free(serial_buf, M_CAMXPT);
if (changed != 0) {
/*
@@ -6283,12 +6283,12 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
/* give up */
softc->action = PROBE_DV_EXIT;
}
- free(nbuf, M_TEMP);
+ free(nbuf, M_CAMXPT);
xpt_release_ccb(done_ccb);
xpt_schedule(periph, priority);
return;
}
- free(nbuf, M_TEMP);
+ free(nbuf, M_CAMXPT);
if (softc->action == PROBE_INQUIRY_BASIC_DV1) {
softc->action = PROBE_INQUIRY_BASIC_DV2;
xpt_release_ccb(done_ccb);
@@ -6327,7 +6327,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb)
static void
probecleanup(struct cam_periph *periph)
{
- free(periph->softc, M_TEMP);
+ free(periph->softc, M_CAMXPT);
}
static void
@@ -6984,7 +6984,7 @@ xpt_finishconfig_task(void *context, int pending)
/* Release our hook so that the boot can continue. */
config_intrhook_disestablish(xsoftc.xpt_config_hook);
- free(xsoftc.xpt_config_hook, M_TEMP);
+ free(xsoftc.xpt_config_hook, M_CAMXPT);
xsoftc.xpt_config_hook = NULL;
}
OpenPOWER on IntegriCloud