|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From ee26bcc0387f6eda83878eb85a08c01ee0d82c44 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Sun, 28 Sep 2014 23:42:33 -0400
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] core/dbus: simplify handling of CPUQuotaPerSecUSec
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
No functional change intended.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/core/dbus-cgroup.c | 20 +-------------------
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
1 file changed, 1 insertion(+), 19 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index eb7c2b9d27..900566c29b 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/core/dbus-cgroup.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/core/dbus-cgroup.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -133,24 +133,6 @@ static int property_get_device_allow(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return sd_bus_message_close_container(reply);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-static int property_get_cpu_quota_per_sec_usec(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- sd_bus *bus,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- const char *path,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- const char *interface,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- const char *property,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- sd_bus_message *reply,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- void *userdata,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- sd_bus_error *error) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- CGroupContext *c = userdata;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert(bus);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert(reply);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- assert(c);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- return sd_bus_message_append(reply, "t", c->cpu_quota_per_sec_usec);
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-}
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
static int property_get_ulong_as_u64(
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
sd_bus *bus,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
const char *path,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -174,7 +156,7 @@ const sd_bus_vtable bus_cgroup_vtable[] = {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SD_BUS_PROPERTY("CPUAccounting", "b", bus_property_get_bool, offsetof(CGroupContext, cpu_accounting), 0),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SD_BUS_PROPERTY("CPUShares", "t", property_get_ulong_as_u64, offsetof(CGroupContext, cpu_shares), 0),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SD_BUS_PROPERTY("StartupCPUShares", "t", property_get_ulong_as_u64, offsetof(CGroupContext, startup_cpu_shares), 0),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- SD_BUS_PROPERTY("CPUQuotaPerSecUSec", "t", property_get_cpu_quota_per_sec_usec, 0, 0),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ SD_BUS_PROPERTY("CPUQuotaPerSecUSec", "t", bus_property_get_usec, offsetof(CGroupContext, cpu_quota_per_sec_usec), 0),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SD_BUS_PROPERTY("BlockIOAccounting", "b", bus_property_get_bool, offsetof(CGroupContext, blockio_accounting), 0),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SD_BUS_PROPERTY("BlockIOWeight", "t", property_get_ulong_as_u64, offsetof(CGroupContext, blockio_weight), 0),
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
SD_BUS_PROPERTY("StartupBlockIOWeight", "t", property_get_ulong_as_u64, offsetof(CGroupContext, startup_blockio_weight), 0),
|