aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/locking/mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/locking/mutex.c')
-rw-r--r--kernel/locking/mutex.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index 9b349619f431..8464a5cbab97 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -783,6 +783,20 @@ mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass)
783} 783}
784EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); 784EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested);
785 785
786void __sched
787mutex_lock_io_nested(struct mutex *lock, unsigned int subclass)
788{
789 int token;
790
791 might_sleep();
792
793 token = io_schedule_prepare();
794 __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE,
795 subclass, NULL, _RET_IP_, NULL, 0);
796 io_schedule_finish(token);
797}
798EXPORT_SYMBOL_GPL(mutex_lock_io_nested);
799
786static inline int 800static inline int
787ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) 801ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx)
788{ 802{
@@ -950,6 +964,16 @@ int __sched mutex_lock_killable(struct mutex *lock)
950} 964}
951EXPORT_SYMBOL(mutex_lock_killable); 965EXPORT_SYMBOL(mutex_lock_killable);
952 966
967void __sched mutex_lock_io(struct mutex *lock)
968{
969 int token;
970
971 token = io_schedule_prepare();
972 mutex_lock(lock);
973 io_schedule_finish(token);
974}
975EXPORT_SYMBOL_GPL(mutex_lock_io);
976
953static noinline void __sched 977static noinline void __sched
954__mutex_lock_slowpath(struct mutex *lock) 978__mutex_lock_slowpath(struct mutex *lock)
955{ 979{