Commit bfb743740e1598d3030c4972a8808f2bb5b95b6b
Committed by
James Bottomley
1 parent
17b0bcfad7
Exists in
master
and in
39 other branches
[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: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Showing 5 changed files with 18 additions and 6 deletions Side-by-side Diff
drivers/scsi/scsi_tgt_lib.c
drivers/scsi/scsi_transport_srp.c
... | ... | @@ -280,12 +280,19 @@ |
280 | 280 | } |
281 | 281 | EXPORT_SYMBOL_GPL(srp_remove_host); |
282 | 282 | |
283 | -static int srp_it_nexus_response(struct Scsi_Host *shost, u64 id, int result) | |
283 | +static int srp_tsk_mgmt_response(struct Scsi_Host *shost, u64 nexus, u64 tm_id, | |
284 | + int result) | |
284 | 285 | { |
285 | 286 | struct srp_internal *i = to_srp_internal(shost->transportt); |
286 | - return i->f->it_nexus_response(shost, id, result); | |
287 | + return i->f->tsk_mgmt_response(shost, nexus, tm_id, result); | |
287 | 288 | } |
288 | 289 | |
290 | +static int srp_it_nexus_response(struct Scsi_Host *shost, u64 nexus, int result) | |
291 | +{ | |
292 | + struct srp_internal *i = to_srp_internal(shost->transportt); | |
293 | + return i->f->it_nexus_response(shost, nexus, result); | |
294 | +} | |
295 | + | |
289 | 296 | /** |
290 | 297 | * srp_attach_transport -- instantiate SRP transport template |
291 | 298 | * @ft: SRP transport class function template |
... | ... | @@ -300,6 +307,7 @@ |
300 | 307 | if (!i) |
301 | 308 | return NULL; |
302 | 309 | |
310 | + i->t.tsk_mgmt_response = srp_tsk_mgmt_response; | |
303 | 311 | i->t.it_nexus_response = srp_it_nexus_response; |
304 | 312 | |
305 | 313 | i->t.host_size = sizeof(struct srp_host_attrs); |
include/scsi/scsi_host.h
... | ... | @@ -145,9 +145,6 @@ |
145 | 145 | int (* transfer_response)(struct scsi_cmnd *, |
146 | 146 | void (*done)(struct scsi_cmnd *)); |
147 | 147 | |
148 | - /* Used as callback for the completion of task management request. */ | |
149 | - int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64 mid, int result); | |
150 | - | |
151 | 148 | /* |
152 | 149 | * This is an error handling strategy routine. You don't need to |
153 | 150 | * define one of these if you don't want to - there is a default |
include/scsi/scsi_transport.h
... | ... | @@ -71,6 +71,12 @@ |
71 | 71 | * for target drivers. |
72 | 72 | */ |
73 | 73 | int (* it_nexus_response)(struct Scsi_Host *, u64, int); |
74 | + | |
75 | + /* | |
76 | + * Used as callback for the completion of task management | |
77 | + * request for target drivers. | |
78 | + */ | |
79 | + int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int); | |
74 | 80 | }; |
75 | 81 | |
76 | 82 | #define transport_class_to_shost(tc) \ |
include/scsi/scsi_transport_srp.h