return rc;
}
+/* write global variable settings into log */
+static int mgs_write_log_sys(struct obd_device *obd, struct fs_db *fsdb,
+ struct mgs_target_info *mti, char *sys, char *ptr)
+{
+ struct lustre_cfg_bufs bufs;
+ struct lustre_cfg *lcfg;
+ char *tmp;
+ int cmd, val;
+ int rc;
+
+ if (class_match_param(ptr, PARAM_TIMEOUT, &tmp) == 0)
+ cmd = LCFG_SET_TIMEOUT;
+ else if (class_match_param(ptr, PARAM_LDLM_TIMEOUT, &tmp) == 0)
+ cmd = LCFG_SET_LDLM_TIMEOUT;
+ /* Check for known params here so we can return error to lctl */
+ else if ((class_match_param(ptr, PARAM_AT_MIN, &tmp) == 0)
+ || (class_match_param(ptr, PARAM_AT_MAX, &tmp) == 0)
+ || (class_match_param(ptr, PARAM_AT_EXTRA, &tmp) == 0)
+ || (class_match_param(ptr, PARAM_AT_EARLY_MARGIN, &tmp) == 0)
+ || (class_match_param(ptr, PARAM_AT_HISTORY, &tmp) == 0))
+ cmd = LCFG_PARAM;
+ else
+ return -EINVAL;
+
+ val = simple_strtoul(tmp, NULL, 0);
+ CDEBUG(D_MGS, "global %s = %d\n", ptr, val);
+
+ lustre_cfg_bufs_reset(&bufs, NULL);
+ lustre_cfg_bufs_set_string(&bufs, 1, sys);
+ lcfg = lustre_cfg_new(cmd, &bufs);
+ lcfg->lcfg_num = val;
+ /* modify all servers and clients */
+ rc = mgs_write_log_direct_all(obd, fsdb, mti, lcfg, mti->mti_fsname,
+ ptr);
+ lustre_cfg_free(lcfg);
+ return rc;
+}
+
static int mgs_srpc_set_param_disk(struct obd_device *obd,
struct fs_db *fsdb,
struct mgs_target_info *mti,
rset = &fsdb->fsdb_srpc_gen;
}
- rc = sptlrpc_rule_set_merge(rset, &rule, 1);
+ rc = sptlrpc_rule_set_merge(rset, &rule);
RETURN(rc);
}
int rc, copy_size;
ENTRY;
+#ifndef HAVE_GSS
+ RETURN(-EINVAL);
+#endif
/* keep a copy of original param, which could be destroied
* during parsing */
copy_size = strlen(param) + 1;
struct mgs_target_info *mti, char *ptr)
{
struct lustre_cfg_bufs bufs;
- struct lustre_cfg *lcfg;
char *logname;
char *tmp;
int rc = 0;
GOTO(end, rc);
}
- if (class_match_param(ptr, PARAM_SYS_TIMEOUT, &tmp) == 0) {
- /* Change obd timeout */
- int timeout;
- timeout = simple_strtoul(tmp, NULL, 0);
-
- CDEBUG(D_MGS, "obd timeout %d\n", timeout);
- lustre_cfg_bufs_reset(&bufs, NULL);
- lcfg = lustre_cfg_new(LCFG_SET_TIMEOUT, &bufs);
- lcfg->lcfg_num = timeout;
- /* modify all servers and clients */
- rc = mgs_write_log_direct_all(obd, fsdb, mti, lcfg,
- mti->mti_fsname,
- "timeout");
- lustre_cfg_free(lcfg);
- GOTO(end, rc);
- }
-
- if (class_match_param(ptr, PARAM_LDLM_TIMEOUT, &tmp) == 0) {
- /* Change ldlm timeout */
- int timeout;
- timeout = simple_strtoul(tmp, NULL, 0);
-
- CDEBUG(D_MGS, "ldlm timeout %d\n", timeout);
-
- lustre_cfg_bufs_reset(&bufs, NULL);
- lcfg = lustre_cfg_new(LCFG_SET_LDLM_TIMEOUT, &bufs);
- lcfg->lcfg_num = timeout;
- /* modify all servers and clients */
- rc = mgs_write_log_direct_all(obd, fsdb, mti, lcfg,
- mti->mti_fsname,
- "ldlm_timeout");
- lustre_cfg_free(lcfg);
+ if (class_match_param(ptr, PARAM_SYS, &tmp) == 0) {
+ rc = mgs_write_log_sys(obd, fsdb, mti, ptr, tmp);
GOTO(end, rc);
}