s390 (8/10): zfcp fixes.
Subsystems (3)
PATCH 1/1 s390 (8/10): zfcp fixes.
zfcp host adapter fixes:
- Reuse freed scsi_ids and scsi_luns for mappings.
- Order list of ports/units by assigned scsi_id/scsi_lun.
- Don't update max_id/max_lun in scsi_host anymore.
- Get rid of all magics.
- Add owner field to ccw_driver structure.
- Replace release function for device structures by kfree. Move struct device to the start of struct zfcp_port/zfcp_unit to make it work.
- Avoid deadlock on bus->subsys.rwsem.
- Use a macro for all scsi device sysfs attributes.
- Change proc_name from "dummy" to "zfcp".
- Don't wait for scsi_add_device to complete while holding a semaphore.
- Cleanup include files in zfcp_aux.c & zfcp_def.h.
- Get rid of zfcp_erp_fsf_req_handler.
diffstat:
drivers/s390/scsi/zfcp_aux.c | 191 ++++++++------------------------- drivers/s390/scsi/zfcp_ccw.c | 14 -- drivers/s390/scsi/zfcp_def.h | 44 +++---- drivers/s390/scsi/zfcp_erp.c | 26 ---- drivers/s390/scsi/zfcp_ext.h | 6 - drivers/s390/scsi/zfcp_fsf.c | 185 +++++++++++++++++-------------- drivers/s390/scsi/zfcp_fsf.h | 12 +- drivers/s390/scsi/zfcp_qdio.c | 15 -- drivers/s390/scsi/zfcp_scsi.c | 98 +++++----------- drivers/s390/scsi/zfcp_sysfs_adapter.c | 31 ----- drivers/s390/scsi/zfcp_sysfs_port.c | 20 --- drivers/s390/scsi/zfcp_sysfs_unit.c | 16 -- 12 files changed, 236 insertions(+), 422 deletions(-)
drivers/s390/scsi/zfcp_aux.c +52 -139
@@ -29,43 +29,10 @@*/ /* this drivers version (do not edit !!! generated and updated by cvs) */ -#define ZFCP_AUX_REVISION "$Revision: 1.98 $" - -/********************** INCLUDES *********************************************/ - -#include <linux/init.h> -#include <linux/config.h> -#include <linux/kernel.h> -#include <linux/string.h> -#include <linux/errno.h> -#include <linux/ctype.h> -#include <linux/mm.h> -#include <linux/timer.h> -#include <linux/delay.h> -#include <linux/slab.h> -#include <linux/version.h> -#include <linux/list.h> -#include <linux/interrupt.h> -#include <linux/init.h> -#include <linux/proc_fs.h> -#include <linux/time.h> -#include <linux/module.h> -#include <linux/moduleparam.h> -#include <linux/workqueue.h> -#include <linux/syscalls.h> +#define ZFCP_AUX_REVISION "$Revision: 1.103 $"#include "zfcp_ext.h" -#include <asm/semaphore.h> -#include <asm/io.h> -#include <asm/irq.h> -#include <asm/ebcdic.h> -#include <asm/cpcmd.h> /* Debugging only */ -#include <asm/processor.h> /* Debugging only */ - -#include <linux/miscdevice.h> -#include <linux/major.h> -/* accumulated log level (module parameter) */ static u32 loglevel =ZFCP_LOG_LEVEL_DEFAULTS ;static char *device;
@@ -421,8 +388,8 @@ goto out_unit;up (&zfcp_data.config_sema);ccw_device_set_online (adapter->ccw_device); -down (&zfcp_data.config_sema);wait_event (unit->scsi_add_wq,atomic_read (&unit->scsi_add_work) ==0 ); +down (&zfcp_data.config_sema);zfcp_unit_put (unit); out_unit:zfcp_port_put (port);
@@ -978,7 +945,9 @@struct zfcp_unit *zfcp_unit_enqueue (struct zfcp_port *port,fcp_lun_t fcp_lun) { -struct zfcp_unit *unit; +struct zfcp_unit *unit, *tmp_unit; +scsi_lun_t scsi_lun; +int found;/* * check that there is no unit with this FCP_LUN already in list
@@ -1002,18 +971,12 @@init_waitqueue_head (&unit->remove_wq); unit->port = port; -/* -* FIXME: reuse of scsi_luns! -*/ - unit->scsi_lun = port->max_scsi_lun +1 ; unit->fcp_lun = fcp_lun; - unit->common_magic =ZFCP_MAGIC ; - unit->specific_magic =ZFCP_MAGIC_UNIT ;/* setup for sysfs registration */ snprintf (unit->sysfs_device.bus_id,BUS_ID_SIZE ,"0x%016llx" , fcp_lun); unit->sysfs_device.parent = &port->sysfs_device; - unit->sysfs_device.release = zfcp_sysfs_unit_release; + unit->sysfs_device.release = (void (*)(struct device *))kfree;dev_set_drvdata (&unit->sysfs_device, unit);/* mark unit unusable as long as sysfs registration is not complete */
@@ -1025,43 +988,29 @@ }if (zfcp_sysfs_unit_create_files (&unit->sysfs_device)) { -/* -* failed to create all sysfs attributes, therefore the unit -* must be put on the unit_remove listhead of the port where -* the release function expects it. -*/ -write_lock_irq (&zfcp_data.config_lock); -list_add_tail (&unit->list, &port->unit_remove_lh); -write_unlock_irq (&zfcp_data.config_lock);device_unregister (&unit->sysfs_device);return NULL ; } -/* -* update max SCSI LUN of logical units attached to parent remote port -*/ - port->max_scsi_lun++; - -/* -* update max SCSI LUN of logical units attached to parent adapter -*/ -if (port->adapter->max_scsi_lun < port->max_scsi_lun) - port->adapter->max_scsi_lun = port->max_scsi_lun; - -/* -* update max SCSI LUN of logical units attached to host (SCSI stack) -*/ -if (port->adapter->scsi_host && - (port->adapter->scsi_host->max_lun < port->max_scsi_lun)) - port->adapter->scsi_host->max_lun = port->max_scsi_lun +1 ; -zfcp_unit_get (unit); -/* unit is new and needs to be added to list */ + scsi_lun =0 ; + found =0 ;write_lock_irq (&zfcp_data.config_lock); +list_for_each_entry (tmp_unit, &port->unit_list_head, list) { +if (tmp_unit->scsi_lun != scsi_lun) { + found =1 ; +break ; + } + scsi_lun++; + } + unit->scsi_lun = scsi_lun; +if (found) +list_add_tail (&unit->list, &tmp_unit->list); +else +list_add_tail (&unit->list, &port->unit_list_head);atomic_clear_mask (ZFCP_STATUS_COMMON_REMOVE , &unit->status);atomic_set_mask (ZFCP_STATUS_COMMON_RUNNING , &unit->status); -list_add_tail (&unit->list, &port->unit_list_head);write_unlock_irq (&zfcp_data.config_lock); port->units++;
@@ -1070,21 +1019,17 @@return unit; } -/* locks: config_sema must be held */ void zfcp_unit_dequeue (struct zfcp_unit *unit) { -/* remove specified unit data structure from list */ +zfcp_unit_wait (unit);write_lock_irq (&zfcp_data.config_lock);list_del (&unit->list);write_unlock_irq (&zfcp_data.config_lock); - unit->port->units--;zfcp_port_put (unit->port); - -kfree (unit); - -return ; +zfcp_sysfs_unit_remove_files (&unit->sysfs_device); +device_unregister (&unit->sysfs_device); } static void *
@@ -1154,7 +1099,7 @@ adapter->pool.data_status_read =mempool_create (ZFCP_POOL_STATUS_READ_NR , - zfcp_mempool_alloc, zfcp_mempool_free, + zfcp_mempool_alloc, zfcp_mempool_free, (void *)sizeof (struct fsf_status_read_buffer ));if (NULL == adapter->pool.data_status_read) {
@@ -1246,10 +1191,6 @@if (retval) goto failed_low_mem_buffers; -/* set magics */ - adapter->common_magic =ZFCP_MAGIC ; - adapter->specific_magic =ZFCP_MAGIC_ADAPTER ; -/* initialise reference count stuff */ atomic_set (&adapter->refcount,0 );init_waitqueue_head (&adapter->remove_wq);
@@ -1515,25 +1456,20 @@ }/* -* Enqueues a remote port at the end of the port list. -* All port internal structures are set-up and the proc-fs entry is also -* allocated. Some SCSI-stack structures are modified for the port. +* Enqueues a remote port to the port list. All port internal structures +* are set up and the sysfs entry is also generated. * -* returns: 0 if a new port was successfully enqueued -* ZFCP_KNOWN if a port with the requested wwpn already exists -* -ENOMEM if allocation failed -* -EINVAL if at least one of the specified parameters was wrong +* returns: pointer to port or NULL * locks: config_sema must be held to serialise changes to the port list -* within this function (must not be held on entry) */ struct zfcp_port *zfcp_port_enqueue (struct zfcp_adapter *adapter,wwn_t wwpn,u32 status) { -struct zfcp_port *port; -int check_scsi_id; +struct zfcp_port *port, *tmp_port;int check_wwpn; +scsi_id_t scsi_id; +int found; - check_scsi_id = !(status &ZFCP_STATUS_PORT_NO_SCSI_ID ); check_wwpn = !(status &ZFCP_STATUS_PORT_NO_WWPN );/*
@@ -1561,17 +1497,11 @@ port->adapter = adapter; -if (check_scsi_id) - port->scsi_id = adapter->max_scsi_id +1 ; -if (check_wwpn) port->wwpn = wwpn;atomic_set_mask (status, &port->status); - port->common_magic =ZFCP_MAGIC ; - port->specific_magic =ZFCP_MAGIC_PORT ; -/* setup for sysfs registration */ if (status &ZFCP_STATUS_PORT_NAMESERVER )snprintf (port->sysfs_device.bus_id,BUS_ID_SIZE ,"nameserver" );
@@ -1579,7 +1509,7 @@snprintf (port->sysfs_device.bus_id,BUS_ID_SIZE ,"0x%016llx" , wwpn); port->sysfs_device.parent = &adapter->ccw_device->dev; - port->sysfs_device.release = zfcp_sysfs_port_release; + port->sysfs_device.release = (void (*)(struct device *))kfree;dev_set_drvdata (&port->sysfs_device, port);/* mark port unusable as long as sysfs registration is not complete */
@@ -1591,41 +1521,32 @@ }if (zfcp_sysfs_port_create_files (&port->sysfs_device, status)) { -/* -* failed to create all sysfs attributes, therefore the port -* must be put on the port_remove listhead of the adapter -* where the release function expects it. -*/ -write_lock_irq (&zfcp_data.config_lock); -list_add_tail (&port->list, &adapter->port_remove_lh); -write_unlock_irq (&zfcp_data.config_lock);device_unregister (&port->sysfs_device);return NULL ; } -if (check_scsi_id) { -/* -* update max. SCSI ID of remote ports attached to -* "parent" adapter if necessary -* (do not care about the adapters own SCSI ID) -*/ - adapter->max_scsi_id++; - -/* -* update max. SCSI ID of remote ports attached to -* "parent" host (SCSI stack) if necessary -*/ -if (adapter->scsi_host && - (adapter->scsi_host->max_id < adapter->max_scsi_id +1 )) - adapter->scsi_host->max_id = adapter->max_scsi_id +1 ; - } -zfcp_port_get (port); + scsi_id =1 ; + found =0 ;write_lock_irq (&zfcp_data.config_lock); +list_for_each_entry (tmp_port, &adapter->port_list_head, list) { +if (atomic_test_mask (ZFCP_STATUS_PORT_NO_SCSI_ID , + &tmp_port->status)) +continue ; +if (tmp_port->scsi_id != scsi_id) { + found =1 ; +break ; + } + scsi_id++; + } + port->scsi_id = scsi_id; +if (found) +list_add_tail (&port->list, &tmp_port->list); +else +list_add_tail (&port->list, &adapter->port_list_head);atomic_clear_mask (ZFCP_STATUS_COMMON_REMOVE , &port->status);atomic_set_mask (ZFCP_STATUS_COMMON_RUNNING , &port->status); -list_add_tail (&port->list, &adapter->port_list_head);write_unlock_irq (&zfcp_data.config_lock); adapter->ports++;
@@ -1634,26 +1555,18 @@return port; } -/* -* returns: 0 - struct zfcp_port data structure successfully removed -* !0 - struct zfcp_port data structure could not be removed -* (e.g. still used) -* locks : port list write lock is assumed to be held by caller -*/ void zfcp_port_dequeue (struct zfcp_port *port) { -/* remove specified port from list */ +zfcp_port_wait (port);write_lock_irq (&zfcp_data.config_lock);list_del (&port->list);write_unlock_irq (&zfcp_data.config_lock); - port->adapter->ports--;zfcp_adapter_put (port->adapter); - -kfree (port); - -return ; +zfcp_sysfs_port_remove_files (&port->sysfs_device, +atomic_read (&port->status)); +device_unregister (&port->sysfs_device); }/* Enqueues a nameserver port */
drivers/s390/scsi/zfcp_ccw.c +5 -9
@@ -26,7 +26,7 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define ZFCP_CCW_C_REVISION "$Revision: 1.48 $" +#define ZFCP_CCW_C_REVISION "$Revision: 1.51 $"#include <linux/init.h> #include <linux/module.h>
@@ -55,6 +55,7 @@ };static struct ccw_driver zfcp_ccw_driver = { + .owner =THIS_MODULE , .name =ZFCP_NAME , .ids = zfcp_ccw_device_id, .probe = zfcp_ccw_probe,
@@ -130,14 +131,9 @@list_for_each_entry_safe (port, p, &adapter->port_remove_lh, list) {list_for_each_entry_safe (unit, u, &port->unit_remove_lh, list) { -zfcp_unit_wait (unit); -zfcp_sysfs_unit_remove_files (&unit->sysfs_device); -device_unregister (&unit->sysfs_device); +zfcp_unit_dequeue (unit); } -zfcp_port_wait (port); -zfcp_sysfs_port_remove_files (&port->sysfs_device, -atomic_read (&port->status)); -device_unregister (&port->sysfs_device); +zfcp_port_dequeue (port); }zfcp_adapter_wait (adapter);zfcp_adapter_dequeue (adapter);
@@ -163,7 +159,7 @@down (&zfcp_data.config_sema); adapter =dev_get_drvdata (&ccw_device->dev); - retval =zfcp_erp_thread_setup (adapter); + retval =zfcp_erp_thread_setup (adapter);if (retval) {ZFCP_LOG_INFO ("error: out of resources. " "error recovery thread for adapter %s "
drivers/s390/scsi/zfcp_def.h +20 -24
126 lines not on this page · raw message
drivers/s390/scsi/zfcp_erp.c +2 -24
@@ -31,7 +31,7 @@#define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP/* this drivers version (do not edit !!! generated and updated by cvs) */ -#define ZFCP_ERP_REVISION "$Revision: 1.44 $" +#define ZFCP_ERP_REVISION "$Revision: 1.46 $"#include "zfcp_ext.h"
@@ -1202,7 +1202,7 @@* returns: 0 - there was an action to handle * !0 - otherwise */ -static int +int zfcp_erp_async_handler (struct zfcp_erp_action *erp_action,unsigned long set_mask) {
@@ -1218,28 +1218,6 @@ }/* -* purpose: is called for finished FSF requests related to erp, -* moves concerned erp action to 'ready' queue and -* signals erp thread to process it, -* besides it cancels a timeout -*/ -void -zfcp_erp_fsf_req_handler (struct zfcp_fsf_req *fsf_req) -{ -struct zfcp_erp_action *erp_action = fsf_req->erp_action; -struct zfcp_adapter *adapter = fsf_req->adapter; - -debug_text_event (adapter->erp_dbf,3 ,"a_frh" ); -debug_event (adapter->erp_dbf,3 , &erp_action->action,sizeof (int )); - -if (erp_action) { -debug_event (adapter->erp_dbf,3 , &erp_action->action, -sizeof (int )); -zfcp_erp_async_handler (erp_action,0 ); - } -} - -/* * purpose: is called for erp_action which was slept waiting for * memory becoming avaliable, * will trigger that this action will be continued
drivers/s390/scsi/zfcp_ext.h +2 -4
@@ -31,7 +31,7 @@#ifndef ZFCP_EXT_H #define ZFCP_EXT_H /* this drivers version (do not edit !!! generated and updated by cvs) */ -#define ZFCP_EXT_REVISION "$Revision: 1.45 $" +#define ZFCP_EXT_REVISION "$Revision: 1.48 $"#include "zfcp_def.h"
@@ -46,8 +46,6 @@extern void zfcp_sysfs_port_remove_files (struct device *,u32 );extern int zfcp_sysfs_unit_create_files (struct device *);extern void zfcp_sysfs_unit_remove_files (struct device *); -extern void zfcp_sysfs_port_release (struct device *); -extern void zfcp_sysfs_unit_release (struct device *);/**************************** CONFIGURATION *********************************/ extern struct zfcp_unit *zfcp_get_unit_by_lun(struct zfcp_port *,
@@ -158,7 +156,7 @@extern int zfcp_erp_thread_setup (struct zfcp_adapter *);extern int zfcp_erp_thread_kill (struct zfcp_adapter *);extern int zfcp_erp_wait (struct zfcp_adapter *); -extern void zfcp_erp_fsf_req_handler (struct zfcp_fsf_req *); +extern int zfcp_erp_async_handler (struct zfcp_erp_action *,unsigned long );extern int zfcp_test_link (struct zfcp_port *);
drivers/s390/scsi/zfcp_fsf.c +104 -81
411 lines not on this page · raw message
drivers/s390/scsi/zfcp_fsf.h +9 -3
@@ -198,18 +198,23 @@/* channel features */ #define FSF_FEATURE_QTCB_SUPPRESSION 0x00000001#define FSF_FEATURE_CFDC 0x00000002 -#define FSF_FEATURE_SENSEDATA_REPLICATION 0x00000004#define FSF_FEATURE_LOST_SAN_NOTIFICATION 0x00000008#define FSF_FEATURE_HBAAPI_MANAGEMENT 0x00000010#define FSF_FEATURE_ELS_CT_CHAINED_SBALS 0x00000020/* option */ #define FSF_OPEN_LUN_SUPPRESS_BOXING 0x00000001 +#define FSF_OPEN_LUN_UNSOLICITED_SENSE_DATA 0x00000002/* adapter types */ #define FSF_ADAPTER_TYPE_FICON 0x00000001#define FSF_ADAPTER_TYPE_FICON_EXPRESS 0x00000002 +/* flags */ +#define FSF_CFDC_OPEN_LUN_ALLOWED 0x01 +#define FSF_CFDC_EXCLUSIVE_ACCESS 0x02 +#define FSF_CFDC_OUTBOUND_TRANSFER_ALLOWED 0x10 +/* port types */ #define FSF_HBA_PORTTYPE_UNKNOWN 0x00000001#define FSF_HBA_PORTTYPE_NOTPRESENT 0x00000003
@@ -394,9 +399,10 @@u64 res2;u64 req_handle;u32 service_class; -u8 res3[3 ]; +u8 res3[3 ];u8 timeout; -u8 res4[184 ]; +u32 lun_access; +u8 res4[180 ];u32 els1_length;u32 els2_length;u32 req_buf_length;
drivers/s390/scsi/zfcp_qdio.c +2 -13
@@ -28,7 +28,7 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define ZFCP_QDIO_C_REVISION "$Revision: 1.13 $" +#define ZFCP_QDIO_C_REVISION "$Revision: 1.15 $"#include "zfcp_ext.h"
@@ -502,17 +502,6 @@/* valid request id and thus (hopefully :) valid fsf_req address */ fsf_req = (struct zfcp_fsf_req *) sbale_addr; -if (unlikely ((fsf_req->common_magic !=ZFCP_MAGIC ) || - (fsf_req->specific_magic !=ZFCP_MAGIC_FSFREQ ))) { -ZFCP_LOG_NORMAL ("bug: An inbound FSF acknowledgement was " -"faulty (debug info 0x%x, 0x%x, 0x%lx)\n" , - fsf_req->common_magic, - fsf_req->specific_magic, - (unsigned long ) fsf_req); - retval = -EINVAL ; - goto out; - } -if (unlikely (adapter != fsf_req->adapter)) { ZFCP_LOG_NORMAL("bug: An inbound FSF acknowledgement was not " "correct (debug info 0x%lx, 0x%lx, 0%lx) \n",
@@ -665,7 +654,7 @@/** * zfcp_qdio_sbals_zero - initialize SBALs between first and last in queue -* with zero from +* with zero from */ static inline int zfcp_qdio_sbals_zero (struct zfcp_qdio_queue *queue,int first,int last)
drivers/s390/scsi/zfcp_scsi.c +34 -64
134 lines not on this page · raw message
drivers/s390/scsi/zfcp_sysfs_adapter.c +3 -28
@@ -26,7 +26,7 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.30 $" +#define ZFCP_SYSFS_ADAPTER_C_REVISION "$Revision: 1.32 $"#include <asm/ccwdev.h> #include "zfcp_ext.h"
@@ -75,6 +75,7 @@ZFCP_DEFINE_ADAPTER_ATTR (hardware_version,"0x%08x\n" , adapter->hardware_version);ZFCP_DEFINE_ADAPTER_ATTR (serial_number,"%17s\n" , adapter->serial_number); +ZFCP_DEFINE_ADAPTER_ATTR (scsi_host_no,"0x%x\n" , adapter->scsi_host_no);/** * zfcp_sysfs_adapter_in_recovery_show - recovery state of adapter
@@ -100,30 +101,6 @@ zfcp_sysfs_adapter_in_recovery_show, NULL);/** -* zfcp_sysfs_adapter_scsi_host_no_show - display scsi_host_no of adapter -* @dev: pointer to belonging device -* @buf: pointer to input buffer -* -* "scsi_host_no" attribute of adapter. Displays the SCSI host number. -*/ -static ssize_t -zfcp_sysfs_adapter_scsi_host_no_show (struct device *dev,char *buf) -{ -struct zfcp_adapter *adapter; -unsigned short host_no =0 ; - -down (&zfcp_data.config_sema); - adapter =dev_get_drvdata (dev); -if (adapter->scsi_host) - host_no = adapter->scsi_host->host_no; -up (&zfcp_data.config_sema); -return sprintf (buf,"0x%x\n" , host_no); -} - -static DEVICE_ATTR(scsi_host_no, S_IRUGO, zfcp_sysfs_adapter_scsi_host_no_show, - NULL); - -/** * zfcp_sysfs_port_add_store - add a port to sysfs tree * @dev: pointer to belonging device * @buf: pointer to input buffer
@@ -219,9 +196,7 @@zfcp_erp_port_shutdown (port,0 );zfcp_erp_wait (adapter);zfcp_port_put (port); -zfcp_sysfs_port_remove_files (&port->sysfs_device, -atomic_read (&port->status)); -device_unregister (&port->sysfs_device); +zfcp_port_dequeue (port); out:up (&zfcp_data.config_sema);return retval ? retval : count;
drivers/s390/scsi/zfcp_sysfs_port.c +2 -18
@@ -26,7 +26,7 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.37 $" +#define ZFCP_SYSFS_PORT_C_REVISION "$Revision: 1.39 $"#include <linux/init.h> #include <linux/module.h>
@@ -37,20 +37,6 @@#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG/** -* zfcp_sysfs_port_release - gets called when a struct device port is released -* @dev: pointer to belonging device -*/ -void -zfcp_sysfs_port_release (struct device *dev) -{ -struct zfcp_port *port; - - port =dev_get_drvdata (dev); -zfcp_port_dequeue (port); -return ; -} - -/** * ZFCP_DEFINE_PORT_ATTR * @_name: name of show attribute * @_format: format string
@@ -112,7 +98,6 @@zfcp_erp_unit_reopen (unit,0 );zfcp_erp_wait (unit->port->adapter); -wait_event (unit->scsi_add_wq,atomic_read (&unit->scsi_add_work) ==0 );zfcp_unit_put (unit); out:up (&zfcp_data.config_sema);
@@ -168,8 +153,7 @@zfcp_erp_unit_shutdown (unit,0 );zfcp_erp_wait (unit->port->adapter);zfcp_unit_put (unit); -zfcp_sysfs_unit_remove_files (&unit->sysfs_device); -device_unregister (&unit->sysfs_device); +zfcp_unit_dequeue (unit); out:up (&zfcp_data.config_sema);return retval ? retval : count;
drivers/s390/scsi/zfcp_sysfs_unit.c +1 -15
@@ -26,7 +26,7 @@* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.23 $" +#define ZFCP_SYSFS_UNIT_C_REVISION "$Revision: 1.24 $"#include <linux/init.h> #include <linux/module.h>
@@ -37,20 +37,6 @@#define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG/** -* zfcp_sysfs_unit_release - gets called when a struct device unit is released -* @dev: pointer to belonging device -*/ -void -zfcp_sysfs_unit_release (struct device *dev) -{ -struct zfcp_unit *unit; - - unit =dev_get_drvdata (dev); -zfcp_unit_dequeue (unit); -return ; -} - -/** * ZFCP_DEFINE_UNIT_ATTR * @_name: name of show attribute * @_format: format string
drivers/s390/scsi/zfcp_scsi.c line 884
Quoted 3 lines · Martin Schwidefsky
drivers/s390/scsi/zfcp_scsi.c +3
-0+ZFCP_DEFINE_SCSI_ATTR (hba_id,"%s\n" ,zfcp_get_busid_by_unit (unit)); +ZFCP_DEFINE_SCSI_ATTR (wwpn,"0x%016llx\n" , unit->port->wwpn); +ZFCP_DEFINE_SCSI_ATTR (fcp_lun,"0x%016llx\n" , unit->fcp_lun);
These attributes all properly belong in the fibrechannel transport class, could you look at moving them over, please.
James
Quoted 5 lines
drivers/s390/scsi/zfcp_scsi.c line 884
Quoted 3 lines
drivers/s390/scsi/zfcp_scsi.c +3
-0+ZFCP_DEFINE_SCSI_ATTR (hba_id,"%s\n" ,zfcp_get_busid_by_unit (unit)); +ZFCP_DEFINE_SCSI_ATTR (wwpn,"0x%016llx\n" , unit->port->wwpn); +ZFCP_DEFINE_SCSI_ATTR (fcp_lun,"0x%016llx\n" , unit->fcp_lun);These attributes all properly belong in the fibrechannel transport class, could you look at moving them over, please.
We can certainly do that for the wwpn (->port_name). For the fcp_lun we would need to extend the fc transport class.
The hba_id doesn't belong to the fc transport class at all. It's just the busid of our host adapter, so that we can identify it uniquely.
By the way, Christoph asked why we have the zfcp lldd in drivers/s390/scsi. This is just for historical reasons. If you don't mind seeing a ~32000 lines patch we can move it to drivers/scsi/zfcp.
Heiko