summaryrefslogtreecommitdiff
path: root/include/linux/cgroup_refcnt.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2022-10-31 20:12:13 +0300
committerTejun Heo <tj@kernel.org>2022-10-31 20:12:13 +0300
commit79a7f41f7f5ac69fd22eaf1fb3e230bea95f3399 (patch)
treeafb5337317b4a5e1151852f3b1feb5d98ac0b92f /include/linux/cgroup_refcnt.h
parent6ab428604f724cf217a47b7d3f3353aab815b40e (diff)
downloadlinux-79a7f41f7f5ac69fd22eaf1fb3e230bea95f3399.tar.xz
cgroup: cgroup refcnt functions should be exported when CONFIG_DEBUG_CGROUP_REF
6ab428604f72 ("cgroup: Implement DEBUG_CGROUP_REF") added a config option which forces cgroup refcnt functions to be not inlined so that they can be kprobed for debugging. However, it forgot export them when the config is enabled breaking modules which make use of css reference counting. Fix it by adding CGROUP_REF_EXPORT() macro to cgroup_refcnt.h which is defined to EXPORT_SYMBOL_GPL when CONFIG_DEBUG_CGROUP_REF is set. Signed-off-by: Tejun Heo <tj@kernel.org> Fixes: 6ab428604f72 ("cgroup: Implement DEBUG_CGROUP_REF")
Diffstat (limited to 'include/linux/cgroup_refcnt.h')
-rw-r--r--include/linux/cgroup_refcnt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/cgroup_refcnt.h b/include/linux/cgroup_refcnt.h
index 1aa89295dac0..2eea0a69ecfc 100644
--- a/include/linux/cgroup_refcnt.h
+++ b/include/linux/cgroup_refcnt.h
@@ -10,6 +10,7 @@ void css_get(struct cgroup_subsys_state *css)
if (!(css->flags & CSS_NO_REF))
percpu_ref_get(&css->refcnt);
}
+CGROUP_REF_EXPORT(css_get)
/**
* css_get_many - obtain references on the specified css
@@ -24,6 +25,7 @@ void css_get_many(struct cgroup_subsys_state *css, unsigned int n)
if (!(css->flags & CSS_NO_REF))
percpu_ref_get_many(&css->refcnt, n);
}
+CGROUP_REF_EXPORT(css_get_many)
/**
* css_tryget - try to obtain a reference on the specified css
@@ -43,6 +45,7 @@ bool css_tryget(struct cgroup_subsys_state *css)
return percpu_ref_tryget(&css->refcnt);
return true;
}
+CGROUP_REF_EXPORT(css_tryget)
/**
* css_tryget_online - try to obtain a reference on the specified css if online
@@ -61,6 +64,7 @@ bool css_tryget_online(struct cgroup_subsys_state *css)
return percpu_ref_tryget_live(&css->refcnt);
return true;
}
+CGROUP_REF_EXPORT(css_tryget_online)
/**
* css_put - put a css reference
@@ -74,6 +78,7 @@ void css_put(struct cgroup_subsys_state *css)
if (!(css->flags & CSS_NO_REF))
percpu_ref_put(&css->refcnt);
}
+CGROUP_REF_EXPORT(css_put)
/**
* css_put_many - put css references
@@ -88,3 +93,4 @@ void css_put_many(struct cgroup_subsys_state *css, unsigned int n)
if (!(css->flags & CSS_NO_REF))
percpu_ref_put_many(&css->refcnt, n);
}
+CGROUP_REF_EXPORT(css_put_many)