diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2014-09-26 19:20:03 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2014-09-27 11:14:51 -0400 |
commit | 3aec2f41a8baeb70aa77556a4e4dcec7d9d70b4d (patch) | |
tree | 2725a81cae556798bd3f363c4e8e5595c1ce1aaf /drivers/scsi | |
parent | 8288f496eb1b1905c425e92eaf1abbb29119217b (diff) |
block: Add a disk flag to block integrity profile
So far we have relied on the app tag size to determine whether a disk
has been formatted with T10 protection information or not. However, not
all target devices provide application tag storage.
Add a flag to the block integrity profile that indicates whether the
disk has been formatted with protection information.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Sagi Grimberg <sagig@dev.mellanox.co.il>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/sd_dif.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/sd_dif.c b/drivers/scsi/sd_dif.c index 801c41851a01..1e971c6f8c2b 100644 --- a/drivers/scsi/sd_dif.c +++ b/drivers/scsi/sd_dif.c | |||
@@ -270,7 +270,13 @@ void sd_dif_config_host(struct scsi_disk *sdkp) | |||
270 | "Enabling DIX %s protection\n", disk->integrity->name); | 270 | "Enabling DIX %s protection\n", disk->integrity->name); |
271 | 271 | ||
272 | /* Signal to block layer that we support sector tagging */ | 272 | /* Signal to block layer that we support sector tagging */ |
273 | if (dif && type && sdkp->ATO) { | 273 | if (dif && type) { |
274 | |||
275 | disk->integrity->flags |= BLK_INTEGRITY_DEVICE_CAPABLE; | ||
276 | |||
277 | if (!sdkp) | ||
278 | return; | ||
279 | |||
274 | if (type == SD_DIF_TYPE3_PROTECTION) | 280 | if (type == SD_DIF_TYPE3_PROTECTION) |
275 | disk->integrity->tag_size = sizeof(u16) + sizeof(u32); | 281 | disk->integrity->tag_size = sizeof(u16) + sizeof(u32); |
276 | else | 282 | else |