@@ -3306,8 +3306,10 @@ static void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer)
static unsigned int sd_discard_mode(struct scsi_disk *sdkp)
{
- if (!sdkp->lbpvpd)
- /* Disable discard if LBP VPD page not provided */
+ if (!sdkp->lbpme)
+ /* LBPME was not set means the logical unit
+ * is fully provisioned, so disable discard.
+ */
return SD_LBP_DISABLE;
/* LBP VPD page tells us what to use */
@@ -3430,7 +3432,6 @@ static void sd_read_block_provisioning(struct scsi_disk *sdkp)
struct scsi_vpd *vpd;
if (!sdkp->lbpme) {
- sdkp->lbpvpd = 0;
sdkp->lbpu = 0;
sdkp->lbpws = 0;
sdkp->lbpws10 = 0;
@@ -3445,7 +3446,6 @@ static void sd_read_block_provisioning(struct scsi_disk *sdkp)
return;
}
- sdkp->lbpvpd = 1;
sdkp->lbpu = (vpd->data[5] >> 7) & 1; /* UNMAP */
sdkp->lbpws = (vpd->data[5] >> 6) & 1; /* WRITE SAME(16) w/ UNMAP */
sdkp->lbpws10 = (vpd->data[5] >> 5) & 1; /* WRITE SAME(10) w/ UNMAP */
@@ -146,7 +146,6 @@ struct scsi_disk {
unsigned lbpu : 1;
unsigned lbpws : 1;
unsigned lbpws10 : 1;
- unsigned lbpvpd : 1;
unsigned ws10 : 1;
unsigned ws16 : 1;
unsigned rc_basis: 2;