Commit bfb74374 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley

[SCSI] tgt: move tsk_mgmt_response callback to transport class

This moves tsk_mgmt_response callback in struct scsi_host_template to
struct scsi_transport_template since struct scsi_transport_template is
more suitable for the task management stuff.
Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 17b0bcfa
...@@ -577,7 +577,7 @@ int scsi_tgt_kspace_tsk_mgmt(int host_no, u64 itn_id, u64 mid, int result) ...@@ -577,7 +577,7 @@ int scsi_tgt_kspace_tsk_mgmt(int host_no, u64 itn_id, u64 mid, int result)
goto done; goto done;
} }
err = shost->hostt->tsk_mgmt_response(shost, itn_id, mid, result); err = shost->transportt->tsk_mgmt_response(shost, itn_id, mid, result);
done: done:
scsi_host_put(shost); scsi_host_put(shost);
return err; return err;
......
...@@ -280,10 +280,17 @@ void srp_remove_host(struct Scsi_Host *shost) ...@@ -280,10 +280,17 @@ void srp_remove_host(struct Scsi_Host *shost)
} }
EXPORT_SYMBOL_GPL(srp_remove_host); EXPORT_SYMBOL_GPL(srp_remove_host);
static int srp_it_nexus_response(struct Scsi_Host *shost, u64 id, int result) static int srp_tsk_mgmt_response(struct Scsi_Host *shost, u64 nexus, u64 tm_id,
int result)
{ {
struct srp_internal *i = to_srp_internal(shost->transportt); struct srp_internal *i = to_srp_internal(shost->transportt);
return i->f->it_nexus_response(shost, id, result); return i->f->tsk_mgmt_response(shost, nexus, tm_id, result);
}
static int srp_it_nexus_response(struct Scsi_Host *shost, u64 nexus, int result)
{
struct srp_internal *i = to_srp_internal(shost->transportt);
return i->f->it_nexus_response(shost, nexus, result);
} }
/** /**
...@@ -300,6 +307,7 @@ srp_attach_transport(struct srp_function_template *ft) ...@@ -300,6 +307,7 @@ srp_attach_transport(struct srp_function_template *ft)
if (!i) if (!i)
return NULL; return NULL;
i->t.tsk_mgmt_response = srp_tsk_mgmt_response;
i->t.it_nexus_response = srp_it_nexus_response; i->t.it_nexus_response = srp_it_nexus_response;
i->t.host_size = sizeof(struct srp_host_attrs); i->t.host_size = sizeof(struct srp_host_attrs);
......
...@@ -145,9 +145,6 @@ struct scsi_host_template { ...@@ -145,9 +145,6 @@ struct scsi_host_template {
int (* transfer_response)(struct scsi_cmnd *, int (* transfer_response)(struct scsi_cmnd *,
void (*done)(struct scsi_cmnd *)); void (*done)(struct scsi_cmnd *));
/* Used as callback for the completion of task management request. */
int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64 mid, int result);
/* /*
* This is an error handling strategy routine. You don't need to * This is an error handling strategy routine. You don't need to
* define one of these if you don't want to - there is a default * define one of these if you don't want to - there is a default
......
...@@ -71,6 +71,12 @@ struct scsi_transport_template { ...@@ -71,6 +71,12 @@ struct scsi_transport_template {
* for target drivers. * for target drivers.
*/ */
int (* it_nexus_response)(struct Scsi_Host *, u64, int); int (* it_nexus_response)(struct Scsi_Host *, u64, int);
/*
* Used as callback for the completion of task management
* request for target drivers.
*/
int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
}; };
#define transport_class_to_shost(tc) \ #define transport_class_to_shost(tc) \
......
...@@ -22,6 +22,7 @@ struct srp_rport { ...@@ -22,6 +22,7 @@ struct srp_rport {
struct srp_function_template { struct srp_function_template {
/* for target drivers */ /* for target drivers */
int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
int (* it_nexus_response)(struct Scsi_Host *, u64, int); int (* it_nexus_response)(struct Scsi_Host *, u64, int);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment