cgroup-util: drop 'controller' argument from cg_get_keyed_attribute() and cg_is_empty()

The argument is completely unused. Let's drop it.
This commit is contained in:
Yu Watanabe
2025-11-17 21:31:50 +09:00
parent 3454b160e4
commit 5d397dc7f4
13 changed files with 24 additions and 31 deletions
+3 -4
View File
@@ -610,7 +610,7 @@ int cg_pidref_get_path(const PidRef *pidref, char **ret_path) {
return 0;
}
int cg_is_empty(const char *controller, const char *path) {
int cg_is_empty(const char *path) {
_cleanup_free_ char *t = NULL;
int r;
@@ -623,7 +623,7 @@ int cg_is_empty(const char *controller, const char *path) {
if (empty_or_root(path))
return false;
r = cg_get_keyed_attribute(controller, path, "cgroup.events", STRV_MAKE("populated"), &t);
r = cg_get_keyed_attribute(path, "cgroup.events", STRV_MAKE("populated"), &t);
if (r == -ENOENT)
return true;
if (r < 0)
@@ -1551,7 +1551,6 @@ int cg_get_owner(const char *path, uid_t *ret_uid) {
}
int cg_get_keyed_attribute(
const char *controller,
const char *path,
const char *attribute,
char * const *keys,
@@ -1570,7 +1569,7 @@ int cg_get_keyed_attribute(
*
* If the attribute file doesn't exist at all returns ENOENT, if any key is not found returns ENXIO. */
r = cg_get_path(controller, path, attribute, &filename);
r = cg_get_path(SYSTEMD_CGROUP_CONTROLLER, path, attribute, &filename);
if (r < 0)
return r;
+2 -2
View File
@@ -181,7 +181,7 @@ int cg_get_attribute(const char *path, const char *attribute, char **ret);
int cg_get_attribute_as_uint64(const char *path, const char *attribute, uint64_t *ret);
int cg_get_attribute_as_bool(const char *path, const char *attribute);
int cg_get_keyed_attribute(const char *controller, const char *path, const char *attribute, char * const *keys, char **values);
int cg_get_keyed_attribute(const char *path, const char *attribute, char * const *keys, char **values);
int cg_get_owner(const char *path, uid_t *ret_uid);
@@ -191,7 +191,7 @@ int cg_get_xattr(const char *path, const char *name, char **ret, size_t *ret_siz
int cg_get_xattr_bool(const char *path, const char *name);
int cg_remove_xattr(const char *path, const char *name);
int cg_is_empty(const char *controller, const char *path);
int cg_is_empty(const char *path);
int cg_get_root_path(char **path);