mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 11:19:37 +00:00
scsi: cxlflash: Remove zeroing of private command data
The SCSI core now zeroes the per-command private data area prior to calling into the LLD. Replace the clearing operation that takes place when the private command data reference is obtained with a routine that performs common initializations. The zeroing that takes place in the device reset path remains intact as the private command data associated with the specified SCSI command is not guaranteed to be cleared. Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com> Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
3223c01aa1
commit
479ad8e9d4
2 changed files with 10 additions and 3 deletions
|
@ -178,13 +178,20 @@ static inline struct afu_cmd *sc_to_afuc(struct scsi_cmnd *sc)
|
||||||
return PTR_ALIGN(scsi_cmd_priv(sc), __alignof__(struct afu_cmd));
|
return PTR_ALIGN(scsi_cmd_priv(sc), __alignof__(struct afu_cmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline struct afu_cmd *sc_to_afuci(struct scsi_cmnd *sc)
|
||||||
|
{
|
||||||
|
struct afu_cmd *afuc = sc_to_afuc(sc);
|
||||||
|
|
||||||
|
INIT_LIST_HEAD(&afuc->queue);
|
||||||
|
return afuc;
|
||||||
|
}
|
||||||
|
|
||||||
static inline struct afu_cmd *sc_to_afucz(struct scsi_cmnd *sc)
|
static inline struct afu_cmd *sc_to_afucz(struct scsi_cmnd *sc)
|
||||||
{
|
{
|
||||||
struct afu_cmd *afuc = sc_to_afuc(sc);
|
struct afu_cmd *afuc = sc_to_afuc(sc);
|
||||||
|
|
||||||
memset(afuc, 0, sizeof(*afuc));
|
memset(afuc, 0, sizeof(*afuc));
|
||||||
INIT_LIST_HEAD(&afuc->queue);
|
return sc_to_afuci(sc);
|
||||||
return afuc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hwq {
|
struct hwq {
|
||||||
|
|
|
@ -543,7 +543,7 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
|
||||||
struct cxlflash_cfg *cfg = shost_priv(host);
|
struct cxlflash_cfg *cfg = shost_priv(host);
|
||||||
struct afu *afu = cfg->afu;
|
struct afu *afu = cfg->afu;
|
||||||
struct device *dev = &cfg->dev->dev;
|
struct device *dev = &cfg->dev->dev;
|
||||||
struct afu_cmd *cmd = sc_to_afucz(scp);
|
struct afu_cmd *cmd = sc_to_afuci(scp);
|
||||||
struct scatterlist *sg = scsi_sglist(scp);
|
struct scatterlist *sg = scsi_sglist(scp);
|
||||||
int hwq_index = cmd_to_target_hwq(host, scp, afu);
|
int hwq_index = cmd_to_target_hwq(host, scp, afu);
|
||||||
struct hwq *hwq = get_hwq(afu, hwq_index);
|
struct hwq *hwq = get_hwq(afu, hwq_index);
|
||||||
|
|
Loading…
Reference in a new issue