aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2009-11-26 22:46:03 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-12-03 18:01:04 -0500
commite78db4dfb1355a895f7ea50133b702b55b8ed184 (patch)
tree13052100a353857ff07dbb0a3c78fdc713e58bcb /include/linux
parentd413ff3e2aa09a4ebef718dbc4be4356f879467f (diff)
libata: Report zeroed read after TRIM and max discard size
Our current TRIM payload is a single sector that can accommodate 64 * 65535 blocks being unmapped. Report this value in the Block Limits Maximum Unmap LBA count field. If a storage device supports TRIM and the DRAT and RZAT bits are set, report TPRZ=1 in Read Capacity(16). Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index e2595e877e44..dfa2298bf488 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -75,6 +75,7 @@ enum {
75 ATA_ID_EIDE_DMA_TIME = 66, 75 ATA_ID_EIDE_DMA_TIME = 66,
76 ATA_ID_EIDE_PIO = 67, 76 ATA_ID_EIDE_PIO = 67,
77 ATA_ID_EIDE_PIO_IORDY = 68, 77 ATA_ID_EIDE_PIO_IORDY = 68,
78 ATA_ID_ADDITIONAL_SUPP = 69,
78 ATA_ID_QUEUE_DEPTH = 75, 79 ATA_ID_QUEUE_DEPTH = 75,
79 ATA_ID_MAJOR_VER = 80, 80 ATA_ID_MAJOR_VER = 80,
80 ATA_ID_COMMAND_SET_1 = 82, 81 ATA_ID_COMMAND_SET_1 = 82,
@@ -816,6 +817,16 @@ static inline int ata_id_has_trim(const u16 *id)
816 return 0; 817 return 0;
817} 818}
818 819
820static inline int ata_id_has_zero_after_trim(const u16 *id)
821{
822 /* DSM supported, deterministic read, and read zero after trim set */
823 if (ata_id_has_trim(id) &&
824 (id[ATA_ID_ADDITIONAL_SUPP] & 0x4020) == 0x4020)
825 return 1;
826
827 return 0;
828}
829
819static inline int ata_id_current_chs_valid(const u16 *id) 830static inline int ata_id_current_chs_valid(const u16 *id)
820{ 831{
821 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 832 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command