From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Serge E. Hallyn" Subject: [PATCH 1/1] use more compatible code in special_mapping_restore Date: Thu, 28 Jan 2010 21:30:41 -0600 Message-ID: <20100129033041.GA21071@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: Linux Containers List-Id: containers.vger.kernel.org (Also remove some unused vars in my do_unmap helper) Signed-off-by: Serge E. Hallyn --- mm/mmap.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 15afae6..468c8e2 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1960,9 +1961,6 @@ int do_munmap_nocheck(struct mm_struct *mm, unsigned long start, size_t len) int do_munmap(struct mm_struct *mm, unsigned long start, size_t len) { - unsigned long end; - struct vm_area_struct *vma, *prev, *last; - if ((start & ~PAGE_MASK) || start > TASK_SIZE || len > TASK_SIZE-start) return -EINVAL; @@ -2354,10 +2352,10 @@ int special_mapping_restore(struct ckpt_ctx *ctx, * Even that, is very basic - call arch_setup_additional_pages * requiring the same mapping (start address) as before. */ -#ifdef CONFIG_X86_64 && CONFIG_COMPAT - if (test_thread_flag(TIF_IA32)) - return syscall32_setup_pages(NULL, h->vm_start, 0); -#endif +#ifdef CONFIG_COMPAT + if (is_compat_task()) + return compat_arch_setup_additional_pages(NULL, h->vm_start, 0); +#endif return arch_setup_additional_pages(NULL, h->vm_start, 0); } #else /* !CONFIG_CHECKPOINT */ -- 1.6.0.6