aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorBob Liu <lliubbo@gmail.com>2010-05-24 17:32:01 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-25 11:06:57 -0400
commit1980050250fa052b1c24a19f9b3d82fae14d77f8 (patch)
tree96743238e6941bd7af113ebe9275f6892b374dd3 /mm
parent6eb27e1fdf5781719a3d2e90e6c89fa012135c62 (diff)
mempolicy: remove redundant check
Lee's patch "mempolicy: use MPOL_PREFERRED for system-wide default policy" has made the MPOL_DEFAULT only used in the memory policy APIs. So, no need to check in __mpol_equal also. Also get rid of mpol_match_intent() and move its logic directly into __mpol_equal(). Signed-off-by: Bob Liu <lliubbo@gmail.com> Acked-by: David Rientjes <rientjes@google.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mempolicy.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index d97355b744ab..ac5aeafaec9a 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1787,16 +1787,6 @@ struct mempolicy *__mpol_cond_copy(struct mempolicy *tompol,
1787 return tompol; 1787 return tompol;
1788} 1788}
1789 1789
1790static int mpol_match_intent(const struct mempolicy *a,
1791 const struct mempolicy *b)
1792{
1793 if (a->flags != b->flags)
1794 return 0;
1795 if (!mpol_store_user_nodemask(a))
1796 return 1;
1797 return nodes_equal(a->w.user_nodemask, b->w.user_nodemask);
1798}
1799
1800/* Slow path of a mempolicy comparison */ 1790/* Slow path of a mempolicy comparison */
1801int __mpol_equal(struct mempolicy *a, struct mempolicy *b) 1791int __mpol_equal(struct mempolicy *a, struct mempolicy *b)
1802{ 1792{
@@ -1804,8 +1794,12 @@ int __mpol_equal(struct mempolicy *a, struct mempolicy *b)
1804 return 0; 1794 return 0;
1805 if (a->mode != b->mode) 1795 if (a->mode != b->mode)
1806 return 0; 1796 return 0;
1807 if (a->mode != MPOL_DEFAULT && !mpol_match_intent(a, b)) 1797 if (a->flags != b->flags)
1808 return 0; 1798 return 0;
1799 if (mpol_store_user_nodemask(a))
1800 if (!nodes_equal(a->w.user_nodemask, b->w.user_nodemask))
1801 return 0;
1802
1809 switch (a->mode) { 1803 switch (a->mode) {
1810 case MPOL_BIND: 1804 case MPOL_BIND:
1811 /* Fall through */ 1805 /* Fall through */