diff options
-rw-r--r-- | kernel/exit.c | 27 |
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 | } |
522 | EXPORT_SYMBOL(reset_files_struct); | 522 | EXPORT_SYMBOL(reset_files_struct); |
523 | 523 | ||
524 | static void __exit_files(struct task_struct *tsk) | 524 | void 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 | ||
536 | void exit_files(struct task_struct *tsk) | 536 | void put_fs_struct(struct fs_struct *fs) |
537 | { | ||
538 | __exit_files(tsk); | ||
539 | } | ||
540 | |||
541 | static 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 | ||
553 | void put_fs_struct(struct fs_struct *fs) | 548 | void exit_fs(struct task_struct *tsk) |
554 | { | ||
555 | __put_fs_struct(fs); | ||
556 | } | ||
557 | |||
558 | static 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 | ||
570 | void exit_fs(struct task_struct *tsk) | ||
571 | { | ||
572 | __exit_fs(tsk); | ||
573 | } | ||
574 | |||
575 | EXPORT_SYMBOL_GPL(exit_fs); | 560 | EXPORT_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); |