diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2008-09-19 18:47:20 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-10-13 09:28:58 -0400 |
commit | be922f478f430f8fab4db952ffc20c86f23de397 (patch) | |
tree | ce172a3979decae14130819313a26fd039537a4d /drivers | |
parent | bd623e79fb6bca7ab685bb1f7376476a81ce10bb (diff) |
[SCSI] sd: Always print actual protection_type
Now that we no longer use protection_type as trigger for preparing
protected CDBs we can remove the places that set it to zero. This
allows userland to see which protection type the device is formatted
with regardless of whether the HBA supports DIF or not.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/sd.c | 7 | ||||
-rw-r--r-- | drivers/scsi/sd_dif.c | 1 |
2 files changed, 2 insertions, 6 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index fec034557c38..a494a2ec67d7 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1253,14 +1253,12 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer) | |||
1253 | else | 1253 | else |
1254 | type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ | 1254 | type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */ |
1255 | 1255 | ||
1256 | sdkp->protection_type = type; | ||
1257 | |||
1256 | switch (type) { | 1258 | switch (type) { |
1257 | case SD_DIF_TYPE0_PROTECTION: | 1259 | case SD_DIF_TYPE0_PROTECTION: |
1258 | sdkp->protection_type = 0; | ||
1259 | break; | ||
1260 | |||
1261 | case SD_DIF_TYPE1_PROTECTION: | 1260 | case SD_DIF_TYPE1_PROTECTION: |
1262 | case SD_DIF_TYPE3_PROTECTION: | 1261 | case SD_DIF_TYPE3_PROTECTION: |
1263 | sdkp->protection_type = type; | ||
1264 | break; | 1262 | break; |
1265 | 1263 | ||
1266 | case SD_DIF_TYPE2_PROTECTION: | 1264 | case SD_DIF_TYPE2_PROTECTION: |
@@ -1278,7 +1276,6 @@ void sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer) | |||
1278 | return; | 1276 | return; |
1279 | 1277 | ||
1280 | disable: | 1278 | disable: |
1281 | sdkp->protection_type = 0; | ||
1282 | sdkp->capacity = 0; | 1279 | sdkp->capacity = 0; |
1283 | } | 1280 | } |
1284 | 1281 | ||
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index 4d17f3d35aac..943fde7e7ffb 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c | |||
@@ -321,7 +321,6 @@ void sd_dif_config_host(struct scsi_disk *sdkp) | |||
321 | if (scsi_host_dif_capable(sdp->host, type) == 0) { | 321 | if (scsi_host_dif_capable(sdp->host, type) == 0) { |
322 | sd_printk(KERN_INFO, sdkp, "Type %d protection " \ | 322 | sd_printk(KERN_INFO, sdkp, "Type %d protection " \ |
323 | "unsupported by HBA. Disabling DIF.\n", type); | 323 | "unsupported by HBA. Disabling DIF.\n", type); |
324 | sdkp->protection_type = 0; | ||
325 | return; | 324 | return; |
326 | } | 325 | } |
327 | 326 | ||