lkml.org 
[lkml]   [2006]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] mempolicy: use vma_policy and vma_set_policy macros
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);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-11-16 12:03    [W:0.025 / U:2.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site