@@ -112,6 +112,16 @@ static inline void put_misc_cg(struct misc_cg *cg)
css_put(&cg->css);
}
+/*
+ * misc_cg_tryget() - Try to increment this misc cgroup ref count.
+ * @cg - cgroup to get.
+ */
+static inline bool misc_cg_tryget(struct misc_cg *cg)
+{
+ if (cg)
+ return css_tryget(&cg->css);
+ return false;
+}
#else /* !CONFIG_CGROUP_MISC */
static inline struct misc_cg *root_misc(void)
{
@@ -175,6 +185,11 @@ static inline void put_misc_cg(struct misc_cg *cg)
{
}
+static inline bool misc_cg_tryget(struct misc_cg *cg)
+{
+ return true;
+}
+
static inline int register_misc_cg_notifier(struct notifier_block *nb)
{
return 0;
Allows caller to do a css_tryget() on a specific misc cgroup. Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com> --- include/linux/misc_cgroup.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+)