X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Flshowmount.c;h=cddc2f9811041bf1c102ac3d0b62a59b5f29710c;hb=56b4b112a497661de8dbf5a851c7a045d470deff;hp=89bc3d5bcc380ca7a5cd173a82e311ebc3600d0e;hpb=6c47e7f99f5fa8884751ac549a45dd3c0b81e7f1;p=fs%2Flustre-release.git diff --git a/lustre/utils/lshowmount.c b/lustre/utils/lshowmount.c index 89bc3d5..cddc2f9 100644 --- a/lustre/utils/lshowmount.c +++ b/lustre/utils/lshowmount.c @@ -49,9 +49,10 @@ #include #include -#include +#include #include "nidlist.h" -#include "lustreapi_internal.h" +#include +#include #define PROC_UUID_TMPL "%s/%s/uuid" @@ -62,13 +63,12 @@ static void read_exports(char *exports, NIDList nidlist); char *prog; #define OPTIONS "ehlv" -static struct option long_options[] = { - {"enumerate", no_argument, 0, 'e'}, - {"help", no_argument, 0, 'h'}, - {"lookup", no_argument, 0, 'l'}, - {"verbose", no_argument, 0, 'v'}, - {0, 0, 0, 0}, -}; +static struct option long_opts[] = { + { .val = 'e', .name = "enumerate", .has_arg = no_argument }, + { .val = 'h', .name = "help", .has_arg = no_argument }, + { .val = 'l', .name = "lookup", .has_arg = no_argument }, + { .val = 'v', .name = "verbose", .has_arg = no_argument }, + { .name = NULL } }; static void usage(void) { @@ -85,7 +85,7 @@ int main(int argc, char **argv) prog = basename(argv[0]); - while ((opt = getopt_long(argc, argv, OPTIONS, long_options, + while ((opt = getopt_long(argc, argv, OPTIONS, long_opts, &optidx)) != -1) { switch (opt) { case 'e': /* --enumerate */ @@ -156,10 +156,9 @@ static int lshowmount(int lookup, int enumerate, int verbose) glob_t exp_list; int i; - i = get_lustre_param_path("{mgs,mdt,obdfilter}", "*", - FILTER_BY_EXACT, "exports", &exp_list); + i = cfs_get_param_paths(&exp_list, "{mgs,mdt,obdfilter}/*/exports"); if (i < 0) - return i; + return -errno; if (!verbose) nidlist = nl_create(); for (i = 0; i < exp_list.gl_pathc; i++) {