Remove the static qualifier from cgroup_fill_cgc(). As part of the cgget refactor, cgget will utilize this function.
Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com> --- src/api.c | 4 ++-- src/libcgroup-internal.h | 15 +++++++++++++++ src/libcgroup.map | 1 + 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/api.c b/src/api.c index 8853e5439f0d..1a5e4a781b58 100644 --- a/src/api.c +++ b/src/api.c @@ -2971,8 +2971,8 @@ static int cg_rd_ctrl_file(const char *subsys, const char *cgroup, /* * Call this function with required locks taken. */ -static int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup, - struct cgroup_controller *cgc, int cg_index) +int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup, + struct cgroup_controller *cgc, int cg_index) { char *ctrl_name = NULL; char *ctrl_file = NULL; diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h index c152b6872c23..eef54442674b 100644 --- a/src/libcgroup-internal.h +++ b/src/libcgroup-internal.h @@ -19,6 +19,7 @@ __BEGIN_DECLS #include "config.h" +#include <dirent.h> #include <fts.h> #include <libcgroup.h> #include <limits.h> @@ -335,6 +336,20 @@ int cgroup_build_tasks_procs_path(char * const path, char *cg_build_path_locked(const char *setting, char *path, const char *controller); +/** + * Given a cgroup controller and a setting within it, populate the setting's + * value + * + * @param ctrl_dir dirent representation of the setting, e.g. memory.stat + * @param cgroup current cgroup + * @param cgc current cgroup controller + * @param cg_index Index into the cg_mount_table of the cgroup + * + * @note The cg_mount_table_lock must be held prior to calling this function + */ +int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup *cgroup, + struct cgroup_controller *cgc, int cg_index); + /** * Functions that are defined as STATIC can be placed within the UNIT_TEST * ifdef. This will allow them to be included in the unit tests while diff --git a/src/libcgroup.map b/src/libcgroup.map index fbb4530a6a04..f7cc710a27a3 100644 --- a/src/libcgroup.map +++ b/src/libcgroup.map @@ -133,4 +133,5 @@ CGROUP_0.42 { CGROUP_0.43 { cgroup_build_tasks_procs_path; cg_build_path_locked; + cgroup_fill_cgc; } CGROUP_0.42; -- 2.26.2 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel