#include <obd_ost.h>
#include <lustre_fsfilt.h>
#include <linux/lustre_quota.h>
-#include <class_hash.h>
#include "quota_internal.h"
#ifdef HAVE_QUOTA_SUPPORT
lqs->lqs_key = lqs_key;
- spin_lock_init(&lqs->lqs_lock);
+ cfs_spin_lock_init(&lqs->lqs_lock);
lqs->lqs_bwrite_pending = 0;
lqs->lqs_iwrite_pending = 0;
lqs->lqs_ino_rec = 0;
}
lqs_initref(lqs);
- spin_lock(&qctxt->lqc_lock);
+ cfs_spin_lock(&qctxt->lqc_lock);
if (!qctxt->lqc_valid)
rc = -EBUSY;
else
- rc = lustre_hash_add_unique(qctxt->lqc_lqs_hash,
- &lqs->lqs_key, &lqs->lqs_hash);
- spin_unlock(&qctxt->lqc_lock);
+ rc = cfs_hash_add_unique(qctxt->lqc_lqs_hash,
+ &lqs->lqs_key, &lqs->lqs_hash);
+ cfs_spin_unlock(&qctxt->lqc_lock);
if (!rc)
lqs_getref(lqs);
int rc = 0;
search_lqs:
- lqs = lustre_hash_lookup(qctxt->lqc_lqs_hash, &lqs_key);
+ lqs = cfs_hash_lookup(qctxt->lqc_lqs_hash, &lqs_key);
if (IS_ERR(lqs))
GOTO(out, rc = PTR_ERR(lqs));
if (rc == 0) {
return lqs;
} else {
- CDEBUG(D_ERROR, "get lqs error(rc: %d)\n", rc);
+ CERROR("get lqs error(rc: %d)\n", rc);
return ERR_PTR(rc);
}
}
lqs = quota_search_lqs(LQS_KEY(QAQ_IS_GRP(oqaq), oqaq->qaq_id),
qctxt, QAQ_IS_CREATE_LQS(oqaq) ? 1 : 0);
if (lqs == NULL || IS_ERR(lqs)){
- CDEBUG(D_ERROR, "fail to find a lqs(%s id: %u)!\n",
- QAQ_IS_GRP(oqaq) ? "group" : "user", oqaq->qaq_id);
+ CERROR("fail to find a lqs for %sid %u!\n",
+ QAQ_IS_GRP(oqaq) ? "g" : "u", oqaq->qaq_id);
RETURN(PTR_ERR(lqs));
}
CDEBUG(D_QUOTA, "before: bunit: %lu, iunit: %lu.\n",
lqs->lqs_bunit_sz, lqs->lqs_iunit_sz);
- spin_lock(&lqs->lqs_lock);
+ cfs_spin_lock(&lqs->lqs_lock);
for (i = 0; i < 2; i++) {
if (i == 0 && !QAQ_IS_ADJBLK(oqaq))
continue;
if (tmp < 0)
rc |= i ? LQS_INO_INCREASE : LQS_BLK_INCREASE;
}
- spin_unlock(&lqs->lqs_lock);
+ cfs_spin_unlock(&lqs->lqs_lock);
CDEBUG(D_QUOTA, "after: bunit: %lu, iunit: %lu.\n",
lqs->lqs_bunit_sz, lqs->lqs_iunit_sz);