Page MenuHomeFreeBSD

D32683.id97519.diff
No OneTemporary

D32683.id97519.diff

Index: sys/cam/cam_periph.c
===================================================================
--- sys/cam/cam_periph.c
+++ sys/cam/cam_periph.c
@@ -69,7 +69,8 @@
lun_id_t lun);
static u_int camperiphunit(struct periph_driver *p_drv,
path_id_t pathid, target_id_t target,
- lun_id_t lun);
+ lun_id_t lun,
+ const char *sn);
static void camperiphdone(struct cam_periph *periph,
union ccb *done_ccb);
static void camperiphfree(struct cam_periph *periph);
@@ -273,7 +274,8 @@
free(periph, M_CAMPERIPH);
return (CAM_REQ_INVALID);
}
- periph->unit_number = camperiphunit(*p_drv, path_id, target_id, lun_id);
+ periph->unit_number = camperiphunit(*p_drv, path_id, target_id, lun_id,
+ path->device->serial_num);
cur_periph = TAILQ_FIRST(&(*p_drv)->units);
while (cur_periph != NULL
&& cur_periph->unit_number < periph->unit_number)
@@ -582,7 +584,8 @@
if (newunit != dunit)
continue;
- if (resource_int_value(dname, dunit, "lun", &val) == 0 ||
+ if (resource_string_value(dname, dunit, "sn", &strval) == 0 ||
+ resource_int_value(dname, dunit, "lun", &val) == 0 ||
resource_int_value(dname, dunit, "target", &val) == 0 ||
resource_string_value(dname, dunit, "at", &strval) == 0)
break;
@@ -595,7 +598,7 @@
static u_int
camperiphunit(struct periph_driver *p_drv, path_id_t pathid,
- target_id_t target, lun_id_t lun)
+ target_id_t target, lun_id_t lun, const char *sn)
{
u_int unit;
int wired, i, val, dunit;
@@ -624,6 +627,11 @@
continue;
wired++;
}
+ if (resource_string_value(dname, dunit, "sn", &strval) == 0) {
+ if (sn == NULL || strcmp(strval, sn) != 0)
+ continue;
+ wired++;
+ }
if (wired != 0) {
unit = dunit;
break;

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 28, 12:22 PM (17 h, 41 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32277013
Default Alt Text
D32683.id97519.diff (1 KB)

Event Timeline