Whamcloud - gitweb
b=21128 run sync ldlm_bl_to_thread_list() in separate thread to save stack space.
[fs/lustre-release.git] / lustre / quota / quota_context.c
index 57ac31d..d9d7be0 100644 (file)
@@ -1348,7 +1348,7 @@ void qctxt_cleanup(struct lustre_quota_ctxt *qctxt, int force)
         cfs_hash_for_each_safe(qctxt->lqc_lqs_hash, hash_put_lqs, NULL);
         l_wait_event(qctxt->lqc_lqs_waitq, check_lqs(qctxt), &lwi);
         cfs_down_write(&obt->obt_rwsem);
-        cfs_hash_destroy(qctxt->lqc_lqs_hash);
+        cfs_hash_putref(qctxt->lqc_lqs_hash);
         qctxt->lqc_lqs_hash = NULL;
         cfs_up_write(&obt->obt_rwsem);
 
@@ -1587,6 +1587,16 @@ lqs_hash(cfs_hash_t *hs, void *key, unsigned mask)
         RETURN(hash & mask);
 }
 
+static void *
+lqs_key(cfs_hlist_node_t *hnode)
+{
+        struct lustre_qunit_size *lqs;
+        ENTRY;
+
+        lqs = cfs_hlist_entry(hnode, struct lustre_qunit_size, lqs_hash);
+        RETURN(&lqs->lqs_key);
+}
+
 static int
 lqs_compare(void *key, cfs_hlist_node_t *hnode)
 {
@@ -1649,6 +1659,7 @@ lqs_exit(cfs_hlist_node_t *hnode)
 
 static cfs_hash_ops_t lqs_hash_ops = {
         .hs_hash    = lqs_hash,
+        .hs_key     = lqs_key,
         .hs_compare = lqs_compare,
         .hs_get     = lqs_get,
         .hs_put     = lqs_put,