Whamcloud - gitweb
lu_ref support for ldlm_lock and ldlm_resource. See lu_ref patch.
[fs/lustre-release.git] / lustre / mdc / mdc_reint.c
index 67effaf..12465cd 100644 (file)
@@ -91,11 +91,12 @@ int mdc_resource_get_unused(struct obd_export *exp, struct lu_fid *fid,
                                 NULL, &res_id, 0, 0);
         if (res == NULL)
                 RETURN(0);
-
+        LDLM_RESOURCE_ADDREF(res);
         /* Initialize ibits lock policy. */
         policy.l_inodebits.bits = bits;
         count = ldlm_cancel_resource_local(res, cancels, &policy,
                                            mode, 0, 0, NULL);
+        LDLM_RESOURCE_DELREF(res);
         ldlm_resource_putref(res);
         RETURN(count);
 }