summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
commit0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch)
tree5085c389f09da78182b899d19fe1068b619a69dd /kernel/exit.c
parent273767781288c35c9d679e908672b9996cda4c34 (diff)
Merge with 2.3.10.
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index fc0799a58..a3d8a7547 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -166,11 +166,9 @@ static inline void close_files(struct files_struct * files)
break;
while (set) {
if (set & 1) {
- struct file * file = files->fd[i];
- if (file) {
- files->fd[i] = NULL;
+ struct file * file = xchg(&files->fd[i], NULL);
+ if (file)
filp_close(file, files);
- }
}
i++;
set >>= 1;
@@ -182,10 +180,9 @@ extern kmem_cache_t *files_cachep;
static inline void __exit_files(struct task_struct *tsk)
{
- struct files_struct * files = tsk->files;
+ struct files_struct * files = xchg(&tsk->files, NULL);
if (files) {
- tsk->files = NULL;
if (atomic_dec_and_test(&files->count)) {
close_files(files);
/*