summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2022-09-09 11:08:30 +0200
committerPeter Zijlstra <peterz@infradead.org>2022-09-09 11:08:30 +0200
commit0fb7b6f9d367965a8c2497c4d437dd225193b0f6 (patch)
tree4a6aca386addfcc06b719363ff1f990befb650d6 /kernel
parent7e18e42e4b280c85b76967a9106a13ca61c16179 (diff)
parent61742a7cd5b194d2cc52d78de8ec6967634a4cd6 (diff)
downloadlinux-next-0fb7b6f9d367965a8c2497c4d437dd225193b0f6.tar.gz
Merge branch 'driver-core/driver-core-next'
Pull in dependent cgroup patches Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup/cgroup.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index e4bb5d57f4d1..718a70c01c04 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -4372,6 +4372,26 @@ void cgroup_file_notify(struct cgroup_file *cfile)
}
/**
+ * cgroup_file_show - show or hide a hidden cgroup file
+ * @cfile: target cgroup_file obtained by setting cftype->file_offset
+ * @show: whether to show or hide
+ */
+void cgroup_file_show(struct cgroup_file *cfile, bool show)
+{
+ struct kernfs_node *kn;
+
+ spin_lock_irq(&cgroup_file_kn_lock);
+ kn = cfile->kn;
+ kernfs_get(kn);
+ spin_unlock_irq(&cgroup_file_kn_lock);
+
+ if (kn)
+ kernfs_show(kn, show);
+
+ kernfs_put(kn);
+}
+
+/**
* css_next_child - find the next child of a given css
* @pos: the current position (%NULL to initiate traversal)
* @parent: css whose children to walk