summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-04-03 19:49:33 +0000
committerthompsa <thompsa@FreeBSD.org>2009-04-03 19:49:33 +0000
commit2d53d4304dcaee8f6902a0d91732115dc7c7ce3a (patch)
tree0976d91821464828b1352e8f198ba283b10ccff7 /sys/cam
parentfe5458f66537db2116edb0ad1cfa8b9da5fb1ba3 (diff)
downloadFreeBSD-src-2d53d4304dcaee8f6902a0d91732115dc7c7ce3a.zip
FreeBSD-src-2d53d4304dcaee8f6902a0d91732115dc7c7ce3a.tar.gz
Add interleaving root hold tokens from the CAM probe to disk_create and geom
provider tasting. This is needed for disk attachments that happen after threads are running in the boot process. Tested by: rnoland
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 08286db..2fe895c 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -5139,6 +5139,7 @@ xpt_find_device(struct cam_et *target, lun_id_t lun_id)
typedef struct {
union ccb *request_ccb;
struct ccb_pathinq *cpi;
+ struct root_hold_token *roothold;
int counter;
} xpt_scan_bus_info;
@@ -5201,6 +5202,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
}
scan_info->request_ccb = request_ccb;
scan_info->cpi = &work_ccb->cpi;
+ scan_info->roothold = root_mount_hold("CAM", M_NOWAIT);
/* Cache on our stack so we can work asynchronously */
max_target = scan_info->cpi->max_target;
@@ -5232,6 +5234,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);
+ root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_free_ccb(work_ccb);
@@ -5240,6 +5243,7 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
}
work_ccb = xpt_alloc_ccb_nowait();
if (work_ccb == NULL) {
+ root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
xpt_free_path(path);
request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
@@ -5353,6 +5357,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;
+ root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = CAM_REQ_CMP;
xpt_done(request_ccb);
@@ -5372,6 +5377,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;
+ root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_done(request_ccb);
OpenPOWER on IntegriCloud