* GPL HEADER END
*/
/*
- * Copyright (c) 2012 Intel, Inc.
+ * Copyright (c) 2012, 2013, Intel Corporation.
* Use is subject to license terms.
*
* Author: Johann Lombardi <johann.lombardi@intel.com>
* Author: Niu Yawei <yawei.niu@intel.com>
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
-
#define DEBUG_SUBSYSTEM S_LQUOTA
#include <obd_class.h>
ENTRY;
LASSERT(qfs != NULL);
- cfs_spin_lock(&qfs_list_lock);
+ spin_lock(&qfs_list_lock);
LASSERT(qfs->qfs_ref > 0);
qfs->qfs_ref--;
if (qfs->qfs_ref == 0) {
cfs_list_del(&qfs->qfs_link);
OBD_FREE_PTR(qfs);
}
- cfs_spin_unlock(&qfs_list_lock);
+ spin_unlock(&qfs_list_lock);
EXIT;
}
if (new == NULL)
RETURN(NULL);
- cfs_sema_init(&new->qfs_sem, 1);
+ sema_init(&new->qfs_sem, 1);
CFS_INIT_LIST_HEAD(&new->qfs_qsd_list);
strcpy(new->qfs_name, name);
new->qfs_ref = 1;
}
/* search in the fsinfo list */
- cfs_spin_lock(&qfs_list_lock);
+ spin_lock(&qfs_list_lock);
cfs_list_for_each_entry(qfs, &qfs_list, qfs_link) {
if (!strcmp(qfs->qfs_name, name)) {
qfs->qfs_ref++;
new = NULL;
}
out:
- cfs_spin_unlock(&qfs_list_lock);
+ spin_unlock(&qfs_list_lock);
if (new)
OBD_FREE_PTR(new);
if (strchr(valstr, 'g'))
enabled |= 1 << GRPQUOTA;
- cfs_down(&qfs->qfs_sem);
+ down(&qfs->qfs_sem);
if (qfs->qfs_enabled[pool - LQUOTA_FIRST_RES] == enabled)
/* no change required */
GOTO(out, rc = 0);
/* start reintegration only if qsd_prepare() was
* successfully called */
- cfs_read_lock(&qsd->qsd_lock);
+ read_lock(&qsd->qsd_lock);
if (!qsd->qsd_prepared)
skip = true;
- cfs_read_unlock(&qsd->qsd_lock);
+ read_unlock(&qsd->qsd_lock);
if (skip)
continue;
+ if (qsd->qsd_acct_failed) {
+ LCONSOLE_ERROR("%s: can't enable quota "
+ "enforcement since space "
+ "accounting isn't functional. "
+ "Please run tunefs.lustre "
+ "--quota on an unmounted "
+ "filesystem if not done already"
+ "\n", qsd->qsd_svname);
+ continue;
+ }
for (type = USRQUOTA; type < MAXQUOTAS; type++) {
qqi = qsd->qsd_type_array[type];
}
}
out:
- cfs_up(&qfs->qfs_sem);
+ up(&qfs->qfs_sem);
qsd_put_fsinfo(qfs);
RETURN(0);
}