diff options
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 5 | ||||
-rw-r--r-- | drivers/target/target_core_transport.c | 7 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tcm_fc.h | 2 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_cmd.c | 3 | ||||
-rw-r--r-- | include/target/target_core_fabric_ops.h | 7 |
5 files changed, 16 insertions, 8 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 3c9c318f66ed..3df1c9b8ae6b 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -205,7 +205,7 @@ static int tcm_loop_new_cmd_map(struct se_cmd *se_cmd) | |||
205 | /* | 205 | /* |
206 | * Called from struct target_core_fabric_ops->check_stop_free() | 206 | * Called from struct target_core_fabric_ops->check_stop_free() |
207 | */ | 207 | */ |
208 | static void tcm_loop_check_stop_free(struct se_cmd *se_cmd) | 208 | static int tcm_loop_check_stop_free(struct se_cmd *se_cmd) |
209 | { | 209 | { |
210 | /* | 210 | /* |
211 | * Do not release struct se_cmd's containing a valid TMR | 211 | * Do not release struct se_cmd's containing a valid TMR |
@@ -213,12 +213,13 @@ static void tcm_loop_check_stop_free(struct se_cmd *se_cmd) | |||
213 | * with transport_generic_free_cmd(). | 213 | * with transport_generic_free_cmd(). |
214 | */ | 214 | */ |
215 | if (se_cmd->se_tmr_req) | 215 | if (se_cmd->se_tmr_req) |
216 | return; | 216 | return 0; |
217 | /* | 217 | /* |
218 | * Release the struct se_cmd, which will make a callback to release | 218 | * Release the struct se_cmd, which will make a callback to release |
219 | * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd() | 219 | * struct tcm_loop_cmd * in tcm_loop_deallocate_core_cmd() |
220 | */ | 220 | */ |
221 | transport_generic_free_cmd(se_cmd, 0); | 221 | transport_generic_free_cmd(se_cmd, 0); |
222 | return 1; | ||
222 | } | 223 | } |
223 | 224 | ||
224 | static void tcm_loop_release_cmd(struct se_cmd *se_cmd) | 225 | static void tcm_loop_release_cmd(struct se_cmd *se_cmd) |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 5dee44639f8f..bf8867f44021 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -514,13 +514,16 @@ static int transport_cmd_check_stop( | |||
514 | * Some fabric modules like tcm_loop can release | 514 | * Some fabric modules like tcm_loop can release |
515 | * their internally allocated I/O reference now and | 515 | * their internally allocated I/O reference now and |
516 | * struct se_cmd now. | 516 | * struct se_cmd now. |
517 | * | ||
518 | * Fabric modules are expected to return '1' here if the | ||
519 | * se_cmd being passed is released at this point, | ||
520 | * or zero if not being released. | ||
517 | */ | 521 | */ |
518 | if (cmd->se_tfo->check_stop_free != NULL) { | 522 | if (cmd->se_tfo->check_stop_free != NULL) { |
519 | spin_unlock_irqrestore( | 523 | spin_unlock_irqrestore( |
520 | &cmd->t_state_lock, flags); | 524 | &cmd->t_state_lock, flags); |
521 | 525 | ||
522 | cmd->se_tfo->check_stop_free(cmd); | 526 | return cmd->se_tfo->check_stop_free(cmd); |
523 | return 1; | ||
524 | } | 527 | } |
525 | } | 528 | } |
526 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 529 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
diff --git a/drivers/target/tcm_fc/tcm_fc.h b/drivers/target/tcm_fc/tcm_fc.h index 3749d8b4b423..e05c55100ec6 100644 --- a/drivers/target/tcm_fc/tcm_fc.h +++ b/drivers/target/tcm_fc/tcm_fc.h | |||
@@ -156,7 +156,7 @@ int ft_lport_notify(struct notifier_block *, unsigned long, void *); | |||
156 | /* | 156 | /* |
157 | * IO methods. | 157 | * IO methods. |
158 | */ | 158 | */ |
159 | void ft_check_stop_free(struct se_cmd *); | 159 | int ft_check_stop_free(struct se_cmd *); |
160 | void ft_release_cmd(struct se_cmd *); | 160 | void ft_release_cmd(struct se_cmd *); |
161 | int ft_queue_status(struct se_cmd *); | 161 | int ft_queue_status(struct se_cmd *); |
162 | int ft_queue_data_in(struct se_cmd *); | 162 | int ft_queue_data_in(struct se_cmd *); |
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index 6195026cc7b0..4fac37c4c615 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c | |||
@@ -112,9 +112,10 @@ void ft_release_cmd(struct se_cmd *se_cmd) | |||
112 | ft_free_cmd(cmd); | 112 | ft_free_cmd(cmd); |
113 | } | 113 | } |
114 | 114 | ||
115 | void ft_check_stop_free(struct se_cmd *se_cmd) | 115 | int ft_check_stop_free(struct se_cmd *se_cmd) |
116 | { | 116 | { |
117 | transport_generic_free_cmd(se_cmd, 0); | 117 | transport_generic_free_cmd(se_cmd, 0); |
118 | return 1; | ||
118 | } | 119 | } |
119 | 120 | ||
120 | /* | 121 | /* |
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h index 126c675f4f14..04c591da0844 100644 --- a/include/target/target_core_fabric_ops.h +++ b/include/target/target_core_fabric_ops.h | |||
@@ -46,9 +46,12 @@ struct target_core_fabric_ops { | |||
46 | int (*new_cmd_map)(struct se_cmd *); | 46 | int (*new_cmd_map)(struct se_cmd *); |
47 | /* | 47 | /* |
48 | * Optional to release struct se_cmd and fabric dependent allocated | 48 | * Optional to release struct se_cmd and fabric dependent allocated |
49 | * I/O descriptor in transport_cmd_check_stop() | 49 | * I/O descriptor in transport_cmd_check_stop(). |
50 | * | ||
51 | * Returning 1 will signal a descriptor has been released. | ||
52 | * Returning 0 will signal a descriptor has not been released. | ||
50 | */ | 53 | */ |
51 | void (*check_stop_free)(struct se_cmd *); | 54 | int (*check_stop_free)(struct se_cmd *); |
52 | void (*release_cmd)(struct se_cmd *); | 55 | void (*release_cmd)(struct se_cmd *); |
53 | /* | 56 | /* |
54 | * Called with spin_lock_bh(struct se_portal_group->session_lock held. | 57 | * Called with spin_lock_bh(struct se_portal_group->session_lock held. |