From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wink Saville Subject: [PATCH 3/3] kshmem modifications to actually use kshmem Date: Sat, 05 May 2007 18:54:02 -0700 Message-ID: <463D353A.90502@saville.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Signed-off-by: Wink Saville --- fs/exec.c | 10 ++++++++++ init/main.c | 3 +++ kernel/fork.c | 10 ++++++++++ 3 files changed, 23 insertions(+), 0 deletions(-) Index: linux-2.6/fs/exec.c =================================================================== --- linux-2.6.orig/fs/exec.c 2007-04-29 21:51:39.000000000 -0700 +++ linux-2.6/fs/exec.c 2007-04-29 21:52:04.000000000 -0700 @@ -58,6 +58,10 @@ #include #endif +#ifdef CONFIG_KSHMEM +#include +#endif + int core_uses_pid; char core_pattern[128] = "core"; int suid_dumpable = 0; @@ -1183,6 +1187,12 @@ if (retval < 0) goto out; +#ifdef CONFIG_KSHMEM + retval = kshmem_prepare(bprm->mm); + if (retval < 0) + goto out; +#endif + retval = search_binary_handler(bprm,regs); if (retval >= 0) { free_arg_pages(bprm); Index: linux-2.6/init/main.c =================================================================== --- linux-2.6.orig/init/main.c 2007-04-29 21:51:39.000000000 -0700 +++ linux-2.6/init/main.c 2007-04-29 21:56:20.000000000 -0700 @@ -54,6 +54,7 @@ #include #include #include +#include #include #include @@ -615,6 +616,8 @@ if (efi_enabled) efi_enter_virtual_mode(); #endif + + kshmem_init(); fork_init(num_physpages); proc_caches_init(); buffer_init(); Index: linux-2.6/kernel/fork.c =================================================================== --- linux-2.6.orig/kernel/fork.c 2007-04-29 21:51:39.000000000 -0700 +++ linux-2.6/kernel/fork.c 2007-04-29 21:52:04.000000000 -0700 @@ -57,6 +57,10 @@ #include #include +#ifdef CONFIG_KSHMEM +#include +#endif + /* * Protected counters by write_lock_irq(&tasklist_lock) */ @@ -221,6 +225,12 @@ rb_parent = NULL; pprev = &mm->mmap; +#ifdef CONFIG_KSHMEM + retval = kshmem_prepare(mm); + if (retval < 0) + goto out; +#endif + for (mpnt = oldmm->mmap; mpnt; mpnt = mpnt->vm_next) { struct file *file; ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/