]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - smartctl.cpp
Imported Upstream version 6.2+svn3841
[mirror_smartmontools-debian.git] / smartctl.cpp
index 190f9f3af6ded2e07b89ab0066e8b5746cd4404e..61c7c93e30c0be72a36ef543fc1aff81c71b5480 100644 (file)
@@ -50,7 +50,7 @@
 #include "smartctl.h"
 #include "utility.h"
 
-const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 3726 2012-12-12 20:02:48Z chrfranke $"
+const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 3826 2013-07-06 21:57:29Z samm2 $"
   CONFIG_H_CVSID SMARTCTL_H_CVSID;
 
 // Globals to control printing
@@ -85,7 +85,7 @@ static void Usage()
 "  --identify[=[w][nvb]]\n"
 "         Show words and bits from IDENTIFY DEVICE data                (ATA)\n\n"
 "  -g NAME, --get=NAME\n"
-"        Get device setting: all, aam, apm, lookahead, security, wcache, rcache\n\n"
+"        Get device setting: all, aam, apm, lookahead, security, wcache, rcache, wcreorder\n\n"
 "  -a, --all\n"
 "         Show all SMART information for device\n\n"
 "  -x, --xall\n"
@@ -121,7 +121,7 @@ static void Usage()
 "  -s NAME[,VALUE], --set=NAME[,VALUE]\n"
 "        Enable/disable/change device setting: aam,[N|off], apm,[N|off],\n"
 "        lookahead,[on|off], security-freeze, standby,[N|off|now],\n"
-"        wcache,[on|off], rcache,[on|off]\n\n"
+"        wcache,[on|off], rcache,[on|off], wcreorder,[on|off]\n\n"
   );
   printf(
 "======================================= READ AND DISPLAY DATA OPTIONS =====\n\n"
@@ -218,10 +218,10 @@ static std::string getvalidarglist(int opt)
   case 'f':
     return "old, brief, hex[,id|val]";
   case 'g':
-    return "aam, apm, lookahead, security, wcache, rcache";
+    return "aam, apm, lookahead, security, wcache, rcache, wcreorder";
   case opt_set:
     return "aam,[N|off], apm,[N|off], lookahead,[on|off], security-freeze, "
-           "standby,[N|off|now], wcache,[on|off], rcache,[on|off]";
+           "standby,[N|off|now], wcache,[on|off], rcache,[on|off], wcreorder,[on|off]";
   case 's':
     return getvalidarglist(opt_smart)+", "+getvalidarglist(opt_set);
   case opt_identify:
@@ -626,6 +626,7 @@ static const char * parse_options(int argc, char** argv,
       ataopts.smart_logdir = ataopts.gp_logdir = true;
       ataopts.sct_temp_sts = ataopts.sct_temp_hist = true;
       ataopts.sct_erc_get = true;
+      ataopts.sct_wcache_reorder_get = true;
       ataopts.devstat_all_pages = true;
       ataopts.sataphy = true;
       ataopts.get_set_used = true;
@@ -867,6 +868,17 @@ static const char * parse_options(int argc, char** argv,
             else
               badarg = true;
           }
+          else if (!strcmp(name, "wcreorder")) {
+            if (get) {
+              ataopts.sct_wcache_reorder_get = true;
+            }
+            else if (off)
+              ataopts.sct_wcache_reorder_set = -1;
+            else if (on)
+              ataopts.sct_wcache_reorder_set = 1;
+            else
+              badarg = true;
+          }
           else if (!strcmp(name, "rcache")) {
             if (get)
               scsiopts.get_rcd = true;