LCFG_DEL_UUID = 0x00cf006,
LCFG_MOUNTOPT = 0x00cf007,
LCFG_DEL_MOUNTOPT = 0x00cf008,
+ LCFG_SET_TIMEOUT = 0x00cf009,
+ LCFG_SET_UPCALL = 0x00cf010,
};
struct lustre_cfg {
uint32_t lcfg_version;
uint32_t lcfg_command;
- uint32_t lcfg_dev;
+ uint32_t lcfg_num;
uint32_t lcfg_flags;
uint64_t lcfg_nid;
uint32_t lcfg_nal;
tgt = class_name2obd(lcfg->lcfg_inlbuf1);
if (!tgt || !tgt->obd_attached || !tgt->obd_set_up) {
- CERROR("target device not attached or not set up (%d/%s)\n",
- lcfg->lcfg_dev, lcfg->lcfg_inlbuf1);
+ CERROR("target device not attached or not set up (%s)\n",
+ lcfg->lcfg_inlbuf1);
RETURN(-EINVAL);
}
class_del_profile(lcfg->lcfg_inlbuf1);
GOTO(out, err = 0);
}
+ case LCFG_SET_TIMEOUT: {
+ CDEBUG(D_IOCTL, "changing lustre timeout from %d to %d\n",
+ obd_timeout,
+ lcfg->lcfg_num);
+ obd_timeout = lcfg->lcfg_num;
+ GOTO(out, err = 0);
+ }
+ case LCFG_SET_UPCALL: {
+ CDEBUG(D_IOCTL, "setting lustre ucpall to: %s\n",
+ lcfg->lcfg_inlbuf1);
+ if (lcfg->lcfg_inllen1 > sizeof obd_lustre_upcall)
+ GOTO(out, err = -EINVAL);
+ memcpy(obd_lustre_upcall, lcfg->lcfg_inlbuf1,
+ lcfg->lcfg_inllen1);
+ GOTO(out, err = 0);
+ }
}
lcfg->lcfg_nid);
if (lcfg->lcfg_nal)
CDEBUG(D_INFO, " nal: %x\n", lcfg->lcfg_nal);
+ if (lcfg->lcfg_num)
+ CDEBUG(D_INFO, " nal: %x\n", lcfg->lcfg_num);
if (lcfg->lcfg_inlbuf1)
CDEBUG(D_INFO, " inlbuf1: %s\n",lcfg->lcfg_inlbuf1);
if (lcfg->lcfg_inlbuf2)
fi
[ -d /r ] && $LCTL modules > /r/tmp/ogdb-`hostname`
-
- echo $TIMEOUT > /proc/sys/lustre/timeout
- echo $UPCALL > /proc/sys/lustre/upcall
}
zconf_umount() {
return rc;
}
+int jt_lcfg_set_timeout(int argc, char **argv)
+{
+ int rc;
+ struct lustre_cfg lcfg;
+
+ LCFG_INIT(lcfg, LCFG_SET_TIMEOUT, lcfg_devname);
+
+ if (argc != 2)
+ return CMD_HELP;
+
+ lcfg.lcfg_num = atoi(argv[1]);
+
+ rc = lcfg_ioctl(argv[0], OBD_DEV_ID, &lcfg);
+ if (rc < 0) {
+ fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),
+ strerror(rc = errno));
+ }
+
+ return rc;
+}
+
+
+int jt_lcfg_set_lustre_upcall(int argc, char **argv)
+{
+ int rc;
+ struct lustre_cfg lcfg;
+
+ LCFG_INIT(lcfg, LCFG_SET_UPCALL, lcfg_devname);
+
+ if (argc != 2)
+ return CMD_HELP;
+
+ /* profile name */
+ lcfg.lcfg_inllen1 = strlen(argv[1]) + 1;
+ lcfg.lcfg_inlbuf1 = argv[1];
+
+ rc = lcfg_ioctl(argv[0], OBD_DEV_ID, &lcfg);
+ if (rc < 0) {
+ fprintf(stderr, "error: %s: %s\n", jt_cmdname(argv[0]),
+ strerror(rc = errno));
+ }
+
+ return rc;
+}
+