summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-01 03:16:17 +0000
commitd8d9b8f76f22b7a16a83e261e64f89ee611f49df (patch)
tree3067bc130b80d52808e6390c9fc7fc087ec1e33c /fs/exec.c
parent19c9bba94152148523ba0f7ef7cffe3d45656b11 (diff)
Initial revision
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 9817bd67d..3a3bfb1bc 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -27,6 +27,7 @@
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
+#include <linux/file.h>
#include <linux/mman.h>
#include <linux/a.out.h>
#include <linux/errno.h>
@@ -36,7 +37,6 @@
#include <linux/fcntl.h>
#include <linux/ptrace.h>
#include <linux/user.h>
-#include <linux/malloc.h>
#include <linux/binfmts.h>
#include <linux/personality.h>
#include <linux/smp.h>
@@ -152,7 +152,7 @@ int open_inode(struct inode * inode, int mode)
if (f->f_op->open) {
int error = f->f_op->open(inode,f);
if (error) {
- f->f_count--;
+ put_filp(f);
put_unused_fd(fd);
return error;
}
@@ -388,7 +388,7 @@ static void exec_mmap(void)
* (the oom is wrong there, too, IMHO)
*/
if (current->mm->count > 1) {
- struct mm_struct *mm = kmalloc(sizeof(*mm), GFP_KERNEL);
+ struct mm_struct *mm = kmem_cache_alloc(mm_cachep, SLAB_KERNEL);
if (!mm) {
/* this is wrong, I think. */
oom(current);
@@ -397,9 +397,9 @@ static void exec_mmap(void)
*mm = *current->mm;
init_new_context(mm);
mm->def_flags = 0; /* should future lockings be kept? */
+ mm->cpu_vm_mask = (1 << smp_processor_id());
mm->count = 1;
- mm->mmap = NULL;
- mm->mmap_avl = NULL;
+ mm->mmap = mm->mmap_cache = NULL;
mm->total_vm = 0;
mm->rss = 0;
current->mm->count--;