Whamcloud - gitweb
LU-3105 mdc: remove capa support
[fs/lustre-release.git] / lustre / quota / qmt_lock.c
index 04acf61..e82f79a 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -30,6 +30,7 @@
 
 #define DEBUG_SUBSYSTEM S_LQUOTA
 
+#include <linux/kthread.h>
 #include <lustre_dlm.h>
 #include <obd_class.h>
 
@@ -557,7 +558,7 @@ void qmt_glb_lock_notify(const struct lu_env *env, struct lquota_entry *lqe,
        fid_build_reg_res_name(&qti->qti_fid, &qti->qti_resid);
        res = ldlm_resource_get(pool->qpi_qmt->qmt_ns, NULL, &qti->qti_resid,
                                LDLM_PLAIN, 0);
-       if (res == NULL) {
+       if (IS_ERR(res)) {
                /* this might happen if no slaves have enqueued global quota
                 * locks yet */
                LQUOTA_DEBUG(lqe, "failed to lookup ldlm resource associated "
@@ -610,7 +611,7 @@ static void qmt_id_lock_glimpse(const struct lu_env *env,
        fid_build_quota_res_name(&qti->qti_fid, &lqe->lqe_id, &qti->qti_resid);
        res = ldlm_resource_get(qmt->qmt_ns, NULL, &qti->qti_resid, LDLM_PLAIN,
                                0);
-       if (res == NULL) {
+       if (IS_ERR(res)) {
                /* this might legitimately happens if slaves haven't had the
                 * opportunity to enqueue quota lock yet. */
                LQUOTA_DEBUG(lqe, "failed to lookup ldlm resource for per-ID "