Whamcloud - gitweb
LU-1214 ldlm: splits server specific lock handling from client
[fs/lustre-release.git] / lustre / include / lustre_mdc.h
index e8883b4..c241c30 100644 (file)
@@ -30,6 +30,9 @@
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2012 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
 # include <linux/fs.h>
 # include <linux/dcache.h>
 # ifdef CONFIG_FS_POSIX_ACL
-#  ifdef HAVE_XATTR_ACL
-#   include <linux/xattr_acl.h>
-#  endif /*HAVE_XATTR_ACL */
-#  ifdef HAVE_LINUX_POSIX_ACL_XATTR_H
-#   include <linux/posix_acl_xattr.h>
-#  endif /* HAVE_LINUX_POSIX_ACL_XATTR_H */
+#  include <linux/posix_acl_xattr.h>
 # endif /* CONFIG_FS_POSIX_ACL */
-#include <linux/lustre_intent.h>
+# include <linux/lustre_intent.h>
 #endif /* __KERNEL__ */
 #include <lustre_handles.h>
 #include <libcfs/libcfs.h>
@@ -74,13 +72,13 @@ struct ptlrpc_request;
 struct obd_device;
 
 struct mdc_rpc_lock {
-        cfs_semaphore_t  rpcl_sem;
+        cfs_mutex_t           rpcl_mutex;
         struct lookup_intent *rpcl_it;
 };
 
 static inline void mdc_init_rpc_lock(struct mdc_rpc_lock *lck)
 {
-        cfs_sema_init(&lck->rpcl_sem, 1);
+        cfs_mutex_init(&lck->rpcl_mutex);
         lck->rpcl_it = NULL;
 }
 
@@ -89,7 +87,7 @@ static inline void mdc_get_rpc_lock(struct mdc_rpc_lock *lck,
 {
         ENTRY;
         if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
-                cfs_down(&lck->rpcl_sem);
+                cfs_mutex_lock(&lck->rpcl_mutex);
                 LASSERT(lck->rpcl_it == NULL);
                 lck->rpcl_it = it;
         }
@@ -101,7 +99,7 @@ static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
         if (!it || (it->it_op != IT_GETATTR && it->it_op != IT_LOOKUP)) {
                 LASSERT(it == lck->rpcl_it);
                 lck->rpcl_it = NULL;
-                cfs_up(&lck->rpcl_sem);
+                cfs_mutex_unlock(&lck->rpcl_mutex);
         }
         EXIT;
 }