core: make IOSchedulingClass= and IOSchedulingPriority= settable for transient units
This patch is a bit more complex thant I hoped. In particular the single IOScheduling= property exposed on the bus is split up into IOSchedulingClass= and IOSchedulingPriority= (though compat is retained). Otherwise the asymmetry between setting props and getting them is a bit too nasty. Fixes #5613
This commit is contained in:
@@ -905,6 +905,23 @@ int pid_compare_func(const void *a, const void *b) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ioprio_parse_priority(const char *s, int *ret) {
|
||||
int i, r;
|
||||
|
||||
assert(s);
|
||||
assert(ret);
|
||||
|
||||
r = safe_atoi(s, &i);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!ioprio_priority_is_valid(i))
|
||||
return -EINVAL;
|
||||
|
||||
*ret = i;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char *const ioprio_class_table[] = {
|
||||
[IOPRIO_CLASS_NONE] = "none",
|
||||
[IOPRIO_CLASS_RT] = "realtime",
|
||||
|
||||
Reference in New Issue
Block a user