Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

FUJITA Tomonori and committed by
James Bottomley
bfb74374 17b0bcfa

+18 -6
+1 -1
drivers/scsi/scsi_tgt_lib.c
··· 577 577 goto done; 578 578 } 579 579 580 - err = shost->hostt->tsk_mgmt_response(shost, itn_id, mid, result); 580 + err = shost->transportt->tsk_mgmt_response(shost, itn_id, mid, result); 581 581 done: 582 582 scsi_host_put(shost); 583 583 return err;
+10 -2
drivers/scsi/scsi_transport_srp.c
··· 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); 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); 287 294 } 288 295 289 296 /** ··· 307 300 if (!i) 308 301 return NULL; 309 302 303 + i->t.tsk_mgmt_response = srp_tsk_mgmt_response; 310 304 i->t.it_nexus_response = srp_it_nexus_response; 311 305 312 306 i->t.host_size = sizeof(struct srp_host_attrs);
-3
include/scsi/scsi_host.h
··· 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
+6
include/scsi/scsi_transport.h
··· 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) \
+1
include/scsi/scsi_transport_srp.h
··· 22 22 23 23 struct srp_function_template { 24 24 /* for target drivers */ 25 + int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int); 25 26 int (* it_nexus_response)(struct Scsi_Host *, u64, int); 26 27 }; 27 28