-usec_t cgroup_context_get_cpu_quota_usec(CGroupContext *c) {
- assert(c);
-
- /* Returns the absolute CPU quota */
-
- if (c->cpu_quota_usec != (usec_t) -1)
- return c->cpu_quota_usec;
- else if (c->cpu_quota_per_sec_usec != (usec_t) -1)
- return c->cpu_quota_per_sec_usec*c->cpu_quota_period_usec/USEC_PER_SEC;
- else
- return (usec_t) -1;
-}
-
-usec_t cgroup_context_get_cpu_quota_per_sec_usec(CGroupContext *c) {
- assert(c);
-
- /* Returns the CPU quota relative to 1s */
-
- if (c->cpu_quota_usec != (usec_t) -1)
- return c->cpu_quota_usec*USEC_PER_SEC/c->cpu_quota_period_usec;
- else if (c->cpu_quota_per_sec_usec != (usec_t) -1)
- return c->cpu_quota_per_sec_usec;
- else
- return (usec_t) -1;
-}
-