Re: [PATCH 1/2] scsi_transport_fc: implement 'disable_target_scan' module parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 22, 2016 at 08:51:01AM +0100, Hannes Reinecke wrote:
>  /*
> + * disable_target_scan: Disable target scan per default
> + *   useful on larger installations where only a small
> + *   number of LUNs are required for booting.
> + */
> +static bool fc_disable_target_scan;
> +
> +module_param_named(disable_target_scan, fc_disable_target_scan,
> +		   bool, S_IRUGO|S_IWUSR);
> +MODULE_PARM_DESC(disable_target_scan,
> +		 "Disable target scan on remote ports (default=0)");
> +
> +/*
>   * Redefine so that we can have same named attributes in the
>   * sdev/starget/host objects.
>   */
> @@ -3272,10 +3284,14 @@ fc_scsi_scan_rport(struct work_struct *work)
>  	struct Scsi_Host *shost = rport_to_shost(rport);
>  	struct fc_internal *i = to_fc_internal(shost->transportt);
>  	unsigned long flags;
> +	bool disable_target_scan;
> +
> +	disable_target_scan = fc_disable_target_scan ?
> +		fc_disable_target_scan : i->f->disable_target_scan;
>  
>  	if ((rport->port_state == FC_PORTSTATE_ONLINE) &&
>  	    (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
> -	    !(i->f->disable_target_scan)) {
> +	    !disable_target_scan) {

Wouldn't this be simpler by just writing:

if ((rport->port_state == FC_PORTSTATE_ONLINE) &&
    (rport->roles & FC_PORT_ROLE_FCP_TARGET) &&
    !i->f->disable_target_scan && !disable_target_scan) {

that being said I don't understand why we need this in the FC transport
class.  What is so special about FC that we do it here and not globally?
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux