summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_internal.h
diff options
context:
space:
mode:
authorMaurizio Lombardi <mlombard@redhat.com>2025-07-14 15:37:38 +0200
committerMartin K. Petersen <martin.petersen@oracle.com>2025-07-24 21:57:00 -0400
commit6e0f6aa44b68335df404a2df955055f416b5f2aa (patch)
tree63653cf168957b8c9b93422bcf57e371173af07e /drivers/target/target_core_internal.h
parent220e6083e8bdc11c414c2a44643f739d5c826d7b (diff)
downloadlinux-next-6e0f6aa44b68335df404a2df955055f416b5f2aa.tar.gz
linux-next-6e0f6aa44b68335df404a2df955055f416b5f2aa.zip
scsi: target: core: Generate correct identifiers for PR OUT transport IDs
Fix target_parse_pr_out_transport_id() to return a string representing the transport ID in a human-readable format (e.g., naa.xxxxxxxx...) for various SCSI protocol types (SAS, FCP, SRP, SBP). Previously, the function returned a pointer to the raw binary buffer, which was incorrectly compared against human-readable strings, causing comparisons to fail. Now, the function writes a properly formatted string into a buffer provided by the caller. The output format depends on the transport protocol: * SAS: 64-bit identifier, "naa." prefix. * FCP: 64-bit identifier, colon separated values. * SBP: 64-bit identifier, no prefix. * SRP: 128-bit identifier, "0x" prefix. * iSCSI: IQN string. Signed-off-by: Maurizio Lombardi <mlombard@redhat.com> Link: https://lore.kernel.org/r/20250714133738.11054-1-mlombard@redhat.com Reviewed-by: Dmitry Bogdanov <d.bogdanov@yadro.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_internal.h')
-rw-r--r--drivers/target/target_core_internal.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_internal.h
index 408be26d2e9b..20aab1f50565 100644
--- a/drivers/target/target_core_internal.h
+++ b/drivers/target/target_core_internal.h
@@ -103,8 +103,8 @@ int target_get_pr_transport_id_len(struct se_node_acl *nacl,
int target_get_pr_transport_id(struct se_node_acl *nacl,
struct t10_pr_registration *pr_reg, int *format_code,
unsigned char *buf);
-const char *target_parse_pr_out_transport_id(struct se_portal_group *tpg,
- char *buf, u32 *out_tid_len, char **port_nexus_ptr);
+bool target_parse_pr_out_transport_id(struct se_portal_group *tpg,
+ char *buf, u32 *out_tid_len, char **port_nexus_ptr, char *i_str);
/* target_core_hba.c */
struct se_hba *core_alloc_hba(const char *, u32, u32);