diff options
Diffstat (limited to 'kernel/locking/mutex.c')
-rw-r--r-- | kernel/locking/mutex.c | 24 |
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 | } |
784 | EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); | 784 | EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); |
785 | 785 | ||
786 | void __sched | ||
787 | mutex_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 | } | ||
798 | EXPORT_SYMBOL_GPL(mutex_lock_io_nested); | ||
799 | |||
786 | static inline int | 800 | static inline int |
787 | ww_mutex_deadlock_injection(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | 801 | ww_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 | } |
951 | EXPORT_SYMBOL(mutex_lock_killable); | 965 | EXPORT_SYMBOL(mutex_lock_killable); |
952 | 966 | ||
967 | void __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 | } | ||
975 | EXPORT_SYMBOL_GPL(mutex_lock_io); | ||
976 | |||
953 | static noinline void __sched | 977 | static noinline void __sched |
954 | __mutex_lock_slowpath(struct mutex *lock) | 978 | __mutex_lock_slowpath(struct mutex *lock) |
955 | { | 979 | { |