xfs
[Top] [All Lists]

Re: [patch 1/8] mutex subsystem, XFS namespace collision fixes

To: Ingo Molnar <mingo@xxxxxxx>
Subject: Re: [patch 1/8] mutex subsystem, XFS namespace collision fixes
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 21 Dec 2005 16:36:39 +0000
Cc: Linus Torvalds <torvalds@xxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, Arjan van de Ven <arjanv@xxxxxxxxxxxxx>, Jes Sorensen <jes@xxxxxxxxxxxxxxxxxx>, Zwane Mwaikambo <zwane@xxxxxxxxxxxxxxxx>, Oleg Nesterov <oleg@xxxxxxxxxx>, David Howells <dhowells@xxxxxxxxxx>, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>, Benjamin LaHaise <bcrl@xxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Christoph Hellwig <hch@xxxxxxxxxxxxx>, Andi Kleen <ak@xxxxxxx>, Russell King <rmk+lkml@xxxxxxxxxxxxxxxx>, Nicolas Pitre <nico@xxxxxxx>, linux-xfs@xxxxxxxxxxx
In-reply-to: <20051221155426.GB7243@xxxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>, Linus Torvalds <torvalds@xxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxx>, Arjan van de Ven <arjanv@xxxxxxxxxxxxx>, Jes Sorensen <jes@xxxxxxxxxxxxxxxxxx>, Zwane Mwaikambo <zwane@xxxxxxxxxxxxxxxx>, Oleg Nesterov <oleg@xxxxxxxxxx>, David Howells <dhowells@xxxxxxxxxx>, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>, Benjamin LaHaise <bcrl@xxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Andi Kleen <ak@xxxxxxx>, Russell King <rmk+lkml@xxxxxxxxxxxxxxxx>, Nicolas Pitre <nico@xxxxxxx>, linux-xfs@xxxxxxxxxxx
References: <20051221155426.GB7243@xxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.2.1i
On Wed, Dec 21, 2005 at 04:54:26PM +0100, Ingo Molnar wrote:
> Fixup the XFS code to avoid name clashing with the mutex code by 
> introducing xfs_mutex_ functions.
> 
> Signed-off-by: Jes Sorensen <jes@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
> 
> ----
> 
>  fs/xfs/linux-2.6/mutex.h       |   10 +++++-----
>  fs/xfs/quota/xfs_dquot.c       |   12 ++++++------
>  fs/xfs/quota/xfs_dquot.h       |    4 ++--
>  fs/xfs/quota/xfs_qm.c          |   20 ++++++++++----------
>  fs/xfs/quota/xfs_qm.h          |    4 ++--
>  fs/xfs/quota/xfs_qm_bhv.c      |    2 +-
>  fs/xfs/quota/xfs_qm_syscalls.c |   24 ++++++++++++------------
>  fs/xfs/quota/xfs_quota_priv.h  |    8 ++++----
>  fs/xfs/support/uuid.c          |   12 ++++++------
>  fs/xfs/xfs_mount.c             |    4 ++--
>  fs/xfs/xfs_mount.h             |    4 ++--
>  11 files changed, 52 insertions(+), 52 deletions(-)
> 
> Index: linux/fs/xfs/linux-2.6/mutex.h
> ===================================================================
> --- linux.orig/fs/xfs/linux-2.6/mutex.h
> +++ linux/fs/xfs/linux-2.6/mutex.h
> @@ -30,10 +30,10 @@
>  #define MUTEX_DEFAULT                0x0
>  typedef struct semaphore     mutex_t;
>  
> -#define mutex_init(lock, type, name)         sema_init(lock, 1)
> -#define mutex_destroy(lock)                  sema_init(lock, -99)
> -#define mutex_lock(lock, num)                        down(lock)
> -#define mutex_trylock(lock)                  (down_trylock(lock) ? 0 : 1)
> -#define mutex_unlock(lock)                   up(lock)
> +#define xfs_mutex_init(lock, type, name)     arch_sema_init(lock, 1)
> +#define xfs_mutex_destroy(lock)                      arch_sema_init(lock, 
> -99)
> +#define xfs_mutex_lock(lock, num)            arch_down(lock)
> +#define xfs_mutex_trylock(lock)                      
> (arch_down_trylock(lock) ? 0 : 1)
> +#define xfs_mutex_unlock(lock)                       arch_up(lock)

As the name implies these use mutex xsemantics, just remove the
defines and use mutex_lock/mutex_unlock and mutex_trylock directly
(the latter only if mutex_trylock has the same return value as
spin_trylock, not the broken down_trylock version)
not sure what to do about mutex_init, do you have one in your patches?
mutex_destroy should be a simple no-op.


<Prev in Thread] Current Thread [Next in Thread>
  • Re: [patch 1/8] mutex subsystem, XFS namespace collision fixes, Christoph Hellwig <=