summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojciech Piekutowski <wojciech@piekutowski.net>2011-04-12 00:21:39 +0200
committerWojciech Piekutowski <wojciech@piekutowski.net>2011-04-12 00:21:39 +0200
commitdebfdd6b14c54981af16b091c3bd7646b1d27d70 (patch)
tree8268c0139a4775a07add20e473244c551975cd61
parente1ebe022ff133955eedf3884cdec2883da04162c (diff)
Handle Total LBAs Written and Total LBSa Read
-rw-r--r--atasmart.c12
-rw-r--r--atasmart.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/atasmart.c b/atasmart.c
index d6b8511..cc35600 100644
--- a/atasmart.c
+++ b/atasmart.c
@@ -1211,6 +1211,9 @@ static void make_pretty(SkSmartAttributeParsedData *a) {
else if (!strcmp(a->name, "endurance-remaining") ||
!strcmp(a->name, "available-reserved-space"))
a->pretty_value = a->current_value;
+ else if (!strcmp(a->name, "total-lbas-written") ||
+ !strcmp(a->name, "total-lbas-read"))
+ a->pretty_value = fourtyeight * 65535 * 512 / 1000000000;
else
a->pretty_value = fourtyeight;
}
@@ -1336,6 +1339,8 @@ static const SkSmartAttributeInfo const attribute_info[256] = {
[235] = { "good-block-rate", SK_SMART_ATTRIBUTE_UNIT_UNKNOWN, NULL },
[240] = { "head-flying-hours", SK_SMART_ATTRIBUTE_UNIT_MSECONDS, verify_long_time },
+ [241] = { "total-lbas-written", SK_SMART_ATTRIBUTE_UNIT_GB, NULL },
+ [242] = { "total-lbas-read", SK_SMART_ATTRIBUTE_UNIT_GB, NULL },
[250] = { "read-error-retry-rate", SK_SMART_ATTRIBUTE_UNIT_NONE, NULL }
};
/* %STRINGPOOLSTOP% */
@@ -1928,7 +1933,8 @@ const char* sk_smart_attribute_unit_to_string(SkSmartAttributeUnit unit) {
[SK_SMART_ATTRIBUTE_UNIT_MSECONDS] = "ms",
[SK_SMART_ATTRIBUTE_UNIT_SECTORS] = "sectors",
[SK_SMART_ATTRIBUTE_UNIT_MKELVIN] = "mK",
- [SK_SMART_ATTRIBUTE_UNIT_PERCENT] = "%"
+ [SK_SMART_ATTRIBUTE_UNIT_PERCENT] = "%",
+ [SK_SMART_ATTRIBUTE_UNIT_GB] = "GB"
};
/* %STRINGPOOLSTOP% */
@@ -2269,6 +2275,10 @@ static char *print_value(char *s, size_t len, uint64_t pretty_value, SkSmartAttr
snprintf(s, len, "%llu%%", (unsigned long long) pretty_value);
break;
+ case SK_SMART_ATTRIBUTE_UNIT_GB:
+ snprintf(s, len, "%llu GB", (unsigned long long) pretty_value);
+ break;
+
case SK_SMART_ATTRIBUTE_UNIT_NONE:
snprintf(s, len, "%llu", (unsigned long long) pretty_value);
break;
diff --git a/atasmart.h b/atasmart.h
index dcb6408..cf4d217 100644
--- a/atasmart.h
+++ b/atasmart.h
@@ -134,6 +134,7 @@ typedef enum SkSmartAttributeUnit {
SK_SMART_ATTRIBUTE_UNIT_SECTORS,
SK_SMART_ATTRIBUTE_UNIT_MKELVIN, /* millikelvin */
SK_SMART_ATTRIBUTE_UNIT_PERCENT,
+ SK_SMART_ATTRIBUTE_UNIT_GB,
_SK_SMART_ATTRIBUTE_UNIT_MAX
/* This enum may be extended at any time without this being