cgroupfs: cpuset support for kernels without cgroup.clone_children

Hi,

as promised last week, here's my patch for cpuset cgroup support for
kernels without the cgroup.clone_children feature.

My initial patch used "#include <linux/version.h>" and the macros defined
there to decide if cgroup.clone_children should be used or not.  After
having seen Serge Hallyn's patch which he posted to the list last Wednesday,
where he used stat() to check if the cgroup.clone_children file is there,
I rewrote my patch to do the same.

The patch is against 1.0.0.beta3, and it is tested successfully with
RHEL-6's kernel version 2.6.32-431.3.1.el6, compiled without cgmanager
(I've so far not tried to use cgmanager in RHEL-6).

In addition to fixing the cpuset cgroup setup, this patch also fixes a
wrong argument in a call to handle_cgroup_settings() in the same context.

	Robert

Signed-off-by: Robert Vogelgesang <vogel@users.sourceforge.net>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
cgroups: adjust previous commit

Remove a memory leak on error path.

Only try to initialize cpuset if cgroup.clonechildren does not exist.

Bump the max value we read from cpuset.{cpus,mems} to 1024.

If cpuset.cpus or .mems is already initialized but is too long, don't fail.

If parent's cpuset.cpus or .mems is too long, record an error and fail.
If anyone actually runs into this, we can simply allocate the required
length as needed, but we don't expect anyone to run into this.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>