4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 only,
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License version 2 for more details (a copy is included
14 * in the LICENSE file that accompanied this code).
16 * You should have received a copy of the GNU General Public License
17 * version 2 along with this program; If not, see
18 * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
27 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
28 * Use is subject to license terms.
31 * This file is part of Lustre, http://www.lustre.org/
32 * Lustre is a trademark of Sun Microsystems, Inc.
34 * lustre/utils/obdctl.c
36 * Author: Peter J. Braam <braam@clusterfs.com>
37 * Author: Phil Schwan <phil@clusterfs.com>
44 #include <libcfs/libcfsutil.h>
46 /* the functions that were in here are now in obd.c */
48 static int jt_quit(int argc, char **argv)
51 Parser_quit(argc, argv);
56 command_t cmdlist[] = {
58 {"--device", jt_opt_device, 0, "--device <devno> <command [args ...]>"},
59 {"--threads", jt_opt_threads, 0,
60 "--threads <threads> <devno> <command [args ...]>"},
62 /* Device configuration commands */
63 {"lov_setconfig", jt_obd_lov_setconfig, 0, "configure lov data on MDS "
64 "[usage: lovconfig lov-uuid stripecount, stripesize, pattern, UUID1, [UUID2, ...]"},
65 {"list", jt_obd_list, 0, "list the devices (no args)"},
66 {"newdev", jt_obd_newdev, 0, "set device to a new unused obd (no args)"},
67 {"device", jt_obd_device, 0, "set current device (args device_no name)"},
68 {"name2dev", jt_obd_name2dev, 0,
69 "set device by name [usage: name2dev devname]"},
70 {"attach", jt_obd_attach, 0, "name the type of device (args: type data"},
71 {"setup", jt_obd_setup, 0, "setup device (args: <blkdev> [data]"},
72 {"detach", jt_obd_detach, 0, "detach the current device (arg: )"},
73 {"cleanup", jt_obd_cleanup, 0, "cleanup the current device (arg: )"},
75 /* Session commands */
76 {"connect", jt_obd_connect, 0, "connect - get a connection to device"},
77 {"disconnect", jt_obd_disconnect, 0,
78 "disconnect - break connection to device"},
80 /* Session operations */
81 {"create", jt_obd_create, 0, "create <count> [mode [verbose]]"},
82 {"destroy", jt_obd_destroy, 0, "destroy <id> [count [verbose]]"},
83 {"getattr", jt_obd_getattr, 0, "getattr <id>"},
84 {"setattr", jt_obd_setattr, 0, "setattr <id> <mode>"},
85 {"newconn", jt_obd_newconn, 0, "newconn <olduuid> [newuuid]"},
86 {"test_getattr", jt_obd_test_getattr, 0, "test_getattr <count> [verbose [[t]objid]]"},
87 {"test_setattr", jt_obd_test_setattr, 0, "test_setattr <count> [verbose [[t]objid]]"},
88 {"test_brw", jt_obd_test_brw, 0, "test_brw [t]<count> [write [verbose [pages [[t]objid]]]]"},
89 {"dump_ldlm", jt_obd_dump_ldlm, 0, "dump all lock manager state (no args)"},
91 /* User interface commands */
92 {"help", Parser_help, 0, "help"},
93 {"exit", jt_quit, 0, "quit"},
94 {"quit", jt_quit, 0, "quit"},
99 int main(int argc, char **argv)
105 if (obd_initialize(argc, argv) < 0)
108 Parser_init("obdctl > ", cmdlist);
111 rc = Parser_execarg(argc - 1, argv + 1, cmdlist);
113 rc = Parser_commands();
116 obd_finalize(argc, argv);