aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 167e1e3ad7c6..ad8375758a79 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -429,7 +429,6 @@ EXPORT_SYMBOL(disallow_signal);
429void daemonize(const char *name, ...) 429void daemonize(const char *name, ...)
430{ 430{
431 va_list args; 431 va_list args;
432 struct fs_struct *fs;
433 sigset_t blocked; 432 sigset_t blocked;
434 433
435 va_start(args, name); 434 va_start(args, name);
@@ -462,11 +461,7 @@ void daemonize(const char *name, ...)
462 461
463 /* Become as one with the init task */ 462 /* Become as one with the init task */
464 463
465 exit_fs(current); /* current->fs->count--; */ 464 daemonize_fs_struct();
466 fs = init_task.fs;
467 current->fs = fs;
468 atomic_inc(&fs->count);
469
470 exit_files(current); 465 exit_files(current);
471 current->files = init_task.files; 466 current->files = init_task.files;
472 atomic_inc(&current->files->count); 467 atomic_inc(&current->files->count);
@@ -565,30 +560,6 @@ void exit_files(struct task_struct *tsk)
565 } 560 }
566} 561}
567 562
568void put_fs_struct(struct fs_struct *fs)
569{
570 /* No need to hold fs->lock if we are killing it */
571 if (atomic_dec_and_test(&fs->count)) {
572 path_put(&fs->root);
573 path_put(&fs->pwd);
574 kmem_cache_free(fs_cachep, fs);
575 }
576}
577
578void exit_fs(struct task_struct *tsk)
579{
580 struct fs_struct * fs = tsk->fs;
581
582 if (fs) {
583 task_lock(tsk);
584 tsk->fs = NULL;
585 task_unlock(tsk);
586 put_fs_struct(fs);
587 }
588}
589
590EXPORT_SYMBOL_GPL(exit_fs);
591
592#ifdef CONFIG_MM_OWNER 563#ifdef CONFIG_MM_OWNER
593/* 564/*
594 * Task p is exiting and it owned mm, lets find a new owner for it 565 * Task p is exiting and it owned mm, lets find a new owner for it