Whamcloud - gitweb
LU-980 llog: cleanup return value in llog_client_create
[fs/lustre-release.git] / lustre / ptlrpc / llog_client.c
index bded4c3..0a5bb91 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -58,7 +58,7 @@
 #include <libcfs/list.h>
 
 #define LLOG_CLIENT_ENTRY(ctxt, imp) do {                             \
-        mutex_down(&ctxt->loc_sem);                                   \
+        cfs_mutex_down(&ctxt->loc_sem);                               \
         if (ctxt->loc_imp) {                                          \
                 imp = class_import_get(ctxt->loc_imp);                \
         } else {                                                      \
                        "but I'll try again next time.  Not fatal.\n", \
                        ctxt->loc_idx);                                \
                 imp = NULL;                                           \
-                mutex_up(&ctxt->loc_sem);                             \
+                cfs_mutex_up(&ctxt->loc_sem);                         \
                 return (-EINVAL);                                     \
         }                                                             \
-        mutex_up(&ctxt->loc_sem);                                     \
+        cfs_mutex_up(&ctxt->loc_sem);                                 \
 } while(0)
 
 #define LLOG_CLIENT_EXIT(ctxt, imp) do {                              \
-        mutex_down(&ctxt->loc_sem);                                   \
+        cfs_mutex_down(&ctxt->loc_sem);                               \
         if (ctxt->loc_imp != imp)                                     \
                 CWARN("loc_imp has changed from %p to %p\n",          \
                        ctxt->loc_imp, imp);                           \
         class_import_put(imp);                                        \
-        mutex_up(&ctxt->loc_sem);                                     \
+        cfs_mutex_up(&ctxt->loc_sem);                                 \
 } while(0)
 
 /* This is a callback from the llog_* functions.
@@ -147,6 +147,7 @@ out:
         ptlrpc_req_finished(req);
         return rc;
 err_free:
+        *res = NULL;
         llog_free_handle(handle);
         goto out;
 }