diff --git a/src/slurmd/common/xcgroup.c b/src/slurmd/common/xcgroup.c index 33134a7c05bdf9b709ca919eb926c11c9ead5880..7e8e54d10cf1993c56dd0e7489ea6afd50ed7b99 100644 --- a/src/slurmd/common/xcgroup.c +++ b/src/slurmd/common/xcgroup.c @@ -554,57 +554,6 @@ int xcgroup_get_pids(xcgroup_t* cg, pid_t **pids, int *npids) return fstatus; } -int xcgroup_set_params(xcgroup_t* cg, char* parameters) -{ - int fstatus = XCGROUP_ERROR; - char file_path[PATH_MAX]; - char* cpath = cg->path; - char* params; - char* value; - char* p; - char* next; - - params = (char*) xstrdup(parameters); - - p = params; - while (p != NULL && *p != '\0') { - next = xstrchr(p, ' '); - if (next) { - *next='\0'; - next++; - while (*next == ' ') - next++; - } - value = xstrchr(p, '='); - if (value != NULL) { - *value='\0'; - value++; - if (snprintf(file_path, PATH_MAX, "%s/%s", cpath, p) - >= PATH_MAX) { - debug2("unable to build filepath for '%s' and" - " parameter '%s' : %m", cpath, p); - goto next_loop; - } - fstatus = _file_write_content(file_path, value, - strlen(value)); - if (fstatus != XCGROUP_SUCCESS) - debug2("%s: unable to set parameter '%s' to " - "'%s' for '%s'", __func__, p, value, - cpath); - else - debug3("%s: parameter '%s' set to '%s' for '%s'", - __func__, p, value, cpath); - } else - debug2("%s: bad parameters format for entry '%s'", - __func__, p); - next_loop: - p = next; - } - - xfree(params); - return fstatus; -} - int xcgroup_set_param(xcgroup_t* cg, char* param, char* content) { int fstatus = XCGROUP_ERROR; diff --git a/src/slurmd/common/xcgroup.h b/src/slurmd/common/xcgroup.h index 304b41c3a4ee26ed524c080202250ef2de87746f..c2fec528e5b96253dd5e0caeff3ab5b6c0ae5b16 100644 --- a/src/slurmd/common/xcgroup.h +++ b/src/slurmd/common/xcgroup.h @@ -216,21 +216,6 @@ int xcgroup_add_pids(xcgroup_t* cg, pid_t* pids, int npids); */ int xcgroup_get_pids(xcgroup_t* cg, pid_t **pids, int *npids); -/* - * set cgroup parameters using string of the form : - * parameteres="param=value[ param=value]*" - * - * param must correspond to a file of the cgroup that - * will be written with the value content - * - * i.e. xcgroup_set_params(&cg,"memory.swappiness=10"); - * - * returned values: - * - XCGROUP_ERROR - * - XCGROUP_SUCCESS - */ -int xcgroup_set_params(xcgroup_t* cg, char* parameters); - /* * set a cgroup parameter *