#define DEBUG_SUBSYSTEM S_LQUOTA
#include <obd_class.h>
-#include <uapi/linux/lustre_param.h>
+#include <uapi/linux/lustre/lustre_param.h>
#include "qsd_internal.h"
RETURN(qfs);
}
-/*
- * Quota configuration handlers in charge of processing all per-filesystem quota
- * parameters set via conf_param.
- *
- * \param lcfg - quota configuration log to be processed
- */
-int qsd_process_config(struct lustre_cfg *lcfg)
+int qsd_config(char *valstr, char *fsname, int pool)
{
- struct qsd_fsinfo *qfs;
- char *fsname = lustre_cfg_string(lcfg, 0);
- char *cfgstr = lustre_cfg_string(lcfg, 1);
- char *keystr, *valstr;
- int rc, pool, enabled = 0;
- bool reint = false;
- ENTRY;
-
- CDEBUG(D_QUOTA, "processing quota parameter: fs:%s cfgstr:%s\n", fsname,
- cfgstr);
-
- if (class_match_param(cfgstr, PARAM_QUOTA, &keystr) != 0)
- RETURN(-EINVAL);
-
- if (!class_match_param(keystr, QUOTA_METAPOOL_NAME, &valstr))
- pool = LQUOTA_RES_MD;
- else if (!class_match_param(keystr, QUOTA_DATAPOOL_NAME, &valstr))
- pool = LQUOTA_RES_DT;
- else
- RETURN(-EINVAL);
+ struct qsd_fsinfo *qfs;
+ int rc, enabled = 0, old_enabled = 0;
+ bool reint = false;
+ ENTRY;
qfs = qsd_get_fsinfo(fsname, 0);
if (qfs == NULL) {
CERROR("failed to find quota filesystem information for %s\n",
if ((qfs->qfs_enabled[pool - LQUOTA_FIRST_RES] & enabled) != enabled)
reint = true;
+ old_enabled = qfs->qfs_enabled[pool - LQUOTA_FIRST_RES];
qfs->qfs_enabled[pool - LQUOTA_FIRST_RES] = enabled;
/* trigger reintegration for all qsd */
for (type = USRQUOTA; type < LL_MAXQUOTAS; type++) {
qqi = qsd->qsd_type_array[type];
+ /* only trigger reintegration if this
+ * type of quota is not enabled before */
+ if ((old_enabled & 1 << type) ||
+ !(enabled & 1 << type))
+ continue;
+
if (qqi->qqi_acct_failed) {
LCONSOLE_ERROR("%s: can't enable quota "
"enforcement since space "
qsd_put_fsinfo(qfs);
RETURN(0);
}
+
+/*
+ * Quota configuration handlers in charge of processing all per-filesystem quota
+ * parameters set via conf_param.
+ *
+ * \param lcfg - quota configuration log to be processed
+ */
+int qsd_process_config(struct lustre_cfg *lcfg)
+{
+ char *fsname = lustre_cfg_string(lcfg, 0);
+ char *cfgstr = lustre_cfg_string(lcfg, 1);
+ char *keystr, *valstr;
+ int pool;
+
+ ENTRY;
+ CDEBUG(D_QUOTA, "processing quota parameter: fs:%s cfgstr:%s\n", fsname,
+ cfgstr);
+
+ if (class_match_param(cfgstr, PARAM_QUOTA, &keystr) != 0)
+ RETURN(-EINVAL);
+
+ if (!class_match_param(keystr, QUOTA_METAPOOL_NAME, &valstr))
+ pool = LQUOTA_RES_MD;
+ else if (!class_match_param(keystr, QUOTA_DATAPOOL_NAME, &valstr))
+ pool = LQUOTA_RES_DT;
+ else
+ RETURN(-EINVAL);
+
+ return qsd_config(valstr, fsname, pool);
+}