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

index 8a99f846441ae5cafa0e04a0baf099971e21fb06..ceeccd7b3ba723dd7bd49f3e709395adc3abc266 100644 (file)
@@ -602,10 +602,9 @@ EXPORT_SYMBOL(fc_seq_start_next);
  *
  * Note: May sleep if invoked from outside a response handler.
  */
-static void fc_seq_set_resp(struct fc_seq *sp,
-                           void (*resp)(struct fc_seq *, struct fc_frame *,
-                                        void *),
-                           void *arg)
+void fc_seq_set_resp(struct fc_seq *sp,
+                    void (*resp)(struct fc_seq *, struct fc_frame *, void *),
+                    void *arg)
 {
        struct fc_exch *ep = fc_seq_exch(sp);
        DEFINE_WAIT(wait);
@@ -624,6 +623,7 @@ static void fc_seq_set_resp(struct fc_seq *sp,
        ep->arg = arg;
        spin_unlock_bh(&ep->ex_lock);
 }
+EXPORT_SYMBOL(fc_seq_set_resp);
 
 /**
  * fc_exch_abort_locked() - Abort an exchange
@@ -2650,9 +2650,6 @@ EXPORT_SYMBOL(fc_exch_recv);
  */
 int fc_exch_init(struct fc_lport *lport)
 {
-       if (!lport->tt.seq_set_resp)
-               lport->tt.seq_set_resp = fc_seq_set_resp;
-
        if (!lport->tt.exch_mgr_reset)
                lport->tt.exch_mgr_reset = fc_exch_mgr_reset;
 
index 12aec538e39b415e6834bcccb80025af39975816..d6d06644f1da84b7a46b176795b069adbf02fc7d 100644 (file)
@@ -563,7 +563,7 @@ static void ft_send_work(struct work_struct *work)
                task_attr = TCM_SIMPLE_TAG;
        }
 
-       fc_seq_exch(cmd->seq)->lp->tt.seq_set_resp(cmd->seq, ft_recv_seq, cmd);
+       fc_seq_set_resp(cmd->seq, ft_recv_seq, cmd);
        cmd->se_cmd.tag = fc_seq_exch(cmd->seq)->rxid;
        /*
         * Use a single se_cmd->cmd_kref as we expect to release se_cmd
index 39143cabaa90c26cd167f5d19a80d94bbde6b874..e8669f9f2e50477461c6878f47547b5212e224d0 100644 (file)
@@ -514,16 +514,6 @@ struct libfc_function_template {
         */
        void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb);
 
-       /*
-        * Set a response handler for the exchange of the sequence.
-        *
-        * STATUS: OPTIONAL
-        */
-       void (*seq_set_resp)(struct fc_seq *sp,
-                            void (*resp)(struct fc_seq *, struct fc_frame *,
-                                         void *),
-                            void *arg);
-
        /*
         * Assign a sequence for an incoming request frame.
         *
@@ -1013,6 +1003,9 @@ struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
 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);
+void fc_seq_set_resp(struct fc_seq *sp,
+                    void (*resp)(struct fc_seq *, struct fc_frame *, void *),
+                    void *arg);
 struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *,
                                           struct fc_exch_mgr *,
                                           bool (*match)(struct fc_frame *));