Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-doc
Path: blob/main/website/static/security/patches/EN-14:05/ciss.patch
18096 views
1
Index: sys/dev/ciss/ciss.c
2
===================================================================
3
--- sys/dev/ciss/ciss.c (revision 264510)
4
+++ sys/dev/ciss/ciss.c (revision 264511)
5
@@ -180,8 +180,6 @@
6
static void ciss_cam_poll(struct cam_sim *sim);
7
static void ciss_cam_complete(struct ciss_request *cr);
8
static void ciss_cam_complete_fixup(struct ciss_softc *sc, struct ccb_scsiio *csio);
9
-static struct cam_periph *ciss_find_periph(struct ciss_softc *sc,
10
- int bus, int target);
11
static int ciss_name_device(struct ciss_softc *sc, int bus, int target);
12
13
/* periodic status monitoring */
14
@@ -3398,27 +3396,6 @@
15
16
17
/********************************************************************************
18
- * Find a peripheral attached at (target)
19
- */
20
-static struct cam_periph *
21
-ciss_find_periph(struct ciss_softc *sc, int bus, int target)
22
-{
23
- struct cam_periph *periph;
24
- struct cam_path *path;
25
- int status;
26
-
27
- status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]),
28
- target, 0);
29
- if (status == CAM_REQ_CMP) {
30
- periph = cam_periph_find(path, NULL);
31
- xpt_free_path(path);
32
- } else {
33
- periph = NULL;
34
- }
35
- return(periph);
36
-}
37
-
38
-/********************************************************************************
39
* Name the device at (target)
40
*
41
* XXX is this strictly correct?
42
@@ -3427,12 +3404,22 @@
43
ciss_name_device(struct ciss_softc *sc, int bus, int target)
44
{
45
struct cam_periph *periph;
46
+ struct cam_path *path;
47
+ int status;
48
49
if (CISS_IS_PHYSICAL(bus))
50
return (0);
51
- if ((periph = ciss_find_periph(sc, bus, target)) != NULL) {
52
+
53
+ status = xpt_create_path(&path, NULL, cam_sim_path(sc->ciss_cam_sim[bus]),
54
+ target, 0);
55
+
56
+ if (status == CAM_REQ_CMP) {
57
+ mtx_lock(&sc->ciss_mtx);
58
+ periph = cam_periph_find(path, NULL);
59
sprintf(sc->ciss_logical[bus][target].cl_name, "%s%d",
60
periph->periph_name, periph->unit_number);
61
+ mtx_unlock(&sc->ciss_mtx);
62
+ xpt_free_path(path);
63
return(0);
64
}
65
sc->ciss_logical[bus][target].cl_name[0] = 0;
66
67