#include "qsd_internal.h"
-static struct list_head qfs_list = LIST_HEAD_INIT(qfs_list);
+static LIST_HEAD(qfs_list);
/* protect the qfs_list */
static DEFINE_SPINLOCK(qfs_list_lock);
int qsd_config(char *valstr, char *fsname, int pool)
{
struct qsd_fsinfo *qfs;
- int rc, enabled = 0;
+ int rc, enabled = 0, old_enabled = 0;
bool reint = false;
ENTRY;
}
if (strchr(valstr, 'u'))
- enabled |= 1 << USRQUOTA;
+ enabled |= BIT(USRQUOTA);
if (strchr(valstr, 'g'))
- enabled |= 1 << GRPQUOTA;
+ enabled |= BIT(GRPQUOTA);
if (strchr(valstr, 'p'))
- enabled |= 1 << PRJQUOTA;
+ enabled |= BIT(PRJQUOTA);
mutex_lock(&qfs->qfs_mutex);
if (qfs->qfs_enabled[pool - LQUOTA_FIRST_RES] == enabled)
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 & BIT(type)) ||
+ !(enabled & BIT(type)))
+ continue;
+
if (qqi->qqi_acct_failed) {
LCONSOLE_ERROR("%s: can't enable quota "
"enforcement since space "