summaryrefslogtreecommitdiff
path: root/include/linux/libata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-05-15 20:58:19 +0900
committerTejun Heo <htejun@gmail.com>2006-05-15 20:58:19 +0900
commit0c247c559cd70f85ba9f0764ce13ae00e20fcad8 (patch)
tree9b0d00b300ad9178438b9c7feba95ed62f540c1a /include/linux/libata.h
parent9be1e979f2e1e57a091a658fa88dac266f9fd6fe (diff)
[PATCH] libata-eh: implement dev->ering
This patch implements ata_ering and uses it to define dev->ering. ata_ering is a ring buffer which records libata errors - whether a command was for normar IO request, err_mask and timestamp. Errors are recorded per-device in dev->ering. This will be used by EH to determine recovery actions. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 6fe5ed8eabf5..f5cea13599c3 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -226,6 +226,9 @@ enum {
ATA_PORT_PRIMARY = (1 << 0),
ATA_PORT_SECONDARY = (1 << 1),
+ /* ering size */
+ ATA_ERING_SIZE = 32,
+
/* reset / recovery action types */
ATA_EH_REVALIDATE = (1 << 0),
ATA_EH_SOFTRESET = (1 << 1),
@@ -375,6 +378,17 @@ struct ata_host_stats {
unsigned long rw_reqbuf;
};
+struct ata_ering_entry {
+ int is_io;
+ unsigned int err_mask;
+ u64 timestamp;
+};
+
+struct ata_ering {
+ int cursor;
+ struct ata_ering_entry ring[ATA_ERING_SIZE];
+};
+
struct ata_device {
struct ata_port *ap;
u64 n_sectors; /* size of device, if ATA */
@@ -401,6 +415,9 @@ struct ata_device {
u16 cylinders; /* Number of cylinders */
u16 heads; /* Number of heads */
u16 sectors; /* Number of sectors per track */
+
+ /* error history */
+ struct ata_ering ering;
};
struct ata_port {