aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/device_handler/scsi_dh.c
AgeCommit message (Collapse)Author
2008-07-26[SCSI] scsi_dh: create lookup cacheHannes Reinecke
Create a cache of devices that are seen in a system. This will avoid the unnecessary traversal of the device list in the scsi_dh when there are multiple luns of a same type. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26[SCSI] scsi_dh: attach to hardware handler from dm-mpathHannes Reinecke
multipath keeps a separate device table which may be more current than the built-in one. So we should make sure to always call ->attach whenever a multipath map with hardware handler is instantiated. And we should call ->detach on removal, too. [sekharan: update as per comments from agk] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26[SCSI] scsi_dh: Add 'dh_state' sysfs attributeHannes Reinecke
Implement a 'dh_state' sdev attribute for dynamic device handler manipulation. A read on the attribute will return the name of the currently attached device handler or 'detached' if no handler is attached. The attribute allows the following strings to be written: - The name of the device handler to be attached if the state is 'detached'. - 'activate' to trigger path activation if a device handler is attached. - 'detach' to detach the currently attached device handler. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-07-26[SCSI] scsi_dh: Implement common device table handlingHannes Reinecke
Instead of having each and every driver implement its own device table scanning code we should rather implement a common routine and scan the device tables there. This allows us also to implement a general notifier chain callback for all device handler instead for one per handler. [sekharan: Fix rejections caused by conflicting bug fix] Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
2008-06-05[SCSI] scsi_dh: add infrastructure for SCSI Device HandlersChandra Seetharaman
Some of the storage devices (that can be accessed through multiple paths), do need some special handling for 1. Activating the passive path of the storage access. 2. Decode and handle the special sense codes returned by the devices. 3. Handle the I/Os being sent to the passive path, especially during the device probe time. when accessed through multiple paths. As of today this special device handling is done at the dm-multipath layer using dm-handlers. That works well for (1); for (2) to be handled at dm layer, scsi sense information need to be exported from SCSI to dm-layer, which is not very attractive; (3) cannot be done at all at the dm layer. Device handler has been moved to SCSI mainly to handle (2) and (3) properly. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>