summaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
commitb9ba7aeb165cffecdffb60aec8c3fa8d590d9ca9 (patch)
tree42d07b0c7246ae2536a702e7c5de9e2732341116 /kernel/exit.c
parent7406b0a326f2d70ade2671c37d1beef62249db97 (diff)
Merge with 2.3.99-pre6.
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 45f85aec3..b38b067dd 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -25,7 +25,7 @@ int getrusage(struct task_struct *, int, struct rusage *);
void release(struct task_struct * p)
{
if (p != current) {
-#ifdef __SMP__
+#ifdef CONFIG_SMP
int has_cpu;
/*
@@ -207,6 +207,25 @@ void exit_files(struct task_struct *tsk)
{
__exit_files(tsk);
}
+static inline void __put_fs_struct(struct fs_struct *fs)
+{
+ if (atomic_dec_and_test(&fs->count)) {
+ dput(fs->root);
+ mntput(fs->rootmnt);
+ dput(fs->pwd);
+ mntput(fs->pwdmnt);
+ if (fs->altroot) {
+ dput(fs->altroot);
+ mntput(fs->altrootmnt);
+ }
+ kfree(fs);
+ }
+}
+
+void put_fs_struct(struct fs_struct *fs)
+{
+ __put_fs_struct(fs);
+}
static inline void __exit_fs(struct task_struct *tsk)
{
@@ -214,13 +233,7 @@ static inline void __exit_fs(struct task_struct *tsk)
if (fs) {
tsk->fs = NULL;
- if (atomic_dec_and_test(&fs->count)) {
- dput(fs->root);
- mntput(fs->rootmnt);
- dput(fs->pwd);
- mntput(fs->pwdmnt);
- kfree(fs);
- }
+ __put_fs_struct(fs);
}
}