patch-2.1.37 linux/fs/exec.c

Next file: linux/fs/ext2/balloc.c
Previous file: linux/fs/dquot.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/fs/exec.c linux/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>
@@ -148,7 +148,7 @@
 		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;
 			}
@@ -384,7 +384,7 @@
 	 * (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);
@@ -394,8 +394,7 @@
 		init_new_context(mm);
 		mm->def_flags = 0;	/* should future lockings be kept? */
 		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--;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov