From eff45ba6efdbeb23718407c27434aee2f1808792 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 21 Oct 2003 09:26:35 +0000 Subject: [PATCH] 1. add "lfs getstripe" 2. other modification for replacing lfind.c and lstripe.c with lfind and lstripe --- lustre/utils/lfs.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index ba81d02..69af690 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -42,6 +42,7 @@ extern int op_find(char *path, struct obd_uuid *obduuid, int recursive, /* all functions */ static int lfs_setstripe(int argc, char **argv); static int lfs_find(int argc, char **argv); +static int lfs_getstripe(int argc, char **argv); /* all avaialable commands */ command_t cmdlist[] = { @@ -54,6 +55,9 @@ command_t cmdlist[] = { {"find", lfs_find, 0, "blah...\n" "usage: find [--obd ] [--quiet | --verbose] [--recursive] ..."}, + {"getstripe", lfs_getstripe, 0, + "blah...\n" + "usage:getstripe "}, {"help", Parser_help, 0, "help"}, {"exit", Parser_quit, 0, "quit"}, {"quit", Parser_quit, 0, "quit"}, @@ -161,6 +165,29 @@ static int lfs_find(int argc, char **argv) return rc; } +static int lfs_getstripe(int argc, char **argv) +{ + + if (argc != 2) + return CMD_HELP; + + int quiet, verbose, recursive, rc; + struct obd_uuid *obduuid = NULL; + + + optind = 1; + quiet = verbose = recursive = 0; + + + do { + rc = op_find(argv[optind], obduuid, recursive, verbose, quiet); + } while (++optind < argc && !rc); + + + if (rc) + fprintf(stderr, "error: %s: getstripe failed\n", argv[0]); + return rc; +} int main(int argc, char **argv) { -- 1.8.3.1