aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mempolicy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mempolicy.c')
-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 */