Remove static from cgroup_copy_controller_values() in api.c
so that other files within libcgroup can invoke it.  It will
be used by the abstraction layer code in a subsequent commit.

Also, declare *dst as a const pointer and *src as a const *
const pointer.  Subsequent abstraction layer checkins make
heavy use of const and without these changes warnings (which
continuous integration converts to errors) are thrown.

Signed-off-by: Tom Hromatka <tom.hroma...@oracle.com>
---
 src/api.c                | 10 ++--------
 src/libcgroup-internal.h | 11 +++++++++++
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/api.c b/src/api.c
index 4a980a157cde..303f699357b6 100644
--- a/src/api.c
+++ b/src/api.c
@@ -2174,14 +2174,8 @@ err:
 
 }
 
-/**
- * @dst: Destination controller
- * @src: Source controller from which values will be copied to dst
- *
- * Create a duplicate copy of values under the specified controller
- */
-static int cgroup_copy_controller_values(struct cgroup_controller *dst,
-                                       struct cgroup_controller *src)
+int cgroup_copy_controller_values(struct cgroup_controller * const dst,
+                                 const struct cgroup_controller * const src)
 {
        int i, ret = 0;
 
diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
index cbec4cd361b9..34c5be703920 100644
--- a/src/libcgroup-internal.h
+++ b/src/libcgroup-internal.h
@@ -364,6 +364,17 @@ int cgroup_fill_cgc(struct dirent *ctrl_dir, struct cgroup 
*cgroup,
  */
 int cgroup_test_subsys_mounted(const char *ctrl_name);
 
+/**
+ * Create a duplicate copy of values under the specified controller
+ *
+ * @dst: Destination controller
+ * @src: Source controller from which values will be copied to dst
+ *
+ * @return 0 on a successful copy, ECGOTHER if the copy failed
+ */
+int cgroup_copy_controller_values(struct cgroup_controller * const dst,
+                                 const struct cgroup_controller * const src);
+
 /**
  * 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
-- 
2.25.1



_______________________________________________
Libcg-devel mailing list
Libcg-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to