public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>, andi@firstfloor.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] init_new_context: Use the passed task argument
Date: Wed, 28 Feb 2007 10:17:44 +0530	[thread overview]
Message-ID: <20070228044744.GA14739@skywalker.in.ibm.com> (raw)


Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 arch/i386/kernel/ldt.c   |    2 +-
 arch/x86_64/kernel/ldt.c |    2 +-
 kernel/fork.c            |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/i386/kernel/ldt.c b/arch/i386/kernel/ldt.c
index b410e5f..925354c 100644
--- a/arch/i386/kernel/ldt.c
+++ b/arch/i386/kernel/ldt.c
@@ -97,7 +97,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 
 	init_MUTEX(&mm->context.sem);
 	mm->context.size = 0;
-	old_mm = current->mm;
+	old_mm = tsk->mm;
 	if (old_mm && old_mm->context.size > 0) {
 		down(&old_mm->context.sem);
 		retval = copy_ldt(&mm->context, &old_mm->context);
diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86_64/kernel/ldt.c
index d7e5d0c..16ae79d 100644
--- a/arch/x86_64/kernel/ldt.c
+++ b/arch/x86_64/kernel/ldt.c
@@ -101,7 +101,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
 
 	init_MUTEX(&mm->context.sem);
 	mm->context.size = 0;
-	old_mm = current->mm;
+	old_mm = tsk->mm;
 	if (old_mm && old_mm->context.size > 0) {
 		down(&old_mm->context.sem);
 		retval = copy_ldt(&mm->context, &old_mm->context);
diff --git a/kernel/fork.c b/kernel/fork.c
index d154cc7..2184ef5 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -477,7 +477,7 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
  */
 static struct mm_struct *dup_mm(struct task_struct *tsk)
 {
-	struct mm_struct *mm, *oldmm = current->mm;
+	struct mm_struct *mm, *oldmm = tsk->mm;
 	int err;
 
 	if (!oldmm)
@@ -551,7 +551,7 @@ static int copy_mm(unsigned long clone_flags, struct task_struct * tsk)
 	}
 
 	retval = -ENOMEM;
-	mm = dup_mm(tsk);
+	mm = dup_mm(current);
 	if (!mm)
 		goto fail_nomem;
 
-- 
1.5.0.1.227.g99d42-dirty


             reply	other threads:[~2007-02-28  4:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-28  4:47 Aneesh Kumar K.V [this message]
     [not found] <11722452363488-git-send-email-aneesh.kumar@gmail.com>
     [not found] ` <11722452452225-git-send-email-aneesh.kumar@gmail.com>
2007-02-27 20:26   ` [PATCH] init_new_context: Use the passed task argument Andrew Morton
2007-02-28  4:12     ` Aneesh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070228044744.GA14739@skywalker.in.ibm.com \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox