@@ -2719,6 +2719,11 @@ core_scsi3_emulate_pro_clear(struct se_cmd *cmd, u64 res_key)
struct t10_pr_registration *pr_reg, *pr_reg_tmp, *pr_reg_n, *pr_res_holder;
u64 pr_res_mapped_lun = 0;
int calling_it_nexus = 0;
+
+ if (dev->transport->pr_ops && dev->transport->pr_ops->pr_read_keys
+ && dev->passthrough_pr)
+ return dev->transport->pr_ops->pr_clear(cmd, res_key);
+
/*
* Locate the existing *pr_reg via struct se_node_acl pointers
*/
@@ -4115,6 +4115,7 @@ static struct target_pr_ops tcmu_pr_ops = {
.pr_register = tcmu_execute_pr_register,
.pr_reserve = tcmu_execute_pr_reserve,
.pr_release = tcmu_execute_pr_release,
+ .pr_clear = tcmu_execute_pr_clear,
};
static struct target_backend_ops tcmu_ops = {
This patch would enable the passthrough Persist Reservation clear operation routine for TCMU devices. If dev->passthrough_pr is 1, both dev->transport->pr_ops and dev->transport->pr_ops->pr_clear are not NULL, core_scsi3_emulate_pro_clear() will call dev->transport->pr_ops->pr_clear to passthrough PR clear request to user space Signed-off-by: Zhu Lingshan <lszhu@suse.com> --- drivers/target/target_core_pr.c | 5 +++++ drivers/target/target_core_user.c | 1 + 2 files changed, 6 insertions(+)