diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-06-25 01:20:01 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-06-25 01:20:01 +0000 |
commit | 3797ba0b62debb71af4606910acacc9896a9ae3b (patch) | |
tree | 414eea76253c7871bfdf3bd9d1817771eb40917c /kernel/exec_domain.c | |
parent | 2b6c0c580795a4404f72d2a794214dd9e080709d (diff) |
Merge with Linux 2.4.0-test2.
Diffstat (limited to 'kernel/exec_domain.c')
-rw-r--r-- | kernel/exec_domain.c | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c index 1daf64cc1..3f3b5fc16 100644 --- a/kernel/exec_domain.c +++ b/kernel/exec_domain.c @@ -104,37 +104,32 @@ int unregister_exec_domain(struct exec_domain *it) void __set_personality(unsigned long personality) { - struct exec_domain *it, *prev; + struct exec_domain *it; it = lookup_exec_domain(personality); - if (it == current->exec_domain) { - current->personality = personality; - return; - } - if (!it) - return; - if (atomic_read(¤t->fs->count) != 1) { - struct fs_struct *new = copy_fs_struct(current->fs); - struct fs_struct *old; - if (!new) { - put_exec_domain(it); - return; + if (it) { + if (atomic_read(¤t->fs->count) != 1) { + struct fs_struct *new = copy_fs_struct(current->fs); + struct fs_struct *old; + if (!new) { + put_exec_domain(it); + return; + } + task_lock(current); + old = current->fs; + current->fs = new; + task_unlock(current); + put_fs_struct(old); } - task_lock(current); - old = current->fs; - current->fs = new; - task_unlock(current); - put_fs_struct(old); + /* + * At that point we are guaranteed to be the sole owner of + * current->fs. + */ + current->personality = personality; + current->exec_domain = it; + set_fs_altroot(); + put_exec_domain(current->exec_domain); } - /* - * At that point we are guaranteed to be the sole owner of - * current->fs. - */ - current->personality = personality; - prev = current->exec_domain; - current->exec_domain = it; - set_fs_altroot(); - put_exec_domain(prev); } asmlinkage long sys_personality(unsigned long personality) |