summaryrefslogtreecommitdiffstats
path: root/tests/libcgrouptest01.c
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2008-12-22 18:53:49 +0000
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2008-12-22 18:53:49 +0000
commit47197d3d7ca88abf7566951726212fdb7d9702ff (patch)
tree2631efac8e2d8e84fc54b9138143af1eed223b90 /tests/libcgrouptest01.c
parentc708d29de09ac3f223e25481af98e33426b15415 (diff)
downloadlibcg-47197d3d7ca88abf7566951726212fdb7d9702ff.tar.gz
libcg-47197d3d7ca88abf7566951726212fdb7d9702ff.tar.xz
libcg-47197d3d7ca88abf7566951726212fdb7d9702ff.zip
libcgroup: cleanup: remove redundant parameter to function
From: Sudhir Kumar <skumar@linux.vnet.ibm.com> There is no need to pass a separate variable for getting single/multiple mount info, as we can get this info from the varaible received from script. So this patch does that modification and puts the variaable fs_mounted as global as it is never modified. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@284 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests/libcgrouptest01.c')
-rw-r--r--tests/libcgrouptest01.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c
index 46a5bb3..b0a9bd9 100644
--- a/tests/libcgrouptest01.c
+++ b/tests/libcgrouptest01.c
@@ -18,7 +18,7 @@
int main(int argc, char *argv[])
{
- int fs_mounted, retval;
+ int retval;
struct cgroup *cgroup1, *cgroup2, *cgroup3, *nullcgroup = NULL;
struct cgroup_controller *sec_controller;
/* In case of multimount for readability we use the controller name
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
*/
test_cgroup_attach_task(ECGROUPNOTINITIALIZED, nullcgroup,
- NULL, NULL, FS_NOT_MOUNTED, 0, 2);
+ NULL, NULL, 0, 2);
/*
* Test03: Create a valid cgroup ds and check all return values
@@ -179,7 +179,7 @@ int main(int argc, char *argv[])
*/
test_cgroup_attach_task(ECGROUPNOTINITIALIZED, nullcgroup,
- NULL, NULL, FS_MOUNTED, 0, 1);
+ NULL, NULL, 0, 1);
/*
* Test02: call cgroup_init() and check return values
@@ -197,7 +197,7 @@ int main(int argc, char *argv[])
*/
test_cgroup_attach_task(0, nullcgroup,
- NULL, NULL, FS_MOUNTED, 0, 3);
+ NULL, NULL, 0, 3);
/*
* Test04: Call cgroup_attach_task_pid() with null group
* and invalid pid
@@ -261,8 +261,7 @@ int main(int argc, char *argv[])
* Exp outcome: current task should be attached to that group
*/
- test_cgroup_attach_task(0, cgroup1, "group1", NULL,
- FS_MOUNTED, 20, 7);
+ test_cgroup_attach_task(0, cgroup1, "group1", NULL, 20, 7);
/*
* Test08: modify cgroup with the same cgroup
@@ -469,8 +468,7 @@ int main(int argc, char *argv[])
* Exp outcome: current task should be attached to root groups
*/
- test_cgroup_attach_task(0, nullcgroup,
- NULL, NULL, FS_MULTI_MOUNTED, 0, 2);
+ test_cgroup_attach_task(0, nullcgroup, NULL, NULL, 0, 2);
/*
* Test03: Create a valid cgroup structure
@@ -569,7 +567,7 @@ int main(int argc, char *argv[])
*/
test_cgroup_attach_task(0, ctl1_cgroup1, "ctl1_group1",
- NULL, FS_MULTI_MOUNTED, 20, 8);
+ NULL, 20, 8);
/*
* Test07: Call cgroup_attach_task() with a group with ctl2
@@ -579,7 +577,7 @@ int main(int argc, char *argv[])
*/
test_cgroup_attach_task(0, ctl2_cgroup1, "ctl1_group1",
- "ctl2_group1", FS_MULTI_MOUNTED, 20, 9);
+ "ctl2_group1", 20, 9);
/*
* Test: Create a valid cgroup structure
@@ -600,7 +598,7 @@ int main(int argc, char *argv[])
*/
test_cgroup_attach_task(ECGROUPNOTEXIST, ctl2_cgroup2,
- NULL, NULL, FS_MULTI_MOUNTED, 2, 11);
+ NULL, NULL, 2, 11);
/*
* Create another valid cgroup structure with same group name
@@ -784,7 +782,7 @@ int main(int argc, char *argv[])
*/
test_cgroup_attach_task(0, common_cgroup, "commongroup",
- "commongroup", FS_MULTI_MOUNTED, 1, 20);
+ "commongroup", 1, 20);
/*
* Test18: Create a valid cgroup structure to modify the
@@ -938,7 +936,7 @@ void test_cgroup_init(int retcode, int i)
void test_cgroup_attach_task(int retcode, struct cgroup *cgrp,
const char *group1, const char *group2,
- int fs_info, int k, int i)
+ int k, int i)
{
int retval;
char tasksfile[FILENAME_MAX], tasksfile2[FILENAME_MAX];
@@ -960,7 +958,7 @@ void test_cgroup_attach_task(int retcode, struct cgroup *cgrp,
group1, "tasks");
if (check_task(tasksfile)) {
- if (fs_info == 2) { /* multiple mounts */
+ if (fs_mounted == 2) { /* multiple mounts */
build_path(tasksfile2, mountpoint2,
group2, "tasks");
if (check_task(tasksfile2)) {