All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mempolicy: use vma_policy and vma_set_policy macros
@ 2006-11-16 11:00 David Rientjes
  2006-11-16 11:11 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: David Rientjes @ 2006-11-16 11:00 UTC (permalink / raw)
  To: ak; +Cc: clameter, linux-kernel

Use vma_policy() and vma_set_policy() macros provided in 
include/linux/mempolicy.h.

Cc: Andi Kleen <ak@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: David Rientjes <rientjes@cs.washington.edu>
---
 mm/mempolicy.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 617fb31..99e6560 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -379,7 +379,7 @@ check_range(struct mm_struct *mm, unsign
 static int policy_vma(struct vm_area_struct *vma, struct mempolicy *new)
 {
 	int err = 0;
-	struct mempolicy *old = vma->vm_policy;
+	struct mempolicy *old = vma_policy(vma);
 
 	PDprintk("vma %lx-%lx/%lx vm_ops %p vm_file %p set_policy %p\n",
 		 vma->vm_start, vma->vm_end, vma->vm_pgoff,
@@ -390,7 +390,7 @@ static int policy_vma(struct vm_area_str
 		err = vma->vm_ops->set_policy(vma, new);
 	if (!err) {
 		mpol_get(new);
-		vma->vm_policy = new;
+		vma_set_policy(vma, new);
 		mpol_free(old);
 	}
 	return err;
@@ -542,7 +542,7 @@ long do_get_mempolicy(int *policy, nodem
 		if (vma->vm_ops && vma->vm_ops->get_policy)
 			pol = vma->vm_ops->get_policy(vma, addr);
 		else
-			pol = vma->vm_policy;
+			pol = vma_policy(vma);
 	} else if (addr)
 		return -EINVAL;
 
@@ -1078,9 +1078,9 @@ static struct mempolicy * get_vma_policy
 	if (vma) {
 		if (vma->vm_ops && vma->vm_ops->get_policy)
 			pol = vma->vm_ops->get_policy(vma, addr);
-		else if (vma->vm_policy &&
-				vma->vm_policy->policy != MPOL_DEFAULT)
-			pol = vma->vm_policy;
+		else if (vma_policy(vma) &&
+				vma_policy(vma)->policy != MPOL_DEFAULT)
+			pol = vma_policy(vma);
 	}
 	if (!pol)
 		pol = &default_policy;
@@ -1697,7 +1697,7 @@ void mpol_rebind_mm(struct mm_struct *mm
 
 	down_write(&mm->mmap_sem);
 	for (vma = mm->mmap; vma; vma = vma->vm_next)
-		mpol_rebind_policy(vma->vm_policy, new);
+		mpol_rebind_policy(vma_policy(vma), new);
 	up_write(&mm->mmap_sem);
 }
 

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mempolicy: use vma_policy and vma_set_policy macros
  2006-11-16 11:00 [PATCH] mempolicy: use vma_policy and vma_set_policy macros David Rientjes
@ 2006-11-16 11:11 ` Andi Kleen
  2006-11-16 16:18   ` Christoph Lameter
  0 siblings, 1 reply; 3+ messages in thread
From: Andi Kleen @ 2006-11-16 11:11 UTC (permalink / raw)
  To: David Rientjes; +Cc: clameter, linux-kernel

On Thursday 16 November 2006 12:00, David Rientjes wrote:
> Use vma_policy() and vma_set_policy() macros provided in 
> include/linux/mempolicy.h.

Why? I don't think it makes the code any more readable

-Andi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mempolicy: use vma_policy and vma_set_policy macros
  2006-11-16 11:11 ` Andi Kleen
@ 2006-11-16 16:18   ` Christoph Lameter
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Lameter @ 2006-11-16 16:18 UTC (permalink / raw)
  To: Andi Kleen; +Cc: David Rientjes, linux-kernel

On Thu, 16 Nov 2006, Andi Kleen wrote:

> On Thursday 16 November 2006 12:00, David Rientjes wrote:
> > Use vma_policy() and vma_set_policy() macros provided in 
> > include/linux/mempolicy.h.
> 
> Why? I don't think it makes the code any more readable

I agree. Lets leave it as it is.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-11-16 16:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-16 11:00 [PATCH] mempolicy: use vma_policy and vma_set_policy macros David Rientjes
2006-11-16 11:11 ` Andi Kleen
2006-11-16 16:18   ` Christoph Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.