From a32b08930f1828b39d6cafd2779bdab66aebc484 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Thu, 18 Jun 2009 19:42:45 +0530 Subject: libcgroup: Add flags to the walk_tree handle Introduce a cgroup_tree_handle structure so that we can track flags for the walk_tree operation. In a number of cases we would prefer to walk the tree in postorder as opposed to pre-order which is the current default. This patch does the addition. Changes since V1: 1. Added checks for !handle as suggested by Bharata Signed-off-by: Dhaval Giani Acked-by: Balbir Singh Acked-by: Bharata B Rao --- include/libcgroup.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/libcgroup.h') diff --git a/include/libcgroup.h b/include/libcgroup.h index c526f58..149a560 100644 --- a/include/libcgroup.h +++ b/include/libcgroup.h @@ -255,6 +255,16 @@ int cgroup_walk_tree_next(const int depth, void **handle, struct cgroup_file_info *info, int base_level); int cgroup_walk_tree_end(void **handle); +/** + * This API is used to set the flags for walk_tree API. Currently availble + * flags are + * + * CGROUP_WALK_TYPE_PRE_DIR + * CGROUP_WALK_TYPE_POST_DIR + * + */ +int cgroup_walk_tree_set_flags(void **handle, int flags); + /** * Read the statistics values for the specified controller * @controller: Name of the controller for which stats are requested. -- cgit