On Wed, Jan 14, 2009 at 11:16:53PM +0530, Balbir Singh wrote: > * Sudhir Kumar <[email protected]> [2009-01-14 22:53:24]: > > > > > This patch renames the function get_controllers() to a more > > meaningful name is_subsystem_enabled(). > > > > history: > > The code in the patch is part of a patch sent in an earlier patchset, > > which somehow got dropped (looks an older version of that patch was > > merged to the tree). Adding this patch makes everything upstream upto > > the discussion held on the list. > > > > Signed-off-by: Sudhir Kumar <[email protected]> > > Cc: Dhaval Giani <[email protected]> > > > > --- > > libcgrouptest.h | 2 +- > > libcgrouptest01.c | 4 ++-- > > test_functions.c | 2 +- > > 3 files changed, 4 insertions(+), 4 deletions(-) > > > > Index: trunk/tests/libcgrouptest.h > > =================================================================== > > --- trunk/tests.orig/libcgrouptest.h > > +++ trunk/tests/libcgrouptest.h > > @@ -126,7 +126,7 @@ void test_cgroup_get_cgroup(int ctl1, in > > > > void test_cgroup_compare_cgroup(int ctl1, int ctl2, int i); > > void test_cgroup_add_free_controller(int i); > > -void get_controllers(const char *name, int *exist); > > +void is_subsystem_enabled(const char *name, int *exist); > > int group_exist(char *path_group); > > int set_controller(int controller, char *controller_name, > > char *control_file); > > Index: trunk/tests/libcgrouptest01.c > > =================================================================== > > --- trunk/tests.orig/libcgrouptest01.c > > +++ trunk/tests/libcgrouptest01.c > > @@ -73,8 +73,8 @@ int main(int argc, char *argv[]) > > /* > > * check if one of the supported controllers is cpu or memory > > */ > > - get_controllers("cpu", &cpu); > > - get_controllers("memory", &memory); > > + is_subsystem_enabled("cpu", &cpu); > > + is_subsystem_enabled("memory", &memory); > > if (cpu == 0 && memory == 0) { > > fprintf(stderr, "none of cpu and memory controllers" > > " is enabled in kernel\n"); > > Index: trunk/tests/test_functions.c > > =================================================================== > > --- trunk/tests.orig/test_functions.c > > +++ trunk/tests/test_functions.c > > @@ -321,7 +321,7 @@ void test_cgroup_delete_cgroup(int retco > > * @param name the name of the controller to be checked > > * @param exist set to 1 if the controller exists > > */ > > -void get_controllers(const char *name, int *exist) > > +void is_subsystem_enabled(const char *name, int *exist) > > { > > int hierarchy, num_cgroups, enabled; > > FILE *fd; > > Can't we do something like > memory = subsystem_enabled("memory"); >
I recall mentioning something like that earlier. This is just another reason why I should not do anything serious after 10pm :(, Sudhir, can you send that change as well? thanks. -- regards, Dhaval ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
