Re: [PATCH RFC 03/22] scsi: Take an array of failures for passthrough

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/22/22 03:06, Mike Christie wrote:
@@ -458,24 +459,26 @@ extern int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
  			int data_direction, void *buffer, unsigned bufflen,
  			unsigned char *sense, struct scsi_sense_hdr *sshdr,
  			int timeout, int retries, blk_opf_t flags,
-			req_flags_t rq_flags, int *resid);
+			req_flags_t rq_flags, int *resid,
+			struct scsi_failure *failures);
  /* Make sure any sense buffer is the correct size. */
  #define scsi_execute(sdev, cmd, data_direction, buffer, bufflen, sense,	\
-		     sshdr, timeout, retries, flags, rq_flags, resid)	\
+		     sshdr, timeout, retries, flags, rq_flags, resid,	\
+		     failures)						\
  ({									\
  	BUILD_BUG_ON((sense) != NULL &&					\
  		     sizeof(sense) != SCSI_SENSE_BUFFERSIZE);		\
  	__scsi_execute(sdev, cmd, data_direction, buffer, bufflen,	\
  		       sense, sshdr, timeout, retries, flags, rq_flags,	\
-		       resid);						\
+		       resid, failures);				\
  })
  static inline int scsi_execute_req(struct scsi_device *sdev,
  	const unsigned char *cmd, int data_direction, void *buffer,
  	unsigned bufflen, struct scsi_sense_hdr *sshdr, int timeout,
-	int retries, int *resid)
+	int retries, int *resid, struct scsi_failure *failures)
  {
-	return scsi_execute(sdev, cmd, data_direction, buffer,
-		bufflen, NULL, sshdr, timeout, retries,  0, 0, resid);
+	return scsi_execute(sdev, cmd, data_direction, buffer, bufflen, NULL,
+			    sshdr, timeout, retries,  0, 0, resid, failures);
  }

Both scsi_execute() and scsi_execute_req() have way too many arguments. Please do not add any new arguments but instead convert the existing and new arguments into a struct. That will allow callers to be written e.g. as follows:

	scsi_execute((struct scsi_execute_args){.sdev = ..., .cmd = ...,
			...});

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux