[PATCH v3 4/5] mutex: Remove new typedefs introduced in patch 2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In response to the review comment from Davidlohr, this patch will
remove the new typedefs introduced by patch 2. It also removes an
unnecessary barrier() call.

Signed-off-by: Waiman Long <Waiman.Long@xxxxxx>
---
 kernel/mutex.c |   25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/kernel/mutex.c b/kernel/mutex.c
index 5600bdf..140f113 100644
--- a/kernel/mutex.c
+++ b/kernel/mutex.c
@@ -113,18 +113,16 @@ EXPORT_SYMBOL(mutex_lock);
  * We don't inline mspin_lock() so that perf can correctly account for the
  * time spent in this lock function.
  */
-typedef struct mspin_node {
-	struct mspin_node *next;
-	int		   locked;	/* 1 if lock acquired */
-} mspin_node_t;
-
-typedef mspin_node_t	*mspin_lock_t;
-
-#define	MLOCK(mutex)	((mspin_lock_t *)&((mutex)->spin_mlock))
-
-static noinline void mspin_lock(mspin_lock_t *lock,  mspin_node_t *node)
+struct mspin_node {
+	struct mspin_node *next ;
+	int		  locked;	/* 1 if lock acquired */
+};
+#define	MLOCK(mutex)	((struct mspin_node **)&((mutex)->spin_mlock))
+
+static noinline
+void mspin_lock(struct mspin_node **lock, struct mspin_node *node)
 {
-	mspin_node_t *prev;
+	struct mspin_node *prev;
 
 	/* Init node */
 	node->locked = 0;
@@ -143,9 +141,9 @@ static noinline void mspin_lock(mspin_lock_t *lock,  mspin_node_t *node)
 		arch_mutex_cpu_relax();
 }
 
-static void mspin_unlock(mspin_lock_t *lock,  mspin_node_t *node)
+static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
 {
-	mspin_node_t *next = ACCESS_ONCE(node->next);
+	struct mspin_node *next = ACCESS_ONCE(node->next);
 
 	if (likely(!next)) {
 		/*
@@ -157,7 +155,6 @@ static void mspin_unlock(mspin_lock_t *lock,  mspin_node_t *node)
 		while (!(next = ACCESS_ONCE(node->next)))
 			arch_mutex_cpu_relax();
 	}
-	barrier();
 	ACCESS_ONCE(next->locked) = 1;
 	smp_wmb();
 }
@@ -237,7 +234,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
 
 	for (;;) {
 		struct task_struct *owner;
-		mspin_node_t	    node;
+		struct mspin_node  node;
 
 		/*
 		 * If there's an owner, wait for it to either
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux