#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
+#include <getopt.h>
#include <glob.h>
#include <signal.h>
#include <stdarg.h>
#include "obdctl.h"
#include <libcfs/libcfs.h>
-#include <lnet/lnet.h>
+#include <lnet/nidstr.h>
#include <lustre/lustre_idl.h>
#include <lustre_cfg.h>
#include <lustre_ioctl.h>
if (rc)
fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),
strerror(-rc));
- else
- printf("Lustre version: %s\n", version);
+ else
+ printf("Lustre version: %s\n", version);
- printf("lctl version: %s\n", BUILD_VERSION);
- return rc;
+ return rc;
}
static void print_obd_line(char *s)
if (ostname != NULL)
lustre_cfg_bufs_set_string(&bufs, 2, ostname);
- lcfg = lustre_cfg_new(cmd, &bufs);
+ lcfg = lustre_cfg_new(cmd, &bufs);
if (lcfg == NULL)
- return rc;
+ return -ENOMEM;
memset(&data, 0, sizeof(data));
rc = data.ioc_dev = get_mgs_device();
if (rc) {
fprintf(stderr, "error: %s: invalid ioctl\n",
jt_cmdname(cmdname));
+ lustre_cfg_free(lcfg);
return rc;
}
rc = l_ioctl(OBD_DEV_ID, OBD_IOC_POOL, buf);
}
if (nodemap_name == NULL || param == NULL || value == NULL) {
- fprintf(stderr, "usage: nodemap_modify --name <name> "
- "--property <range> --value <value>\n");
+ fprintf(stderr, "usage: nodemap_modify --name <nodemap_name> "
+ "--property <property_name> --value <value>\n");
+ fprintf(stderr, "valid properties: admin trusted "
+ "squash_uid squash_gid\n");
return -1;
}
rc = nodemap_cmd(cmd, NULL, 0, argv[0], nodemap_name, idmap, NULL);
if (rc != 0) {
errno = -rc;
- fprintf(stderr, "cannot add %smap '%s' to nodemap '%s'"
+ fprintf(stderr, "cannot delete %smap '%s' from nodemap '%s'"
": rc = %d\n", idtype, idmap, nodemap_name, rc);
}