Skip to contentSkip to conversation

target: drop unused pi_prot_format attribute storage

PATCH Applied David Disseldorp 2 participants 2 messages Nov 23, 2018 – Nov 26, 2018 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 target: drop unused pi_prot_format attribute storage

On write, the pi_prot_format configfs attribute invokes the device format_prot() callback if present. Read dumps the contents of se_dev_attrib.pi_prot_format , which is always zero. Make the configfs attribute write-only, and drop the always zero se_dev_attrib.pi_prot_format storage.

---
 drivers/target/target_core_configfs.c | 3 +--
 include/target/target_core_base.h     | 1 -
 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/target/target_core_configfs.c +1 -2
index 70b9f6755c36..62427acdf503 100644
@@ -535,7 +535,6 @@ DEF_CONFIGFS_ATTRIB_SHOW(emulate_3pc);
 DEF_CONFIGFS_ATTRIB_SHOW(emulate_pr);
 DEF_CONFIGFS_ATTRIB_SHOW(pi_prot_type);
 DEF_CONFIGFS_ATTRIB_SHOW(hw_pi_prot_type);
-DEF_CONFIGFS_ATTRIB_SHOW(pi_prot_format);
 DEF_CONFIGFS_ATTRIB_SHOW(pi_prot_verify);
 DEF_CONFIGFS_ATTRIB_SHOW(enforce_pr_isids);
 DEF_CONFIGFS_ATTRIB_SHOW(is_nonrot);
@@ -1121,7 +1120,7 @@ CONFIGFS_ATTR(, emulate_3pc);
 CONFIGFS_ATTR(, emulate_pr);
 CONFIGFS_ATTR(, pi_prot_type);
 CONFIGFS_ATTR_RO(, hw_pi_prot_type);
-CONFIGFS_ATTR(, pi_prot_format);
+CONFIGFS_ATTR_WO(, pi_prot_format);
 CONFIGFS_ATTR(, pi_prot_verify);
 CONFIGFS_ATTR(, enforce_pr_isids);
 CONFIGFS_ATTR(, is_nonrot);
include/target/target_core_base.h +0 -1
index c15054116b86..53b90cc18902 100644
@@ -667,7 +667,6 @@ struct se_dev_attrib {
 	int		emulate_caw;
 	int		emulate_3pc;
 	int		emulate_pr;
-	int		pi_prot_format;
 	enum target_prot_type pi_prot_type;
 	enum target_prot_type hw_pi_prot_type;
 	int		pi_prot_verify;
Signature · 1 line
2.13.7
Reviewed-by on v1 1/3
#1 lore raw
Quoted 5 lines · David Disseldorp

On write, the pi_prot_format configfs attribute invokes the device format_prot() callback if present. Read dumps the contents of se_dev_attrib.pi_prot_format , which is always zero. Make the configfs attribute write-only, and drop the always zero se_dev_attrib.pi_prot_format storage.

Looks good,