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

From: Ingo Molnar
Date: Thu Dec 22 2005 - 08:00:43 EST



* Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:

> > -#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) sema_init(lock, 1)
> > +#define xfs_mutex_destroy(lock) sema_init(lock, -99)
> > +#define xfs_mutex_lock(lock, num) down(lock)
> > +#define xfs_mutex_trylock(lock) (down_trylock(lock) ? 0 : 1)
> > +#define xfs_mutex_unlock(lock) up(lock)
>
> Again, this should really be using the mutex primitives (obviously
> ;-)).

yeah - but i didnt want to impact something so large as XFS. Such a
change has to be tested and validated - so i wanted to get the namespace
collision out of the way first. But i'd be happy to add an XFS
conversion patch ontop of these, provided someone tests it.

> While we're at it, maybe we should a mutex_destroy aswell? it would
> be non-mandatory and allow that a lock is gone for the debugging
> variant.

right now the lock is gone from the debugging state once it's unlocked.
I'll add mutex_destroy(), it should be rather easy (it can e.g. destroy
mutex->magic).

Ingo
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/