* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
#include "obdctl.h"
#include <lnet/lnetctl.h>
-#include "parser.h"
+#include <libcfs/libcfsutil.h>
#include <stdio.h>
static char * lcfg_devname;
/* quietly strip the unnecessary '$' */
if (*name == '$' || *name == '%')
name++;
- if (isdigit(*name)) {
+ if (isdigit(*name)) {
/* We can't translate from dev # to name */
lcfg_devname = NULL;
} else {
}
} else {
lcfg_devname = NULL;
- }
+ }
return 0;
}
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
return rc;
}
-static
-int do_add_uuid(char * func, char *uuid, lnet_nid_t nid)
+static
+int do_add_uuid(char * func, char *uuid, lnet_nid_t nid)
{
int rc;
struct lustre_cfg_bufs bufs;
lcfg = lustre_cfg_new(LCFG_ADD_UUID, &bufs);
lcfg->lcfg_nid = nid;
- /* Poison NAL -- pre 1.4.6 will LASSERT on 0 NAL, this way it
+ /* Poison NAL -- pre 1.4.6 will LASSERT on 0 NAL, this way it
doesn't work without crashing (bz 10130) */
lcfg->lcfg_nal = 0x5a;
int jt_lcfg_add_uuid(int argc, char **argv)
{
lnet_nid_t nid;
-
- if (argc != 3) {
+
+ if (argc != 3) {
return CMD_HELP;
}
lustre_cfg_bufs_reset(&bufs, lcfg_devname);
if (strcmp (argv[1], "_all_"))
lustre_cfg_bufs_set_string(&bufs, 1, argv[1]);
-
+
lcfg = lustre_cfg_new(LCFG_DEL_UUID, &bufs);
rc = lcfg_ioctl(argv[0], OBD_DEV_ID, lcfg);
lustre_cfg_free(lcfg);
lustre_cfg_bufs_reset(&bufs, lcfg_devname);
lcfg = lustre_cfg_new(LCFG_SET_TIMEOUT, &bufs);
lcfg->lcfg_num = atoi(argv[1]);
-
+
rc = lcfg_ioctl(argv[0], OBD_DEV_ID, lcfg);
//rc = lcfg_mgs_ioctl(argv[0], OBD_DEV_ID, lcfg);
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
if (lcfg_devname == NULL) {
fprintf(stderr, "%s: please use 'device name' to set the "
- "device name for config commands.\n",
- jt_cmdname(argv[0]));
+ "device name for config commands.\n",
+ jt_cmdname(argv[0]));
return -EINVAL;
}
}
lcfg = lustre_cfg_new(LCFG_PARAM, &bufs);
-
+
rc = lcfg_ioctl(argv[0], OBD_DEV_ID, lcfg);
lustre_cfg_free(lcfg);
if (rc < 0) {
fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),
strerror(rc = errno));
}
-
+
return rc;
}
}
/* Find a character in a length limited string */
+/* BEWARE - kernel definition of strnchr has args in different order! */
static char *strnchr(const char *p, char c, size_t n)
{
if (!p)