Commit 4703b625 authored by Bodo Stroesser's avatar Bodo Stroesser Committed by Martin K. Petersen

scsi: target: tcmu: Add attributes enforce_pr_isids and force_pr_aptpl

tcmu has not set TRANSPORT_FLAG_PASSTHROUGH_PGR. Therefore the in-core pr
emulation is active by default, but there are some attributes for
configuration missing. Add them.

Link: https://lore.kernel.org/r/20200427150823.15350-3-bstroesser@ts.fujitsu.comReviewed-by: default avatarMike Christie <mchristi@redhat.com>
Signed-off-by: default avatarBodo Stroesser <bstroesser@ts.fujitsu.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 92999417
......@@ -1210,6 +1210,17 @@ struct configfs_attribute *passthrough_attrib_attrs[] = {
};
EXPORT_SYMBOL(passthrough_attrib_attrs);
/*
* pr related dev_attrib attributes for devices passing through CDBs,
* but allowing in core pr emulation.
*/
struct configfs_attribute *passthrough_pr_attrib_attrs[] = {
&attr_enforce_pr_isids,
&attr_force_pr_aptpl,
NULL,
};
EXPORT_SYMBOL(passthrough_pr_attrib_attrs);
TB_CIT_SETUP_DRV(dev_attrib, NULL, NULL);
TB_CIT_SETUP_DRV(dev_action, NULL, NULL);
......
......@@ -2752,12 +2752,12 @@ static int __init tcmu_module_init(void)
goto out_unreg_device;
}
for (i = 0; passthrough_attrib_attrs[i] != NULL; i++) {
for (i = 0; passthrough_attrib_attrs[i] != NULL; i++)
len += sizeof(struct configfs_attribute *);
}
for (i = 0; tcmu_attrib_attrs[i] != NULL; i++) {
for (i = 0; passthrough_pr_attrib_attrs[i] != NULL; i++)
len += sizeof(struct configfs_attribute *);
for (i = 0; tcmu_attrib_attrs[i] != NULL; i++)
len += sizeof(struct configfs_attribute *);
}
len += sizeof(struct configfs_attribute *);
tcmu_attrs = kzalloc(len, GFP_KERNEL);
......@@ -2766,13 +2766,12 @@ static int __init tcmu_module_init(void)
goto out_unreg_genl;
}
for (i = 0; passthrough_attrib_attrs[i] != NULL; i++) {
for (i = 0; passthrough_attrib_attrs[i] != NULL; i++)
tcmu_attrs[i] = passthrough_attrib_attrs[i];
}
for (k = 0; tcmu_attrib_attrs[k] != NULL; k++) {
tcmu_attrs[i] = tcmu_attrib_attrs[k];
i++;
}
for (k = 0; passthrough_pr_attrib_attrs[k] != NULL; k++)
tcmu_attrs[i++] = passthrough_pr_attrib_attrs[k];
for (k = 0; tcmu_attrib_attrs[k] != NULL; k++)
tcmu_attrs[i++] = tcmu_attrib_attrs[k];
tcmu_ops.tb_dev_attrib_attrs = tcmu_attrs;
ret = transport_backend_register(&tcmu_ops);
......
......@@ -94,6 +94,7 @@ int transport_set_vpd_ident(struct t10_vpd *, unsigned char *);
extern struct configfs_attribute *sbc_attrib_attrs[];
extern struct configfs_attribute *passthrough_attrib_attrs[];
extern struct configfs_attribute *passthrough_pr_attrib_attrs[];
/* core helpers also used by command snooping in pscsi */
void *transport_kmap_data_sg(struct se_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