]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
api.c: Remove static from cgroup_copy_controller_values()
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 15 Dec 2021 19:37:36 +0000 (19:37 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 3 Feb 2022 21:41:45 +0000 (14:41 -0700)
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.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/api.c
src/libcgroup-internal.h

index cf3ff6c91021e87ef5801e858f9d87ccfb5cf556..e2ff6441ffe97b56305b9d69a223acaacdd4a030 100644 (file)
--- a/src/api.c
+++ b/src/api.c
@@ -2260,14 +2260,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;
 
index dd390cc7a551256e37e8e5a88f842531fd717a7e..616271feee8c629ef24d6df1c2a6a1902bb4d311 100644 (file)
@@ -360,6 +360,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