Commit 9c28ca4f authored by Nicholas Bellinger's avatar Nicholas Bellinger

target: Drop pointless tfo->check_stop_free check

All in-tree fabric drivers provide a tfo->check_stop_free(),
so there is no need to do the extra check within existing
transport_cmd_check_stop_to_fabric() code.

Just to be sure, add a check in target_fabric_tf_ops_check()
to notify any out-of-tree drivers that might be missing it.
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 13603685
...@@ -421,6 +421,10 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo) ...@@ -421,6 +421,10 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
pr_err("Missing tfo->aborted_task()\n"); pr_err("Missing tfo->aborted_task()\n");
return -EINVAL; return -EINVAL;
} }
if (!tfo->check_stop_free) {
pr_err("Missing tfo->check_stop_free()\n");
return -EINVAL;
}
/* /*
* We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn() * We at least require tfo->fabric_make_wwn(), tfo->fabric_drop_wwn()
* tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in * tfo->fabric_make_tpg() and tfo->fabric_drop_tpg() in
......
...@@ -636,8 +636,7 @@ static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) ...@@ -636,8 +636,7 @@ static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd)
* Fabric modules are expected to return '1' here if the se_cmd being * Fabric modules are expected to return '1' here if the se_cmd being
* passed is released at this point, or zero if not being released. * passed is released at this point, or zero if not being released.
*/ */
return cmd->se_tfo->check_stop_free ? cmd->se_tfo->check_stop_free(cmd) return cmd->se_tfo->check_stop_free(cmd);
: 0;
} }
static void transport_lun_remove_cmd(struct se_cmd *cmd) static void transport_lun_remove_cmd(struct se_cmd *cmd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment