scsi: libfc: Replace ->seq_start_next callback with function call
authorHannes Reinecke <hare@suse.de>
Tue, 18 Oct 2016 08:01:51 +0000 (10:01 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 8 Nov 2016 22:29:56 +0000 (17:29 -0500)
The ->seq_start_next callback only ever had one implementation,
so call the function 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/libfc/fc_exch.c
drivers/scsi/libfc/fc_fcp.c
drivers/scsi/libfc/fc_libfc.c
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_io.c
include/scsi/libfc.h

index b98ad3f743cb592d07aa58392c00553b279f3779..8a99f846441ae5cafa0e04a0baf099971e21fb06 100644 (file)
@@ -585,7 +585,7 @@ static struct fc_seq *fc_seq_start_next_locked(struct fc_seq *sp)
  *                      for a given sequence/exchange pair
  * @sp: The sequence/exchange to get a new exchange for
  */
-static struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
+struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
 {
        struct fc_exch *ep = fc_seq_exch(sp);
 
@@ -595,6 +595,7 @@ static struct fc_seq *fc_seq_start_next(struct fc_seq *sp)
 
        return sp;
 }
+EXPORT_SYMBOL(fc_seq_start_next);
 
 /*
  * Set the response handler for the exchange associated with a sequence.
@@ -2649,9 +2650,6 @@ EXPORT_SYMBOL(fc_exch_recv);
  */
 int fc_exch_init(struct fc_lport *lport)
 {
-       if (!lport->tt.seq_start_next)
-               lport->tt.seq_start_next = fc_seq_start_next;
-
        if (!lport->tt.seq_set_resp)
                lport->tt.seq_set_resp = fc_seq_set_resp;
 
index 4fadd62497003974e825006b8b0d9f3a54711e04..0e67621477a8a939c0e1e703ba0d0cbcc043c132 100644 (file)
@@ -653,7 +653,7 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq,
        remaining = seq_blen;
        fh_parm_offset = frame_offset = offset;
        tlen = 0;
-       seq = lport->tt.seq_start_next(seq);
+       seq = fc_seq_start_next(seq);
        f_ctl = FC_FC_REL_OFF;
        WARN_ON(!seq);
 
@@ -1024,7 +1024,7 @@ static void fc_fcp_complete_locked(struct fc_fcp_pkt *fsp)
                        struct fc_frame *conf_frame;
                        struct fc_seq *csp;
 
-                       csp = lport->tt.seq_start_next(seq);
+                       csp = fc_seq_start_next(seq);
                        conf_frame = fc_fcp_frame_alloc(fsp->lp, 0);
                        if (conf_frame) {
                                f_ctl = FC_FC_SEQ_INIT;
index c11a638f32e6dbc3860bad5758fba5e20a9cc562..d623d084b7ec21c61531380e1da3415126becf35 100644 (file)
@@ -226,7 +226,7 @@ void fc_fill_reply_hdr(struct fc_frame *fp, const struct fc_frame *in_fp,
 
        sp = fr_seq(in_fp);
        if (sp)
-               fr_seq(fp) = fr_dev(in_fp)->tt.seq_start_next(sp);
+               fr_seq(fp) = fc_seq_start_next(sp);
        fc_fill_hdr(fp, in_fp, r_ctl, FC_FCTL_RESP, 0, parm_offset);
 }
 EXPORT_SYMBOL(fc_fill_reply_hdr);
index 7f6562638abfcbf6ce5bdab36c295cfdeefa4307..12aec538e39b415e6834bcccb80025af39975816 100644 (file)
@@ -161,7 +161,7 @@ int ft_queue_status(struct se_cmd *se_cmd)
        /*
         * Send response.
         */
-       cmd->seq = lport->tt.seq_start_next(cmd->seq);
+       cmd->seq = fc_seq_start_next(cmd->seq);
        fc_fill_fc_hdr(fp, FC_RCTL_DD_CMD_STATUS, ep->did, ep->sid, FC_TYPE_FCP,
                       FC_FC_EX_CTX | FC_FC_LAST_SEQ | FC_FC_END_SEQ, 0);
 
@@ -221,7 +221,7 @@ int ft_write_pending(struct se_cmd *se_cmd)
        memset(txrdy, 0, sizeof(*txrdy));
        txrdy->ft_burst_len = htonl(se_cmd->data_length);
 
-       cmd->seq = lport->tt.seq_start_next(cmd->seq);
+       cmd->seq = fc_seq_start_next(cmd->seq);
        fc_fill_fc_hdr(fp, FC_RCTL_DD_DATA_DESC, ep->did, ep->sid, FC_TYPE_FCP,
                       FC_FC_EX_CTX | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0);
 
index b10ebfd05d134c2af23fab37bbd175a0eedfb368..1eb1f58e00e494ee6f3388c08d387cc551d1682d 100644 (file)
@@ -82,7 +82,7 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
 
        ep = fc_seq_exch(cmd->seq);
        lport = ep->lp;
-       cmd->seq = lport->tt.seq_start_next(cmd->seq);
+       cmd->seq = fc_seq_start_next(cmd->seq);
 
        remaining = se_cmd->data_length;
 
index 19f38eb318ec986e8e56199cff4b02165d03355e..39143cabaa90c26cd167f5d19a80d94bbde6b874 100644 (file)
@@ -514,13 +514,6 @@ struct libfc_function_template {
         */
        void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
 
-       /*
-        * Start a new sequence on the same exchange/sequence tuple.
-        *
-        * STATUS: OPTIONAL
-        */
-       struct fc_seq *(*seq_start_next)(struct fc_seq *);
-
        /*
         * Set a response handler for the exchange of the sequence.
         *
@@ -1019,6 +1012,7 @@ struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
                                void *arg, u32 timer_msec);
 void fc_seq_els_rsp_send(struct fc_frame *, enum fc_els_cmd,
                         struct fc_seq_els_data *);
+struct fc_seq *fc_seq_start_next(struct fc_seq *sp);
 struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
                                           struct fc_exch_mgr *,
                                           bool (*match)(struct fc_frame *));