[PATCH 3/8] scsi: scsi_dh_alua: Pass submit_rtpg() a bool for extended header support

John Garry john.g.garry at oracle.com
Tue Mar 10 04:49:20 PDT 2026


Currently the pg flags is passed to submit_rtpg() to allow submit_rtpg()
know whether extended header support is available.

Pass a bool instead, as when separating the driver into a pure ALUA part,
we don't want to use pg flags.

Signed-off-by: John Garry <john.g.garry at oracle.com>
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 7b360e7f11a6d..e9edd45ae28a3 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -124,7 +124,8 @@ static void release_port_group(struct kref *kref)
  * @sdev: sdev the command should be sent to
  */
 static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff,
-		       int bufflen, struct scsi_sense_hdr *sshdr, int flags)
+		       int bufflen, struct scsi_sense_hdr *sshdr,
+		       bool ext_hdr_unsupp)
 {
 	u8 cdb[MAX_COMMAND_SIZE];
 	blk_opf_t opf = REQ_OP_DRV_IN | REQ_FAILFAST_DEV |
@@ -136,10 +137,10 @@ static int submit_rtpg(struct scsi_device *sdev, unsigned char *buff,
 	/* Prepare the command. */
 	memset(cdb, 0x0, MAX_COMMAND_SIZE);
 	cdb[0] = MAINTENANCE_IN;
-	if (!(flags & ALUA_RTPG_EXT_HDR_UNSUPP))
-		cdb[1] = MI_REPORT_TARGET_PGS | MI_EXT_HDR_PARAM_FMT;
-	else
+	if (ext_hdr_unsupp)
 		cdb[1] = MI_REPORT_TARGET_PGS;
+	else
+		cdb[1] = MI_REPORT_TARGET_PGS | MI_EXT_HDR_PARAM_FMT;
 	put_unaligned_be32(bufflen, &cdb[6]);
 
 	return scsi_execute_cmd(sdev, cdb, opf, buff, bufflen,
@@ -566,7 +567,8 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_port_group *pg)
 
  retry:
 	err = 0;
-	retval = submit_rtpg(sdev, buff, bufflen, &sense_hdr, pg->flags);
+	retval = submit_rtpg(sdev, buff, bufflen, &sense_hdr,
+			pg->flags & ALUA_RTPG_EXT_HDR_UNSUPP);
 
 	if (retval) {
 		/*
-- 
2.43.5




More information about the Linux-nvme mailing list