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