]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
scsi: libfc: Replace ->rport_login callback with function call
authorHannes Reinecke <hare@suse.de>
Tue, 18 Oct 2016 08:01:43 +0000 (10:01 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 Nov 2016 22:29:55 +0000 (17:29 -0500)
The ->rport_login callback only ever had one implementation,
so we can as well call it directly and drop the callback.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fcoe/fcoe_ctlr.c
drivers/scsi/libfc/fc_disc.c
drivers/scsi/libfc/fc_lport.c
drivers/scsi/libfc/fc_rport.c
include/scsi/libfc.h

index 38e67797fc72e9feccb8fb049f63f53e58a0af69..ff0eca31cebebba1fa9d2325e782740131e09214 100644 (file)
@@ -2674,7 +2674,7 @@ static void fcoe_ctlr_vn_beacon(struct fcoe_ctlr *fip,
                                LIBFCOE_FIP_DBG(fip, "beacon expired "
                                                "for rport %x\n",
                                                rdata->ids.port_id);
-                               lport->tt.rport_login(rdata);
+                               fc_rport_login(rdata);
                        }
                        frport->time = jiffies;
                }
@@ -3088,7 +3088,7 @@ static void fcoe_ctlr_vn_disc(struct fcoe_ctlr *fip)
                        continue;
                frport = fcoe_ctlr_rport(rdata);
                if (frport->time)
-                       lport->tt.rport_login(rdata);
+                       fc_rport_login(rdata);
                kref_put(&rdata->kref, fc_rport_destroy);
        }
        rcu_read_unlock();
index 305dd85419639d8b32a092866eb89582d34c112e..8d0aa19b1f5b5b08caf8e6427b81576848c42a40 100644 (file)
@@ -299,7 +299,7 @@ static void fc_disc_done(struct fc_disc *disc, enum fc_disc_event event)
                        continue;
                if (rdata->disc_id) {
                        if (rdata->disc_id == disc->disc_id)
-                               lport->tt.rport_login(rdata);
+                               fc_rport_login(rdata);
                        else
                                lport->tt.rport_logoff(rdata);
                }
@@ -628,13 +628,13 @@ static void fc_disc_gpn_id_resp(struct fc_seq *sp, struct fc_frame *fp,
                        mutex_unlock(&lport->disc.disc_mutex);
                        if (new_rdata) {
                                new_rdata->disc_id = disc->disc_id;
-                               lport->tt.rport_login(new_rdata);
+                               fc_rport_login(new_rdata);
                        }
                        goto out;
                }
                rdata->disc_id = disc->disc_id;
                mutex_unlock(&rdata->rp_mutex);
-               lport->tt.rport_login(rdata);
+               fc_rport_login(rdata);
        } else if (ntohs(cp->ct_cmd) == FC_FS_RJT) {
                FC_DISC_DBG(disc, "GPN_ID rejected reason %x exp %x\n",
                            cp->ct_reason, cp->ct_explan);
index a16936a833f8bb18ad3c881a7b6ecc94881a1309..e20c1519be15378e9ee1ed61a655ac56fe696e74 100644 (file)
@@ -256,7 +256,7 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
        lport->ptp_rdata->ids.node_name = remote_wwnn;
        mutex_unlock(&lport->disc.disc_mutex);
 
-       lport->tt.rport_login(lport->ptp_rdata);
+       fc_rport_login(lport->ptp_rdata);
 
        fc_lport_enter_ready(lport);
 }
@@ -1437,7 +1437,7 @@ static void fc_lport_enter_dns(struct fc_lport *lport)
                goto err;
 
        rdata->ops = &fc_lport_rport_ops;
-       lport->tt.rport_login(rdata);
+       fc_rport_login(rdata);
        return;
 
 err:
@@ -1554,7 +1554,7 @@ static void fc_lport_enter_fdmi(struct fc_lport *lport)
                goto err;
 
        rdata->ops = &fc_lport_rport_ops;
-       lport->tt.rport_login(rdata);
+       fc_rport_login(rdata);
        return;
 
 err:
index b05fa9997db545faf7570226d1a1c666f75338dd..c045bc459910f09f4bc42739ee51157bc56ab447 100644 (file)
@@ -412,6 +412,14 @@ static void fc_rport_work(struct work_struct *work)
  * fc_rport_login() - Start the remote port login state machine
  * @rdata: The remote port to be logged in to
  *
+ * Initiates the RP state machine. It is called from the LP module.
+ * This function will issue the following commands to the N_Port
+ * identified by the FC ID provided.
+ *
+ * - PLOGI
+ * - PRLI
+ * - RTV
+ *
  * Locking Note: Called without the rport lock held. This
  * function will hold the rport lock, call an _enter_*
  * function and then unlock the rport.
@@ -420,7 +428,7 @@ static void fc_rport_work(struct work_struct *work)
  * If it appears we are already logged in, ADISC is used to verify
  * the setup.
  */
-static int fc_rport_login(struct fc_rport_priv *rdata)
+int fc_rport_login(struct fc_rport_priv *rdata)
 {
        mutex_lock(&rdata->rp_mutex);
 
@@ -452,6 +460,7 @@ static int fc_rport_login(struct fc_rport_priv *rdata)
 
        return 0;
 }
+EXPORT_SYMBOL(fc_rport_login);
 
 /**
  * fc_rport_enter_delete() - Schedule a remote port to be deleted
@@ -2175,9 +2184,6 @@ static void fc_rport_flush_queue(void)
  */
 int fc_rport_init(struct fc_lport *lport)
 {
-       if (!lport->tt.rport_login)
-               lport->tt.rport_login = fc_rport_login;
-
        if (!lport->tt.rport_logoff)
                lport->tt.rport_logoff = fc_rport_logoff;
 
index 47b69d26be99170a1ada8d985631d742dc96d10d..64045778e616ce874fb3651f0d5ab6d7773830a2 100644 (file)
@@ -609,19 +609,6 @@ struct libfc_function_template {
        void (*lport_set_port_id)(struct fc_lport *, u32 port_id,
                                  struct fc_frame *);
 
-       /*
-        * Initiates the RP state machine. It is called from the LP module.
-        * This function will issue the following commands to the N_Port
-        * identified by the FC ID provided.
-        *
-        * - PLOGI
-        * - PRLI
-        * - RTV
-        *
-        * STATUS: OPTIONAL
-        */
-       int (*rport_login)(struct fc_rport_priv *);
-
        /*
         * Logoff, and remove the rport from the transport if
         * it had been added. This will send a LOGO to the target.
@@ -1019,6 +1006,7 @@ struct fc_rport_priv *fc_rport_lookup(const struct fc_lport *lport,
                                      u32 port_id);
 struct fc_rport_priv *fc_rport_create(struct fc_lport *, u32);
 void fc_rport_destroy(struct kref *kref);
+int fc_rport_login(struct fc_rport_priv *rdata);
 
 /*
  * DISCOVERY LAYER