• Steffen Maier's avatar
    zfcp: bring back unit sysfs attributes for automatic LUN scan · c8bba144
    Steffen Maier authored
    Through sysfs attributes, zfcp unit objects
    provide a trigger for manual LUN recovery
    and export information for problem determination.
    
    With commit
    f8210e34
    "[SCSI] zfcp: Allow midlayer to scan for LUNs when running in NPIV mode"
    and when attaching SCSI devices through this new optional method,
    no more zfcp unit objects are allocated for such SCSI devices.
    Hence, the above-mentioned trigger and information were missing.
    
    The information and context is located in SCSI transport device data since
    b62a8d9b
    "[SCSI] zfcp: Use SCSI device data zfcp_scsi_dev instead of zfcp_unit"
    57c23773
    "[SCSI] zfcp: Add zfcp private struct as SCSI device driver data"
    Hence, introduce the trigger and the information unconditionally
    for all SCSI devices attached through zfcp.
    
    We prefix the attribute names with 'zfcp_' to prevent collisions and
    to avoid mix-ups such as with the common 'state' attribute.
    
    Since some of the new attribute views do not need zfcp_port
    in the ZFCP_DEFINE_SCSI_ATTR helper macro, remove zfcp_port
    to avoid compiler warnings on unused variable.
    It's easy to open code the conversion from zfcp_scsi_dev to zfcp_port
    for the two already existing attributes hba_id and wwpn.
    Signed-off-by: default avatarSteffen Maier <[email protected]>
    Reviewed-by: default avatarMartin Peschke <[email protected]>
    Reviewed-by: Hannes Reinecke's avatarHannes Reinecke <[email protected]>
    Signed-off-by: default avatarChristoph Hellwig <[email protected]>
    c8bba144
zfcp_sysfs.c 18.8 KB