>
> <-- snip -->
>
> 
>  /**
> - * fc_rport_terminate_io() - Stop all outstanding I/O on a remote port
> - * @rport: The remote port whose I/O should be terminated
> + * fc_rport_dev_loss_tmo_callbk() - Final cleanup of fc_rport_priv
> + * @rport: The remote port that is going to be freed
> + *
> + * The rport is about to be freed by the FC Transport. The transport
> + * has already terminated all rport I/O and now it's about to do
> + * the final cleanup. To libfc this just means decrementing the
> + * reference count so the fc_rport_priv can be freed.
>   */
> -void fc_rport_terminate_io(struct fc_rport *rport)
> +void fc_rport_dev_loss_tmo_callbk(struct fc_rport *rport)
>  {
> -     struct fc_rport_libfc_priv *rpriv = rport->dd_data;
> -     struct fc_lport *lport = rpriv->local_port;
> +     struct fc_rport_priv *rdata = rport_to_rport_priv(rport);
> +     struct fc_lport *lport = rdata->local_port;
> 
>       lport->tt.exch_mgr_reset(lport, 0, rport->port_id);
>       lport->tt.exch_mgr_reset(lport, rport->port_id, 0);
I think you need rdata->port_id instead of rport->port_id which is
already -1 when dev_lost_tmo_callbk gets called.


> +     kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy);
>  }
> -EXPORT_SYMBOL(fc_rport_terminate_io);
> +EXPORT_SYMBOL(fc_rport_dev_loss_tmo_callbk);
> diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
> index a26bb50..021be0c 100644
> --- a/include/scsi/libfc.h
> +++ b/include/scsi/libfc.h
> @@ -160,24 +160,6 @@ struct fc_rport_operations {
>  };
> 
>  /**
> - * struct fc_rport_libfc_priv - libfc internal information about a remote
> port
> - * @local_port: The associated local port
> - * @rp_state:   Indicates READY for I/O or DELETE when blocked
> - * @flags:      REC and RETRY supported flags
> - * @e_d_tov:    Error detect timeout value (in msec)
> - * @r_a_tov:    Resource allocation timeout value (in msec)
> - */
> -struct fc_rport_libfc_priv {
> -     struct fc_lport            *local_port;
> -     enum fc_rport_state        rp_state;
> -     u16                        flags;
> -     #define FC_RP_FLAGS_REC_SUPPORTED       (1 << 0)
> -     #define FC_RP_FLAGS_RETRY               (1 << 1)
> -     unsigned int               e_d_tov;
> -     unsigned int               r_a_tov;
> -};
> -
> -/**
>   * struct fc_rport_priv - libfc remote port and discovery info
>   * @local_port:     The associated local port
>   * @rport:          The FC transport remote port
> @@ -202,6 +184,8 @@ struct fc_rport_priv {
>       struct kref                 kref;
>       enum fc_rport_state         rp_state;
>       struct fc_rport_identifiers ids;
> +     #define FC_RP_FLAGS_REC_SUPPORTED       (1 << 0)
> +     #define FC_RP_FLAGS_RETRY               (1 << 1)
>       u16                         flags;
>       u16                         max_seq;
>       u16                         disc_id;
> @@ -218,6 +202,9 @@ struct fc_rport_priv {
>       u32                         supported_classes;
>  };
> 
> +#define rport_to_rport_priv(r)                                       \
> +     (*((struct fc_rport_priv**)r->dd_data))
> +
Maybe just use the name rport_priv() like shost_priv ?

Thanks,
yi

>  /**
>   * struct fcoe_dev_stats - fcoe stats structure
>   * @SecondsSinceLastReset: Seconds since the last reset
> @@ -989,7 +976,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *);
>   * REMOTE PORT LAYER
>   *****************************/
>  int fc_rport_init(struct fc_lport *);
> -void fc_rport_terminate_io(struct fc_rport *);
> +void fc_rport_dev_loss_tmo_callbk(struct fc_rport *);
> 
>  /*
>   * DISCOVERY LAYER
> 
_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to