[Devel] [PATCH RHEL7 COMMIT] ub: export ub_get_{mem,blkio}_css
Konstantin Khorenko
khorenko at virtuozzo.com
Tue Jun 16 05:28:33 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.13
------>
commit ca1a8ad937aa7b45244776a4ebfb2e18f3a29c86
Author: Vladimir Davydov <vdavydov at parallels.com>
Date: Tue Jun 16 16:28:33 2015 +0400
ub: export ub_get_{mem,blkio}_css
Patchset description:
https://jira.sw.ru/browse/PSBM-34007
Vladimir Davydov (7):
ioprio: move IOPRIO_WHO_UBC handling out of rcu section
ub: zap ub_{init,fini}_ioprio
ub: export ub_get_{mem,blkio}_css
ub: ressurrect ioprio_set IOPRIO_WHO_UBC
ub: ressurrect iostat and ioprio reporting
ub: account writeback io
ub: do not include block/blk-cgroup.h from io_prio.c
This patch description:
I am going to use them outside kernel/bc/beancounter.c, so move them to
include/bc/beancounter.h
Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
Acked-by: Dmitry Monakhov <dmonakhov at openvz.org>
---
include/bc/beancounter.h | 15 +++++++++++++++
kernel/bc/beancounter.c | 15 +--------------
2 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/include/bc/beancounter.h b/include/bc/beancounter.h
index f8a2c21..9180f2a 100644
--- a/include/bc/beancounter.h
+++ b/include/bc/beancounter.h
@@ -172,6 +172,21 @@ static inline struct user_beancounter *cgroup_ub(struct cgroup *cg)
struct user_beancounter, css);
}
+extern struct cgroup_subsys_state *
+__ub_get_css(struct user_beancounter *ub, int idx);
+
+static inline struct cgroup_subsys_state *
+ub_get_mem_css(struct user_beancounter *ub)
+{
+ return __ub_get_css(ub, UB_MEM_CGROUP);
+}
+
+static inline struct cgroup_subsys_state *
+ub_get_blkio_css(struct user_beancounter *ub)
+{
+ return __ub_get_css(ub, UB_BLKIO_CGROUP);
+}
+
static inline int ub_barrier_hit(struct user_beancounter *ub, int resource)
{
return ub->ub_parms[resource].held > ub->ub_parms[resource].barrier;
diff --git a/kernel/bc/beancounter.c b/kernel/bc/beancounter.c
index ecc5a96..02ff31f 100644
--- a/kernel/bc/beancounter.c
+++ b/kernel/bc/beancounter.c
@@ -112,8 +112,7 @@ static void __ub_set_css(struct user_beancounter *ub, int idx,
css_put(old_css);
}
-static struct cgroup_subsys_state *
-__ub_get_css(struct user_beancounter *ub, int idx)
+struct cgroup_subsys_state *__ub_get_css(struct user_beancounter *ub, int idx)
{
struct cgroup_subsys_state *css, *root_css;
unsigned long flags;
@@ -153,24 +152,12 @@ static void ub_set_mem_css(struct user_beancounter *ub,
__ub_set_css(ub, UB_MEM_CGROUP, css);
}
-static inline struct cgroup_subsys_state *
-ub_get_mem_css(struct user_beancounter *ub)
-{
- return __ub_get_css(ub, UB_MEM_CGROUP);
-}
-
static void ub_set_blkio_css(struct user_beancounter *ub,
struct cgroup_subsys_state *css)
{
__ub_set_css(ub, UB_BLKIO_CGROUP, css);
}
-static inline struct cgroup_subsys_state *
-ub_get_blkio_css(struct user_beancounter *ub)
-{
- return __ub_get_css(ub, UB_BLKIO_CGROUP);
-}
-
/*
* Used to attach a task to a beancounter in the legacy API.
*/
More information about the Devel
mailing list