aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/scsi/scsi_da.c
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2007-05-14 21:48:53 +0000
committerScott Long <scottl@FreeBSD.org>2007-05-14 21:48:53 +0000
commit0dd50e9b5ecd1d7c7c4b282544a9727b96fad77a (patch)
tree18031a3dbfa4e78431255febc9dd084cbe13f288 /sys/cam/scsi/scsi_da.c
parentc918e9f747da6aff686013b68a4fef6e8966438c (diff)
downloadsrc-0dd50e9b5ecd1d7c7c4b282544a9727b96fad77a.tar.gz
src-0dd50e9b5ecd1d7c7c4b282544a9727b96fad77a.zip
Eliminate the use of M_TEMP.
Notes
Notes: svn path=/head/; revision=169562
Diffstat (limited to 'sys/cam/scsi/scsi_da.c')
-rw-r--r--sys/cam/scsi/scsi_da.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 19053de3acb0..f234290d4f9e 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -548,6 +548,8 @@ static struct periph_driver dadriver =
PERIPHDRIVER_DECLARE(da, dadriver);
+MALLOC_DEFINE(M_SCSIDA, "scsi_da", "scsi_da buffers");
+
static int
daopen(struct disk *dp)
{
@@ -1329,7 +1331,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
struct scsi_read_capacity_data *rcap;
rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcap),
- M_TEMP,
+ M_SCSIDA,
M_NOWAIT);
if (rcap == NULL) {
printf("dastart: Couldn't malloc read_capacity data\n");
@@ -1355,7 +1357,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb)
struct scsi_read_capacity_data_long *rcaplong;
rcaplong = (struct scsi_read_capacity_data_long *)
- malloc(sizeof(*rcaplong), M_TEMP, M_NOWAIT);
+ malloc(sizeof(*rcaplong), M_SCSIDA, M_NOWAIT);
if (rcaplong == NULL) {
printf("dastart: Couldn't malloc read_capacity data\n");
/* da_free_periph??? */
@@ -1547,7 +1549,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
*/
if (maxsector == 0xffffffff) {
softc->state = DA_STATE_PROBE2;
- free(rdcap, M_TEMP);
+ free(rdcap, M_SCSIDA);
xpt_release_ccb(done_ccb);
xpt_schedule(periph, /*priority*/5);
return;
@@ -1675,7 +1677,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
}
}
}
- free(csio->data_ptr, M_TEMP);
+ free(csio->data_ptr, M_SCSIDA);
if (announce_buf[0] != '\0') {
xpt_announce_periph(periph, announce_buf);
/*
@@ -1816,7 +1818,7 @@ dagetcapacity(struct cam_periph *periph)
/* Do a read capacity */
rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcaplong),
- M_TEMP,
+ M_SCSIDA,
M_NOWAIT);
if (rcap == NULL)
return (ENOMEM);
@@ -1890,7 +1892,7 @@ done:
xpt_release_ccb(ccb);
- free(rcap, M_TEMP);
+ free(rcap, M_SCSIDA);
return (error);
}