Make sbp(4) use xpt_alloc_ccb/xpt_free_ccb instead of malloc/free.
Reviewed by: imp, mav MFC after: 2 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26843
This commit is contained in:
parent
cca5be248f
commit
6f45fadf5a
@ -987,7 +987,7 @@ END_DEBUG
|
|||||||
sdev = sbp_next_dev(target, sdev->lun_id + 1);
|
sdev = sbp_next_dev(target, sdev->lun_id + 1);
|
||||||
if (sdev == NULL) {
|
if (sdev == NULL) {
|
||||||
SBP_UNLOCK(sbp);
|
SBP_UNLOCK(sbp);
|
||||||
free(ccb, M_SBP);
|
xpt_free_ccb(ccb);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* reuse ccb */
|
/* reuse ccb */
|
||||||
@ -1019,9 +1019,9 @@ SBP_DEBUG(0)
|
|||||||
device_printf(sdev->target->sbp->fd.dev,
|
device_printf(sdev->target->sbp->fd.dev,
|
||||||
"%s:%s\n", __func__, sdev->bustgtlun);
|
"%s:%s\n", __func__, sdev->bustgtlun);
|
||||||
END_DEBUG
|
END_DEBUG
|
||||||
ccb = malloc(sizeof(union ccb), M_SBP, M_NOWAIT | M_ZERO);
|
ccb = xpt_alloc_ccb_nowait();
|
||||||
if (ccb == NULL) {
|
if (ccb == NULL) {
|
||||||
printf("sbp_cam_scan_target: malloc failed\n");
|
printf("sbp_cam_scan_target: xpt_alloc_ccb_nowait() failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SBP_UNLOCK(target->sbp);
|
SBP_UNLOCK(target->sbp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user