|
@@ -454,19 +454,6 @@ check_scsi_name:
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(spc_emulate_evpd_83);
|
|
EXPORT_SYMBOL(spc_emulate_evpd_83);
|
|
|
|
|
|
-static bool
|
|
|
|
-spc_check_dev_wce(struct se_device *dev)
|
|
|
|
-{
|
|
|
|
- bool wce = false;
|
|
|
|
-
|
|
|
|
- if (dev->transport->get_write_cache)
|
|
|
|
- wce = dev->transport->get_write_cache(dev);
|
|
|
|
- else if (dev->dev_attrib.emulate_write_cache > 0)
|
|
|
|
- wce = true;
|
|
|
|
-
|
|
|
|
- return wce;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/* Extended INQUIRY Data VPD Page */
|
|
/* Extended INQUIRY Data VPD Page */
|
|
static sense_reason_t
|
|
static sense_reason_t
|
|
spc_emulate_evpd_86(struct se_cmd *cmd, unsigned char *buf)
|
|
spc_emulate_evpd_86(struct se_cmd *cmd, unsigned char *buf)
|
|
@@ -490,7 +477,7 @@ spc_emulate_evpd_86(struct se_cmd *cmd, unsigned char *buf)
|
|
buf[5] = 0x07;
|
|
buf[5] = 0x07;
|
|
|
|
|
|
/* If WriteCache emulation is enabled, set V_SUP */
|
|
/* If WriteCache emulation is enabled, set V_SUP */
|
|
- if (spc_check_dev_wce(dev))
|
|
|
|
|
|
+ if (se_dev_check_wce(dev))
|
|
buf[6] = 0x01;
|
|
buf[6] = 0x01;
|
|
/* If an LBA map is present set R_SUP */
|
|
/* If an LBA map is present set R_SUP */
|
|
spin_lock(&cmd->se_dev->t10_alua.lba_map_lock);
|
|
spin_lock(&cmd->se_dev->t10_alua.lba_map_lock);
|
|
@@ -897,7 +884,7 @@ static int spc_modesense_caching(struct se_cmd *cmd, u8 pc, u8 *p)
|
|
if (pc == 1)
|
|
if (pc == 1)
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
- if (spc_check_dev_wce(dev))
|
|
|
|
|
|
+ if (se_dev_check_wce(dev))
|
|
p[2] = 0x04; /* Write Cache Enable */
|
|
p[2] = 0x04; /* Write Cache Enable */
|
|
p[12] = 0x20; /* Disabled Read Ahead */
|
|
p[12] = 0x20; /* Disabled Read Ahead */
|
|
|
|
|
|
@@ -1009,7 +996,7 @@ static sense_reason_t spc_emulate_modesense(struct se_cmd *cmd)
|
|
(cmd->se_deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY)))
|
|
(cmd->se_deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY)))
|
|
spc_modesense_write_protect(&buf[length], type);
|
|
spc_modesense_write_protect(&buf[length], type);
|
|
|
|
|
|
- if ((spc_check_dev_wce(dev)) &&
|
|
|
|
|
|
+ if ((se_dev_check_wce(dev)) &&
|
|
(dev->dev_attrib.emulate_fua_write > 0))
|
|
(dev->dev_attrib.emulate_fua_write > 0))
|
|
spc_modesense_dpofua(&buf[length], type);
|
|
spc_modesense_dpofua(&buf[length], type);
|
|
|
|
|