aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 10646182440f..e702cb9ffbd8 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -946,6 +946,24 @@ void mmput(struct mm_struct *mm)
946} 946}
947EXPORT_SYMBOL_GPL(mmput); 947EXPORT_SYMBOL_GPL(mmput);
948 948
949#ifdef CONFIG_MMU
950static void mmput_async_fn(struct work_struct *work)
951{
952 struct mm_struct *mm = container_of(work, struct mm_struct,
953 async_put_work);
954
955 __mmput(mm);
956}
957
958void mmput_async(struct mm_struct *mm)
959{
960 if (atomic_dec_and_test(&mm->mm_users)) {
961 INIT_WORK(&mm->async_put_work, mmput_async_fn);
962 schedule_work(&mm->async_put_work);
963 }
964}
965#endif
966
949/** 967/**
950 * set_mm_exe_file - change a reference to the mm's executable file 968 * set_mm_exe_file - change a reference to the mm's executable file
951 * 969 *