aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-22 21:27:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-22 21:28:34 -0400
commit94bc891b00e40cbec375feb4568780af183fd7f4 (patch)
treefd48d354c61d2e736aa593c324a6d794afd8a4e7 /kernel
parent934b7024f0ed29003c95cef447d92737ab86dc4f (diff)
parent1ec7f1ddbe5ba49f7b10c3b129d6d5c90c43526c (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: [PATCH] get rid of __exit_files(), __exit_fs() and __put_fs_struct() [PATCH] proc_readfd_common() race fix [PATCH] double-free of inode on alloc_file() failure exit in create_write_pipe() [PATCH] teach seq_file to discard entries [PATCH] umount_tree() will unhash everything itself [PATCH] get rid of more nameidata passing in namespace.c [PATCH] switch a bunch of LSM hooks from nameidata to path [PATCH] lock exclusively in collect_mounts() and drop_collected_mounts() [PATCH] move a bunch of declarations to fs/internal.h
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exit.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 073005b1cfb2..cece89f80ab4 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -521,7 +521,7 @@ void reset_files_struct(struct task_struct *tsk, struct files_struct *files)
521} 521}
522EXPORT_SYMBOL(reset_files_struct); 522EXPORT_SYMBOL(reset_files_struct);
523 523
524static void __exit_files(struct task_struct *tsk) 524void exit_files(struct task_struct *tsk)
525{ 525{
526 struct files_struct * files = tsk->files; 526 struct files_struct * files = tsk->files;
527 527
@@ -533,12 +533,7 @@ static void __exit_files(struct task_struct *tsk)
533 } 533 }
534} 534}
535 535
536void exit_files(struct task_struct *tsk) 536void put_fs_struct(struct fs_struct *fs)
537{
538 __exit_files(tsk);
539}
540
541static void __put_fs_struct(struct fs_struct *fs)
542{ 537{
543 /* No need to hold fs->lock if we are killing it */ 538 /* No need to hold fs->lock if we are killing it */
544 if (atomic_dec_and_test(&fs->count)) { 539 if (atomic_dec_and_test(&fs->count)) {
@@ -550,12 +545,7 @@ static void __put_fs_struct(struct fs_struct *fs)
550 } 545 }
551} 546}
552 547
553void put_fs_struct(struct fs_struct *fs) 548void exit_fs(struct task_struct *tsk)
554{
555 __put_fs_struct(fs);
556}
557
558static void __exit_fs(struct task_struct *tsk)
559{ 549{
560 struct fs_struct * fs = tsk->fs; 550 struct fs_struct * fs = tsk->fs;
561 551
@@ -563,15 +553,10 @@ static void __exit_fs(struct task_struct *tsk)
563 task_lock(tsk); 553 task_lock(tsk);
564 tsk->fs = NULL; 554 tsk->fs = NULL;
565 task_unlock(tsk); 555 task_unlock(tsk);
566 __put_fs_struct(fs); 556 put_fs_struct(fs);
567 } 557 }
568} 558}
569 559
570void exit_fs(struct task_struct *tsk)
571{
572 __exit_fs(tsk);
573}
574
575EXPORT_SYMBOL_GPL(exit_fs); 560EXPORT_SYMBOL_GPL(exit_fs);
576 561
577/* 562/*
@@ -967,8 +952,8 @@ NORET_TYPE void do_exit(long code)
967 if (group_dead) 952 if (group_dead)
968 acct_process(); 953 acct_process();
969 exit_sem(tsk); 954 exit_sem(tsk);
970 __exit_files(tsk); 955 exit_files(tsk);
971 __exit_fs(tsk); 956 exit_fs(tsk);
972 check_stack_usage(); 957 check_stack_usage();
973 exit_thread(); 958 exit_thread();
974 cgroup_exit(tsk, 1); 959 cgroup_exit(tsk, 1);