Whamcloud - gitweb
LU-5710 all: second batch of corrected typos and grammar errors
[fs/lustre-release.git] / lustre / utils / lctl.c
index a85a13f..58cbae5 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 #include <lnet/lnetctl.h>
 #include "obdctl.h"
 #include <libcfs/libcfsutil.h>
-
-static int jt_quit(int argc, char **argv) {
-        Parser_quit(argc, argv);
-        return 0;
-}
+#include <lustre/lustre_idl.h>
 
 static int jt_noop(int argc, char **argv) {
         return 0;
@@ -79,11 +75,13 @@ command_t cmdlist[] = {
         {"lustre_build_version", jt_get_version, 0,
          "print the build version of lustre\n"
          "usage: lustre_build_version"},
-        {"exit", jt_quit, 0, "quit"},
-        {"quit", jt_quit, 0, "quit"},
+       {"exit", Parser_quit, 0, "quit"},
+       {"quit", Parser_quit, 0, "quit"},
+       {"--version", Parser_version, 0,
+        "output build version of the utility and exit"},
 
-        /* Network configuration commands */
-        {"===== network config =====", jt_noop, 0, "network config"},
+       /* Network configuration commands */
+       {"===== network config =====", jt_noop, 0, "network config"},
         {"--net", jt_opt_net, 0,"run <command> after setting network to <net>\n"
          "usage: --net <tcp/elan/o2ib/...> <command>"},
         {"network", jt_ptl_network, 0, "configure LNET"
@@ -104,8 +102,6 @@ command_t cmdlist[] = {
         {"conn_list", jt_ptl_print_connections, 0,
          "print all the connected remote nid\n"
          "usage: conn_list"},
-        {"active_tx", jt_ptl_print_active_txs, 0, "print active transmits\n"
-         "usage: active_tx"},
         {"route_list", jt_ptl_print_routes, 0,
          "print the portals routing table, same as show_route\n"
          "usage: route_list"},
@@ -114,6 +110,37 @@ command_t cmdlist[] = {
          "usage: show_route"},
         {"ping", jt_ptl_ping, 0, "Check LNET connectivity\n"
          "usage: ping nid [timeout] [pid]"},
+       {"net_drop_add", jt_ptl_drop_add, 0, "Add LNet drop rule\n"
+        "usage: net_drop_add <-s | --source NID>\n"
+        "                    <-d | --dest NID>\n"
+        "                    <<-r | --rate DROP_RATE> |\n"
+        "                     <-i | --interval SECONDS>>\n"
+        "                    [<-p | --portal> PORTAL...]\n"
+        "                    [<-m | --message> <PUT|ACK|GET|REPLY>...]\n"},
+       {"net_drop_del", jt_ptl_drop_del, 0, "remove LNet drop rule\n"
+        "usage: net_drop_del <[-a | --all] |\n"
+        "                    <-s | --source NID>\n"
+        "                    <-d | --dest NID>>\n"},
+       {"net_drop_reset", jt_ptl_drop_reset, 0, "reset drop rule stats\n"
+        "usage: net_drop_reset"},
+       {"net_drop_list", jt_ptl_drop_list, 0, "list LNet drop rules\n"
+        "usage: net_drop_list"},
+       {"net_delay_add", jt_ptl_delay_add, 0, "Add LNet delay rule\n"
+        "usage: net_delay_add <-s | --source NID>\n"
+        "                     <-d | --dest NID>\n"
+        "                     <<-r | --rate DROP_RATE> |\n"
+        "                      <-i | --interval SECONDS>>\n"
+        "                     <-l | --latency SECONDS>\n"
+        "                     [<-p | --portal> PORTAL...]\n"
+        "                     [<-m | --message> <PUT|ACK|GET|REPLY>...]\n"},
+       {"net_delay_del", jt_ptl_delay_del, 0, "remove LNet delay rule\n"
+        "usage: net_delay_del <[-a | --all] |\n"
+        "                     <-s | --source NID>\n"
+        "                     <-d | --dest NID>>\n"},
+       {"net_delay_reset", jt_ptl_delay_reset, 0, "reset delay rule stats\n"
+        "usage: net_delay_reset"},
+       {"net_delay_list", jt_ptl_delay_list, 0, "list LNet delay rules\n"
+        "usage: net_delay_list"},
 
         /* Device selection commands */
         {"==== obd device selection ====", jt_noop, 0, "device selection"},
@@ -207,7 +234,7 @@ command_t cmdlist[] = {
          "detach a lustre regular file from a virtual block device\n"
          "usage: blockdev_detach <device_name>"},
         {"blockdev_info", jt_blockdev_info, 0,
-         "get the device info of a attached file\n"
+        "get the device info of an attached file\n"
          "usage: blockdev_info <device_name>"},
 
         /* Pool commands */
@@ -230,9 +257,9 @@ command_t cmdlist[] = {
 
        /* Nodemap commands */
        {"=== Nodemap ===", jt_noop, 0, "nodemap management"},
-       {"nodemap_activate_idmap", jt_nodemap_activate, 0,
+       {"nodemap_activate", jt_nodemap_activate, 0,
         "activate nodemap idmapping functions\n"
-        "usage: nodemap_activate_idmap"},
+        "usage: nodemap_activate"},
        {"nodemap_add", jt_nodemap_add, 0,
         "add a new nodemap\n"
         "usage: nodemap_add <nodemap_name>"},
@@ -248,8 +275,14 @@ command_t cmdlist[] = {
        {"nodemap_modify", jt_nodemap_modify, 0,
         "modify a nodemap parameters"
         "usage: nodemap_modify nodemap_name param value"},
+       {"nodemap_add_idmap", jt_nodemap_add_idmap, 0,
+        "add a UID or GID mapping to a nodemap"},
+       {"nodemap_del_idmap", jt_nodemap_del_idmap, 0,
+        "delete a UID or GID mapping from a nodemap"},
        {"nodemap_test_nid", jt_nodemap_test_nid, 0,
         "usage: nodemap_test_nid <nid>"},
+       {"nodemap_test_id", jt_nodemap_test_id, 0,
+        "Usage: nodemap_test_id --nid <nid> --idtype [uid|gid] --id <id>"},
 
         /* Changelog commands */
         {"===  Changelogs ==", jt_noop, 0, "changelog user management"},
@@ -376,11 +409,13 @@ command_t cmdlist[] = {
        {"==== LFSCK ====", jt_noop, 0, "LFSCK"},
        {"lfsck_start", jt_lfsck_start, 0, "start LFSCK\n"
         "usage: lfsck_start <-M | --device [MDT,OST]_device>\n"
-        "                   [-e | --error error_handle] [-h | --help]\n"
-        "                   [-n | --dryrun switch] [-r | --reset]\n"
-        "                   [-s | --speed speed_limit] [-A | --all]\n"
+        "                   [-A | --all] [-c | --create_ostobj [on | off]]\n"
+        "                   [-C | --create_mdtobj [on | off]]\n"
+        "                   [-e | --error {continue | abort}] [-h | --help]\n"
+        "                   [-n | --dryrun [on | off]] [-o | --orphan]\n"
+        "                   [-r | --reset] [-s | --speed speed_limit]\n"
         "                   [-t | --type lfsck_type[,lfsck_type...]]\n"
-        "                   [-w | --windows win_size] [-o | --orphan]"},
+        "                   [-w | --window_size size]"},
        {"lfsck_stop", jt_lfsck_stop, 0, "stop lfsck(s)\n"
         "usage: lfsck_stop <-M | --device [MDT,OST]_device>\n"
         "                  [-A | --all] [-h | --help]"},
@@ -456,7 +491,7 @@ int lctl_main(int argc, char **argv)
         if (dbg_initialize(argc, argv) < 0)
                 exit(3);
 
-        Parser_init("lctl > ", cmdlist);
+       Parser_init("lctl > ", cmdlist);
 
         if (argc > 1) {
                 rc = Parser_execarg(argc - 1, argv + 1, cmdlist);