1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2002 Cluster File Systems, Inc.
5 * Author: Peter J. Braam <braam@clusterfs.com>
6 * Author: Phil Schwan <phil@clusterfs.com>
8 * This file is part of Lustre, http://www.lustre.org.
10 * Lustre is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU General Public
12 * License as published by the Free Software Foundation.
14 * Lustre is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with Lustre; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32 /* the functions that were in here are now in obd.c */
34 static int jt_quit(int argc, char **argv)
37 Parser_quit(argc, argv);
42 command_t cmdlist[] = {
44 {"--device", jt_opt_device, 0, "--device <devno> <command [args ...]>"},
45 {"--threads", jt_opt_threads, 0,
46 "--threads <threads> <devno> <command [args ...]>"},
48 /* Device configuration commands */
49 {"lov_setconfig", jt_obd_lov_setconfig, 0, "configure lov data on MDS "
50 "[usage: lovconfig lov-uuid stripecount, stripesize, pattern, UUID1, [UUID2, ...]"},
51 {"list", jt_obd_list, 0, "list the devices (no args)"},
52 {"newdev", jt_obd_newdev, 0, "set device to a new unused obd (no args)"},
53 {"device", jt_obd_device, 0, "set current device (args device_no name)"},
54 {"name2dev", jt_obd_name2dev, 0,
55 "set device by name [usage: name2dev devname]"},
56 {"attach", jt_obd_attach, 0, "name the type of device (args: type data"},
57 {"setup", jt_obd_setup, 0, "setup device (args: <blkdev> [data]"},
58 {"detach", jt_obd_detach, 0, "detach the current device (arg: )"},
59 {"cleanup", jt_obd_cleanup, 0, "cleanup the current device (arg: )"},
61 /* Session commands */
62 {"connect", jt_obd_connect, 0, "connect - get a connection to device"},
63 {"disconnect", jt_obd_disconnect, 0,
64 "disconnect - break connection to device"},
66 /* Session operations */
67 {"create", jt_obd_create, 0, "create <count> [mode [verbose]]"},
68 {"destroy", jt_obd_destroy, 0, "destroy <id> [count [verbose]]"},
69 {"getattr", jt_obd_getattr, 0, "getattr <id>"},
70 {"setattr", jt_obd_setattr, 0, "setattr <id> <mode>"},
71 {"newconn", jt_obd_newconn, 0, "newconn <olduuid> [newuuid]"},
72 {"test_getattr", jt_obd_test_getattr, 0, "test_getattr <count> [verbose [[t]objid]]"},
73 {"test_brw", jt_obd_test_brw, 0, "test_brw [t]<count> [write [verbose [pages [[t]objid]]]]"},
74 {"test_ldlm", jt_obd_test_ldlm, 0, "test lock manager (no args)"},
75 {"dump_ldlm", jt_obd_dump_ldlm, 0, "dump all lock manager state (no args)"},
77 /* User interface commands */
78 {"help", Parser_help, 0, "help"},
79 {"exit", jt_quit, 0, "quit"},
80 {"quit", jt_quit, 0, "quit"},
85 int main(int argc, char **argv)
91 if (obd_initialize(argc, argv) < 0)
94 Parser_init("obdctl > ", cmdlist);
97 rc = Parser_execarg(argc - 1, argv + 1, cmdlist);
99 rc = Parser_commands();
102 obd_finalize(argc, argv);