diff options
-rw-r--r-- | drivers/target/target_core_transport.c | 24 | ||||
-rw-r--r-- | include/target/target_core_transport.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index d42a98e4725b..1ae6eb7a621b 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -1842,12 +1842,36 @@ int transport_generic_handle_cdb( | |||
1842 | printk(KERN_ERR "cmd->se_lun is NULL\n"); | 1842 | printk(KERN_ERR "cmd->se_lun is NULL\n"); |
1843 | return -EINVAL; | 1843 | return -EINVAL; |
1844 | } | 1844 | } |
1845 | |||
1845 | transport_add_cmd_to_queue(cmd, TRANSPORT_NEW_CMD); | 1846 | transport_add_cmd_to_queue(cmd, TRANSPORT_NEW_CMD); |
1846 | return 0; | 1847 | return 0; |
1847 | } | 1848 | } |
1848 | EXPORT_SYMBOL(transport_generic_handle_cdb); | 1849 | EXPORT_SYMBOL(transport_generic_handle_cdb); |
1849 | 1850 | ||
1850 | /* | 1851 | /* |
1852 | * Used by fabric module frontends to queue tasks directly. | ||
1853 | * Many only be used from process context only | ||
1854 | */ | ||
1855 | int transport_handle_cdb_direct( | ||
1856 | struct se_cmd *cmd) | ||
1857 | { | ||
1858 | if (!cmd->se_lun) { | ||
1859 | dump_stack(); | ||
1860 | printk(KERN_ERR "cmd->se_lun is NULL\n"); | ||
1861 | return -EINVAL; | ||
1862 | } | ||
1863 | if (in_interrupt()) { | ||
1864 | dump_stack(); | ||
1865 | printk(KERN_ERR "transport_generic_handle_cdb cannot be called" | ||
1866 | " from interrupt context\n"); | ||
1867 | return -EINVAL; | ||
1868 | } | ||
1869 | |||
1870 | return transport_generic_new_cmd(cmd); | ||
1871 | } | ||
1872 | EXPORT_SYMBOL(transport_handle_cdb_direct); | ||
1873 | |||
1874 | /* | ||
1851 | * Used by fabric module frontends defining a TFO->new_cmd_map() caller | 1875 | * Used by fabric module frontends defining a TFO->new_cmd_map() caller |
1852 | * to queue up a newly setup se_cmd w/ TRANSPORT_NEW_CMD_MAP in order to | 1876 | * to queue up a newly setup se_cmd w/ TRANSPORT_NEW_CMD_MAP in order to |
1853 | * complete setup in TCM process context w/ TFO->new_cmd_map(). | 1877 | * complete setup in TCM process context w/ TFO->new_cmd_map(). |
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h index 604e669527b4..2aae76412377 100644 --- a/include/target/target_core_transport.h +++ b/include/target/target_core_transport.h | |||
@@ -166,6 +166,7 @@ extern void transport_init_se_cmd(struct se_cmd *, | |||
166 | extern void transport_free_se_cmd(struct se_cmd *); | 166 | extern void transport_free_se_cmd(struct se_cmd *); |
167 | extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); | 167 | extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); |
168 | extern int transport_generic_handle_cdb(struct se_cmd *); | 168 | extern int transport_generic_handle_cdb(struct se_cmd *); |
169 | extern int transport_handle_cdb_direct(struct se_cmd *); | ||
169 | extern int transport_generic_handle_cdb_map(struct se_cmd *); | 170 | extern int transport_generic_handle_cdb_map(struct se_cmd *); |
170 | extern int transport_generic_handle_data(struct se_cmd *); | 171 | extern int transport_generic_handle_data(struct se_cmd *); |
171 | extern void transport_new_cmd_failure(struct se_cmd *); | 172 | extern void transport_new_cmd_failure(struct se_cmd *); |