diff options
author | Christoph Hellwig <hch@lst.de> | 2012-11-06 12:24:09 -0800 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-11-06 20:55:46 -0800 |
commit | de103c93aff0bed0ae984274e5dc8b95899badab (patch) | |
tree | 7db9bba755fa95772052e8d31285a38ba48f1a84 /include/target/target_core_backend.h | |
parent | fecae40abb1ae9218bdbaa8b8e30bfb5ae43f522 (diff) |
target: pass sense_reason as a return value
Pass the sense reason as an explicit return value from the I/O submission
path instead of storing it in struct se_cmd and using negative return
values. This cleans up a lot of the code pathes, and with the sparse
annotations for the new sense_reason_t type allows for much better
error checking.
(nab: Convert spc_emulate_modesense + spc_emulate_modeselect to use
sense_reason_t with Roland's MODE SELECT changes)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target/target_core_backend.h')
-rw-r--r-- | include/target/target_core_backend.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h index e57f738f04f9..aa868090b9ab 100644 --- a/include/target/target_core_backend.h +++ b/include/target/target_core_backend.h @@ -31,17 +31,17 @@ struct se_subsystem_api { struct scatterlist *, unsigned char *); - int (*parse_cdb)(struct se_cmd *cmd); + sense_reason_t (*parse_cdb)(struct se_cmd *cmd); u32 (*get_device_type)(struct se_device *); sector_t (*get_blocks)(struct se_device *); unsigned char *(*get_sense_buffer)(struct se_cmd *); }; struct sbc_ops { - int (*execute_rw)(struct se_cmd *cmd); - int (*execute_sync_cache)(struct se_cmd *cmd); - int (*execute_write_same)(struct se_cmd *cmd); - int (*execute_unmap)(struct se_cmd *cmd); + sense_reason_t (*execute_rw)(struct se_cmd *cmd); + sense_reason_t (*execute_sync_cache)(struct se_cmd *cmd); + sense_reason_t (*execute_write_same)(struct se_cmd *cmd); + sense_reason_t (*execute_unmap)(struct se_cmd *cmd); }; int transport_subsystem_register(struct se_subsystem_api *); @@ -49,11 +49,11 @@ void transport_subsystem_release(struct se_subsystem_api *); void target_complete_cmd(struct se_cmd *, u8); -int spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); -int spc_emulate_report_luns(struct se_cmd *cmd); +sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); +sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd); int spc_get_write_same_sectors(struct se_cmd *cmd); -int sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); +sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops); u32 sbc_get_device_rev(struct se_device *dev); u32 sbc_get_device_type(struct se_device *dev); |