Whamcloud - gitweb
LU-6142 lustre: make ldebugfs_add_vars a void function
[fs/lustre-release.git] / lustre / ofd / ofd_dlm.c
index c18ade0..8e3fe93 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2015, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -51,25 +51,6 @@ struct ofd_intent_args {
        int                     error;
 };
 
-int ofd_dlm_init(void)
-{
-       ldlm_glimpse_work_kmem = kmem_cache_create("ldlm_glimpse_work_kmem",
-                                            sizeof(struct ldlm_glimpse_work),
-                                            0, 0, NULL);
-       if (ldlm_glimpse_work_kmem == NULL)
-               return -ENOMEM;
-       else
-               return 0;
-}
-
-void ofd_dlm_exit(void)
-{
-       if (ldlm_glimpse_work_kmem) {
-               kmem_cache_destroy(ldlm_glimpse_work_kmem);
-               ldlm_glimpse_work_kmem = NULL;
-       }
-}
-
 /**
  * OFD interval callback.
  *
@@ -138,7 +119,6 @@ static enum interval_iter ofd_intent_cb(struct interval_node *n, void *args)
 
        /* Find the 'victim' lock from this interval */
        list_for_each_entry(lck, &node->li_group, l_sl_policy) {
-
                victim_lock = LDLM_LOCK_GET(lck);
 
                /* the same policy group - every lock has the
@@ -232,9 +212,9 @@ out:
  * \retval             ELDLM_LOCK_ABORTED in other cases except error
  * \retval             negative errno on error
  */
-int ofd_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp,
-                     void *req_cookie, enum ldlm_mode mode, __u64 flags,
-                     void *data)
+int ofd_intent_policy(const struct lu_env *env, struct ldlm_namespace *ns,
+                     struct ldlm_lock **lockp, void *req_cookie,
+                     enum ldlm_mode mode, __u64 flags, void *data)
 {
        struct ptlrpc_request *req = req_cookie;
        struct ldlm_lock *lock = *lockp;
@@ -254,6 +234,11 @@ int ofd_intent_policy(struct ldlm_namespace *ns, struct ldlm_lock **lockp,
        struct ldlm_glimpse_work *pos, *tmp;
        ENTRY;
 
+       /* update stats for intent in intent policy */
+       if (ptlrpc_req2svc(req)->srv_stats != NULL)
+               lprocfs_counter_incr(ptlrpc_req2svc(req)->srv_stats,
+                                    PTLRPC_LAST_CNTR + LDLM_GLIMPSE_ENQUEUE);
+
        INIT_LIST_HEAD(&arg.gl_list);
        arg.no_glimpse_ast = false;
        arg.error = 0;