summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorShaun Tancheff <shaun@tancheff.com>2016-08-22 06:23:18 +0200
committerTejun Heo <tj@kernel.org>2016-08-25 17:26:48 +0200
commit9379e6b8e0f995365dc6158a1463c8dab4f2c8da (patch)
tree22d3a77eaa583229d0f7cfba7d9dec04aa64839c /include
parentahci: also use a per-port lock for the multi-MSIX case (diff)
downloadlinux-9379e6b8e0f995365dc6158a1463c8dab4f2c8da.tar.xz
linux-9379e6b8e0f995365dc6158a1463c8dab4f2c8da.zip
libata: Safely overwrite attached page in WRITE SAME xlat
Safely overwriting the attached page to ATA format from the SCSI formatted variant. Signed-off-by: Shaun Tancheff <shaun.tancheff@seagate.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Acked-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/ata.h26
1 files changed, 0 insertions, 26 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index adbc812c009b..45a1d71c55f1 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -1071,32 +1071,6 @@ static inline void ata_id_to_hd_driveid(u16 *id)
#endif
}
-/*
- * Write LBA Range Entries to the buffer that will cover the extent from
- * sector to sector + count. This is used for TRIM and for ADD LBA(S)
- * TO NV CACHE PINNED SET.
- */
-static inline unsigned ata_set_lba_range_entries(void *_buffer,
- unsigned num, u64 sector, unsigned long count)
-{
- __le64 *buffer = _buffer;
- unsigned i = 0, used_bytes;
-
- while (i < num) {
- u64 entry = sector |
- ((u64)(count > 0xffff ? 0xffff : count) << 48);
- buffer[i++] = __cpu_to_le64(entry);
- if (count <= 0xffff)
- break;
- count -= 0xffff;
- sector += 0xffff;
- }
-
- used_bytes = ALIGN(i * 8, 512);
- memset(buffer + i, 0, used_bytes - i * 8);
- return used_bytes;
-}
-
static inline bool ata_ok(u8 status)
{
return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))