mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>,
	Russell King <rmk+lkml@arm.linux.org.uk>
Subject: [patch 3/3] mutex subsystem: inline mutex_is_locked()
Date: Mon, 26 Dec 2005 14:26:26 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0512261416370.1496@localhost.localdomain> (raw)
In-Reply-To: <20051223161649.GA26830@elte.hu>


There is currently no advantage to not always inlining mutex_is_locked,
even on x86.

Signed-off-by: Nicolas Pitre <nico@cam.org>

Index: linux-2.6/kernel/mutex.c
===================================================================
--- linux-2.6.orig/kernel/mutex.c
+++ linux-2.6/kernel/mutex.c
@@ -22,19 +22,6 @@
 # include "mutex.h"
 #endif
 
-/***
- * mutex_is_locked - is the mutex locked
- * @lock: the mutex to be queried
- *
- * Returns 1 if the mutex is locked, 0 if unlocked.
- */
-int fastcall mutex_is_locked(struct mutex *lock)
-{
-	return atomic_read(&lock->count) != 1;
-}
-
-EXPORT_SYMBOL(mutex_is_locked);
-
 /*
  * Block on a lock - add ourselves to the list of waiters.
  * Called with lock->wait_lock held.
Index: linux-2.6/include/linux/mutex.h
===================================================================
--- linux-2.6.orig/include/linux/mutex.h
+++ linux-2.6/include/linux/mutex.h
@@ -139,6 +139,9 @@ extern int FASTCALL(mutex_trylock(struct
 extern void FASTCALL(mutex_unlock(struct mutex *lock));
 #endif
 
-extern int FASTCALL(mutex_is_locked(struct mutex *lock));
+static inline int fastcall mutex_is_locked(struct mutex *lock)
+{
+	return atomic_read(&lock->count) != 1;
+}
 
 #endif

  parent reply	other threads:[~2005-12-26 19:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-23 16:16 [patch 00/11] mutex subsystem, -V7 Ingo Molnar
2005-12-24  5:15 ` Nicolas Pitre
2005-12-24  5:23   ` Nicolas Pitre
2005-12-26 19:24 ` Nicolas Pitre
2005-12-26 19:25 ` [patch 1/3] mutex subsystem: trylock Nicolas Pitre
2005-12-27 11:51   ` Ingo Molnar
2005-12-27 20:47     ` Nicolas Pitre
2005-12-28  7:48       ` Ingo Molnar
2005-12-28  8:13         ` Ingo Molnar
2005-12-28 16:29           ` Nicolas Pitre
2005-12-28 17:09             ` Ingo Molnar
2005-12-27 12:05   ` Arjan van de Ven
2005-12-27 13:15     ` Ingo Molnar
2005-12-29  4:06       ` Nicolas Pitre
2005-12-29  8:33         ` Ingo Molnar
2005-12-29  9:01           ` Nick Piggin
2005-12-29 17:15             ` Nicolas Pitre
2005-12-30  2:05               ` Nick Piggin
2005-12-29 16:46           ` Nicolas Pitre
2005-12-29  3:22     ` Nicolas Pitre
2005-12-26 19:25 ` [patch 2/3] mutex subsystem: fastpath inlining Nicolas Pitre
2005-12-27 11:55   ` Ingo Molnar
2005-12-27 21:59     ` Nicolas Pitre
2005-12-28  7:41       ` Ingo Molnar
2005-12-29  2:53         ` Nicolas Pitre
2005-12-29  8:41           ` Ingo Molnar
2006-01-06 21:20             ` Nicolas Pitre
2005-12-26 19:26 ` Nicolas Pitre [this message]
2005-12-27 11:37   ` [patch 3/3] mutex subsystem: inline mutex_is_locked() Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0512261416370.1496@localhost.localdomain \
    --to=nico@cam.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rmk+lkml@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®