Skip to content

Commit c5470b2

Browse files
nhaehnleingomolnar
authored andcommitted
locking/ww_mutex: Remove the __ww_mutex_lock*() inline wrappers
Keep the documentation in the header file since there is no good place for it in mutex.c: there are two rather different implementations with different EXPORT_SYMBOLs for each function. Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= <Nicolai.Haehnle@amd.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Maarten Lankhorst <dev@mblankhorst.nl> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: dri-devel@lists.freedesktop.org Link: http://lkml.kernel.org/r/1482346000-9927-6-git-send-email-nhaehnle@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent ea9e0fb commit c5470b2

2 files changed

Lines changed: 12 additions & 22 deletions

File tree

‎include/linux/ww_mutex.h‎

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,6 @@ static inline void ww_acquire_fini(struct ww_acquire_ctx *ctx)
186186
#endif
187187
}
188188

189-
extern int __must_check __ww_mutex_lock(struct ww_mutex *lock,
190-
struct ww_acquire_ctx *ctx);
191-
extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock,
192-
struct ww_acquire_ctx *ctx);
193-
194189
/**
195190
* ww_mutex_lock - acquire the w/w mutex
196191
* @lock: the mutex to be acquired
@@ -220,10 +215,8 @@ extern int __must_check __ww_mutex_lock_interruptible(struct ww_mutex *lock,
220215
*
221216
* A mutex acquired with this function must be released with ww_mutex_unlock.
222217
*/
223-
static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
224-
{
225-
return __ww_mutex_lock(lock, ctx);
226-
}
218+
extern int __must_check ww_mutex_lock(struct ww_mutex *lock,
219+
struct ww_acquire_ctx *ctx);
227220

228221
/**
229222
* ww_mutex_lock_interruptible - acquire the w/w mutex, interruptible
@@ -255,11 +248,8 @@ static inline int ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ct
255248
*
256249
* A mutex acquired with this function must be released with ww_mutex_unlock.
257250
*/
258-
static inline int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock,
259-
struct ww_acquire_ctx *ctx)
260-
{
261-
return __ww_mutex_lock_interruptible(lock, ctx);
262-
}
251+
extern int __must_check ww_mutex_lock_interruptible(struct ww_mutex *lock,
252+
struct ww_acquire_ctx *ctx);
263253

264254
/**
265255
* ww_mutex_lock_slow - slowpath acquiring of the w/w mutex

‎kernel/locking/mutex.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
811811
}
812812

813813
int __sched
814-
__ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
814+
ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
815815
{
816816
int ret;
817817

@@ -824,10 +824,10 @@ __ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
824824

825825
return ret;
826826
}
827-
EXPORT_SYMBOL_GPL(__ww_mutex_lock);
827+
EXPORT_SYMBOL_GPL(ww_mutex_lock);
828828

829829
int __sched
830-
__ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
830+
ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
831831
{
832832
int ret;
833833

@@ -841,7 +841,7 @@ __ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
841841

842842
return ret;
843843
}
844-
EXPORT_SYMBOL_GPL(__ww_mutex_lock_interruptible);
844+
EXPORT_SYMBOL_GPL(ww_mutex_lock_interruptible);
845845

846846
#endif
847847

@@ -1019,7 +1019,7 @@ EXPORT_SYMBOL(mutex_trylock);
10191019

10201020
#ifndef CONFIG_DEBUG_LOCK_ALLOC
10211021
int __sched
1022-
__ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
1022+
ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
10231023
{
10241024
might_sleep();
10251025

@@ -1031,10 +1031,10 @@ __ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
10311031

10321032
return __ww_mutex_lock_slowpath(lock, ctx);
10331033
}
1034-
EXPORT_SYMBOL(__ww_mutex_lock);
1034+
EXPORT_SYMBOL(ww_mutex_lock);
10351035

10361036
int __sched
1037-
__ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
1037+
ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
10381038
{
10391039
might_sleep();
10401040

@@ -1046,7 +1046,7 @@ __ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
10461046

10471047
return __ww_mutex_lock_interruptible_slowpath(lock, ctx);
10481048
}
1049-
EXPORT_SYMBOL(__ww_mutex_lock_interruptible);
1049+
EXPORT_SYMBOL(ww_mutex_lock_interruptible);
10501050

10511051
#endif
10521052

0 commit comments

Comments
 (0)