diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-10-07 10:55:52 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-11-06 23:55:44 -0500 |
commit | 8de530a523fd3cc46b5d8d96f3016298c5c808ac (patch) | |
tree | 1a1fee222c4e5c834023d871363aea9ee49cc41b /drivers/target | |
parent | d1b1f8053401aaf1dfe636afa6d361301e3ae8b7 (diff) |
target/pscsi: call spc_emulate_report_luns directly
No need to indirect through spc_parse_cdb if we only ever call it for
REPORT LUNS emulation.
(nab: Add missing EXPORT_SYMBOL for spc_emulate_report_luns)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_pscsi.c | 11 | ||||
-rw-r--r-- | drivers/target/target_core_spc.c | 3 |
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index b2965084eb4f..dc10e29934d7 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
@@ -985,8 +985,6 @@ static inline void pscsi_clear_cdb_lun(unsigned char *cdb) | |||
985 | static int pscsi_parse_cdb(struct se_cmd *cmd) | 985 | static int pscsi_parse_cdb(struct se_cmd *cmd) |
986 | { | 986 | { |
987 | unsigned char *cdb = cmd->t_task_cdb; | 987 | unsigned char *cdb = cmd->t_task_cdb; |
988 | unsigned int dummy_size; | ||
989 | int ret; | ||
990 | 988 | ||
991 | if (cmd->se_cmd_flags & SCF_BIDI) { | 989 | if (cmd->se_cmd_flags & SCF_BIDI) { |
992 | cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION; | 990 | cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION; |
@@ -1003,10 +1001,7 @@ static int pscsi_parse_cdb(struct se_cmd *cmd) | |||
1003 | */ | 1001 | */ |
1004 | switch (cdb[0]) { | 1002 | switch (cdb[0]) { |
1005 | case REPORT_LUNS: | 1003 | case REPORT_LUNS: |
1006 | ret = spc_parse_cdb(cmd, &dummy_size); | 1004 | return spc_emulate_report_luns(cmd); |
1007 | if (ret) | ||
1008 | return ret; | ||
1009 | break; | ||
1010 | case READ_6: | 1005 | case READ_6: |
1011 | case READ_10: | 1006 | case READ_10: |
1012 | case READ_12: | 1007 | case READ_12: |
@@ -1020,10 +1015,8 @@ static int pscsi_parse_cdb(struct se_cmd *cmd) | |||
1020 | /* FALLTHROUGH*/ | 1015 | /* FALLTHROUGH*/ |
1021 | default: | 1016 | default: |
1022 | cmd->execute_cmd = pscsi_execute_cmd; | 1017 | cmd->execute_cmd = pscsi_execute_cmd; |
1023 | break; | 1018 | return 0; |
1024 | } | 1019 | } |
1025 | |||
1026 | return 0; | ||
1027 | } | 1020 | } |
1028 | 1021 | ||
1029 | static int pscsi_execute_cmd(struct se_cmd *cmd) | 1022 | static int pscsi_execute_cmd(struct se_cmd *cmd) |
diff --git a/drivers/target/target_core_spc.c b/drivers/target/target_core_spc.c index 07b82700dcd8..1f1ddb8183c7 100644 --- a/drivers/target/target_core_spc.c +++ b/drivers/target/target_core_spc.c | |||
@@ -908,7 +908,7 @@ static int spc_emulate_request_sense(struct se_cmd *cmd) | |||
908 | return 0; | 908 | return 0; |
909 | } | 909 | } |
910 | 910 | ||
911 | static int spc_emulate_report_luns(struct se_cmd *cmd) | 911 | int spc_emulate_report_luns(struct se_cmd *cmd) |
912 | { | 912 | { |
913 | struct se_dev_entry *deve; | 913 | struct se_dev_entry *deve; |
914 | struct se_session *sess = cmd->se_sess; | 914 | struct se_session *sess = cmd->se_sess; |
@@ -970,6 +970,7 @@ done: | |||
970 | target_complete_cmd(cmd, GOOD); | 970 | target_complete_cmd(cmd, GOOD); |
971 | return 0; | 971 | return 0; |
972 | } | 972 | } |
973 | EXPORT_SYMBOL(spc_emulate_report_luns); | ||
973 | 974 | ||
974 | static int spc_emulate_testunitready(struct se_cmd *cmd) | 975 | static int spc_emulate_testunitready(struct se_cmd *cmd) |
975 | { | 976 | { |