diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-11 21:15:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-11 21:15:18 -0400 |
commit | 8e78b7dc93c580c050435b0f88991c26e02166bc (patch) | |
tree | 3356cfe6423b049f2f4852bffb5a6324b0556dc1 /include/scsi | |
parent | 06a660ada2064bbdcd09aeb8173f2ad128c71978 (diff) | |
parent | 294ab783ad98066b87296db1311c7ba2a60206a5 (diff) |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull second round of SCSI updates from James Bottomley:
"There's one late arriving patch here (added today), fixing a build
issue which the scsi_dh patch set in here uncovered. Other than that,
everything has been incubated in -next and the checkers for a week.
The major pieces of this patch are a set patches facilitating better
integration between scsi and scsi_dh (the device handling layer used
by multi-path; all the dm parts are acked by Mike Snitzer).
This also includes driver updates for mp3sas, scsi_debug and an
assortment of bug fixes"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (50 commits)
scsi_dh: fix randconfig build error
scsi: fix scsi_error_handler vs. scsi_host_dev_release race
fcoe: Convert use of __constant_htons to htons
mpt2sas: setpci reset kernel oops fix
pm80xx: Don't override ts->stat on IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY
lpfc: Fix possible use-after-free and double free in lpfc_mbx_cmpl_rdp_page_a2()
bfa: Fix incorrect de-reference of pointer
bfa: Fix indentation
scsi_transport_sas: Remove check for SAS expander when querying bay/enclosure IDs.
scsi_debug: resp_request: remove unused variable
scsi_debug: fix REPORT LUNS Well Known LU
scsi_debug: schedule_resp fix input variable check
scsi_debug: make dump_sector static
scsi_debug: vfree is null safe so drop the check
scsi_debug: use SCSI_W_LUN_REPORT_LUNS instead of SAM2_WLUN_REPORT_LUNS;
scsi_debug: define pr_fmt() for consistent logging
mpt2sas: Refcount fw_events and fix unsafe list usage
mpt2sas: Refcount sas_device objects and fix unsafe list usage
scsi_dh: return SCSI_DH_NOTCONN in scsi_dh_activate()
scsi_dh: don't allow to detach device handlers at runtime
...
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/scsi_device.h | 27 | ||||
-rw-r--r-- | include/scsi/scsi_dh.h | 29 |
2 files changed, 21 insertions, 35 deletions
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 50c2a363bc8f..fe89d7cd67b9 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -196,34 +196,13 @@ struct scsi_device { | |||
196 | struct execute_work ew; /* used to get process context on put */ | 196 | struct execute_work ew; /* used to get process context on put */ |
197 | struct work_struct requeue_work; | 197 | struct work_struct requeue_work; |
198 | 198 | ||
199 | struct scsi_dh_data *scsi_dh_data; | 199 | struct scsi_device_handler *handler; |
200 | void *handler_data; | ||
201 | |||
200 | enum scsi_device_state sdev_state; | 202 | enum scsi_device_state sdev_state; |
201 | unsigned long sdev_data[0]; | 203 | unsigned long sdev_data[0]; |
202 | } __attribute__((aligned(sizeof(unsigned long)))); | 204 | } __attribute__((aligned(sizeof(unsigned long)))); |
203 | 205 | ||
204 | typedef void (*activate_complete)(void *, int); | ||
205 | struct scsi_device_handler { | ||
206 | /* Used by the infrastructure */ | ||
207 | struct list_head list; /* list of scsi_device_handlers */ | ||
208 | |||
209 | /* Filled by the hardware handler */ | ||
210 | struct module *module; | ||
211 | const char *name; | ||
212 | int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); | ||
213 | struct scsi_dh_data *(*attach)(struct scsi_device *); | ||
214 | void (*detach)(struct scsi_device *); | ||
215 | int (*activate)(struct scsi_device *, activate_complete, void *); | ||
216 | int (*prep_fn)(struct scsi_device *, struct request *); | ||
217 | int (*set_params)(struct scsi_device *, const char *); | ||
218 | bool (*match)(struct scsi_device *); | ||
219 | }; | ||
220 | |||
221 | struct scsi_dh_data { | ||
222 | struct scsi_device_handler *scsi_dh; | ||
223 | struct scsi_device *sdev; | ||
224 | struct kref kref; | ||
225 | }; | ||
226 | |||
227 | #define to_scsi_device(d) \ | 206 | #define to_scsi_device(d) \ |
228 | container_of(d, struct scsi_device, sdev_gendev) | 207 | container_of(d, struct scsi_device, sdev_gendev) |
229 | #define class_to_sdev(d) \ | 208 | #define class_to_sdev(d) \ |
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h index 620c723ee8ed..85d731746834 100644 --- a/include/scsi/scsi_dh.h +++ b/include/scsi/scsi_dh.h | |||
@@ -55,11 +55,26 @@ enum { | |||
55 | SCSI_DH_NOSYS, | 55 | SCSI_DH_NOSYS, |
56 | SCSI_DH_DRIVER_MAX, | 56 | SCSI_DH_DRIVER_MAX, |
57 | }; | 57 | }; |
58 | #if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE) | 58 | |
59 | typedef void (*activate_complete)(void *, int); | ||
60 | struct scsi_device_handler { | ||
61 | /* Used by the infrastructure */ | ||
62 | struct list_head list; /* list of scsi_device_handlers */ | ||
63 | |||
64 | /* Filled by the hardware handler */ | ||
65 | struct module *module; | ||
66 | const char *name; | ||
67 | int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); | ||
68 | int (*attach)(struct scsi_device *); | ||
69 | void (*detach)(struct scsi_device *); | ||
70 | int (*activate)(struct scsi_device *, activate_complete, void *); | ||
71 | int (*prep_fn)(struct scsi_device *, struct request *); | ||
72 | int (*set_params)(struct scsi_device *, const char *); | ||
73 | }; | ||
74 | |||
75 | #ifdef CONFIG_SCSI_DH | ||
59 | extern int scsi_dh_activate(struct request_queue *, activate_complete, void *); | 76 | extern int scsi_dh_activate(struct request_queue *, activate_complete, void *); |
60 | extern int scsi_dh_handler_exist(const char *); | ||
61 | extern int scsi_dh_attach(struct request_queue *, const char *); | 77 | extern int scsi_dh_attach(struct request_queue *, const char *); |
62 | extern void scsi_dh_detach(struct request_queue *); | ||
63 | extern const char *scsi_dh_attached_handler_name(struct request_queue *, gfp_t); | 78 | extern const char *scsi_dh_attached_handler_name(struct request_queue *, gfp_t); |
64 | extern int scsi_dh_set_params(struct request_queue *, const char *); | 79 | extern int scsi_dh_set_params(struct request_queue *, const char *); |
65 | #else | 80 | #else |
@@ -69,18 +84,10 @@ static inline int scsi_dh_activate(struct request_queue *req, | |||
69 | fn(data, 0); | 84 | fn(data, 0); |
70 | return 0; | 85 | return 0; |
71 | } | 86 | } |
72 | static inline int scsi_dh_handler_exist(const char *name) | ||
73 | { | ||
74 | return 0; | ||
75 | } | ||
76 | static inline int scsi_dh_attach(struct request_queue *req, const char *name) | 87 | static inline int scsi_dh_attach(struct request_queue *req, const char *name) |
77 | { | 88 | { |
78 | return SCSI_DH_NOSYS; | 89 | return SCSI_DH_NOSYS; |
79 | } | 90 | } |
80 | static inline void scsi_dh_detach(struct request_queue *q) | ||
81 | { | ||
82 | return; | ||
83 | } | ||
84 | static inline const char *scsi_dh_attached_handler_name(struct request_queue *q, | 91 | static inline const char *scsi_dh_attached_handler_name(struct request_queue *q, |
85 | gfp_t gfp) | 92 | gfp_t gfp) |
86 | { | 93 | { |