[PATCH] mempolicy: use vma_policy and vma_set_policy macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Cc: Andi Kleen <[email protected]>
Cc: Christoph Lameter <[email protected]>
Signed-off-by: David Rientjes <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux