#include <errno.h>
#include <libgen.h>
-#include <lustre/lustre_user.h>
+#include <linux/lustre/lustre_user.h>
#include "nidlist.h"
-#include "lustreapi_internal.h"
+#include <lustre/lustreapi.h>
+#include <libcfs/util/param.h>
#define PROC_UUID_TMPL "%s/%s/uuid"
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)
{
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 */
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++) {