X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Fmutex.c;h=5449b210d9edb1aaf4be340730a47e07d1756edf;hb=ff10952a547dad934d9ed9afc5cf579ed1ccb53a;hp=7eb960661441214f582513675bbba97262271ffe;hpb=977127174a7dff52d17faeeb4c4949a54221881f;p=linux-2.6 diff --git a/kernel/mutex.c b/kernel/mutex.c index 7eb9606614..5449b210d9 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c @@ -81,15 +81,10 @@ __mutex_lock_slowpath(atomic_t *lock_count __IP_DECL__); */ void fastcall __sched mutex_lock(struct mutex *lock) { + might_sleep(); /* * The locking fastpath is the 1->0 transition from * 'unlocked' into 'locked' state. - * - * NOTE: if asm/mutex.h is included, then some architectures - * rely on mutex_lock() having _no other code_ here but this - * fastpath. That allows the assembly fastpath to do - * tail-merging optimizations. (If you want to put testcode - * here, do it under #ifndef CONFIG_MUTEX_DEBUG.) */ __mutex_fastpath_lock(&lock->count, __mutex_lock_slowpath); } @@ -115,8 +110,6 @@ void fastcall __sched mutex_unlock(struct mutex *lock) /* * The unlocking fastpath is the 0->1 transition from 'locked' * into 'unlocked' state: - * - * NOTE: no other code must be here - see mutex_lock() . */ __mutex_fastpath_unlock(&lock->count, __mutex_unlock_slowpath); } @@ -209,7 +202,7 @@ __mutex_lock_slowpath(atomic_t *lock_count __IP_DECL__) static fastcall noinline void __mutex_unlock_slowpath(atomic_t *lock_count __IP_DECL__) { - struct mutex *lock = container_of(lock_count, struct mutex, count); + struct mutex *lock = container_of(lock_count, struct mutex, count); DEBUG_WARN_ON(lock->owner != current_thread_info()); @@ -261,7 +254,7 @@ __mutex_lock_interruptible_slowpath(atomic_t *lock_count __IP_DECL__); */ int fastcall __sched mutex_lock_interruptible(struct mutex *lock) { - /* NOTE: no other code must be here - see mutex_lock() */ + might_sleep(); return __mutex_fastpath_lock_retval (&lock->count, __mutex_lock_interruptible_slowpath); } @@ -320,6 +313,3 @@ int fastcall mutex_trylock(struct mutex *lock) } EXPORT_SYMBOL(mutex_trylock); - - -