Re: 'struct task_struct' has no member named 'mems_allowed' (was:Re: 2.6.20-rc4-mm1)

From: Christoph Lameter
Date: Fri Jan 12 2007 - 14:25:35 EST


On Fri, 12 Jan 2007, Paul Jackson wrote:

> I'll leave the honors to Christoph (added to CC), since this is his patch.

Ok. Here it is

mems_allowed only exists if CONFIG_CPUSETS is set. So put an #ifdef around
it. Also move the masking of the nodes behind the error check (looks
better) and add a comment.

Signed-off-by: Christoph Lameter <clameter@xxxxxxx>

Index: linux-2.6.20-rc4-mm1/mm/mempolicy.c
===================================================================
--- linux-2.6.20-rc4-mm1.orig/mm/mempolicy.c 2007-01-12 13:20:17.000000000 -0600
+++ linux-2.6.20-rc4-mm1/mm/mempolicy.c 2007-01-12 13:21:30.220968608 -0600
@@ -882,9 +882,12 @@ asmlinkage long sys_mbind(unsigned long
int err;

err = get_nodes(&nodes, nmask, maxnode);
- nodes_and(nodes, nodes, current->mems_allowed);
if (err)
return err;
+#ifdef CONFIG_CPUSETS
+ /* Restrict the nodes to the allowed nodes in the cpuset */
+ nodes_and(nodes, nodes, current->mems_allowed);
+#endif
return do_mbind(start, len, mode, &nodes, flags);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/