|
@@ -3503,6 +3503,23 @@ static int cgroup_events_show(struct seq_file *seq, void *v)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int cgroup_file_open(struct kernfs_open_file *of)
|
|
|
|
+{
|
|
|
|
+ struct cftype *cft = of->kn->priv;
|
|
|
|
+
|
|
|
|
+ if (cft->open)
|
|
|
|
+ return cft->open(of);
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static void cgroup_file_release(struct kernfs_open_file *of)
|
|
|
|
+{
|
|
|
|
+ struct cftype *cft = of->kn->priv;
|
|
|
|
+
|
|
|
|
+ if (cft->release)
|
|
|
|
+ cft->release(of);
|
|
|
|
+}
|
|
|
|
+
|
|
static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
|
|
static ssize_t cgroup_file_write(struct kernfs_open_file *of, char *buf,
|
|
size_t nbytes, loff_t off)
|
|
size_t nbytes, loff_t off)
|
|
{
|
|
{
|
|
@@ -3553,7 +3570,8 @@ static void *cgroup_seqfile_next(struct seq_file *seq, void *v, loff_t *ppos)
|
|
|
|
|
|
static void cgroup_seqfile_stop(struct seq_file *seq, void *v)
|
|
static void cgroup_seqfile_stop(struct seq_file *seq, void *v)
|
|
{
|
|
{
|
|
- seq_cft(seq)->seq_stop(seq, v);
|
|
|
|
|
|
+ if (seq_cft(seq)->seq_stop)
|
|
|
|
+ seq_cft(seq)->seq_stop(seq, v);
|
|
}
|
|
}
|
|
|
|
|
|
static int cgroup_seqfile_show(struct seq_file *m, void *arg)
|
|
static int cgroup_seqfile_show(struct seq_file *m, void *arg)
|
|
@@ -3575,12 +3593,16 @@ static int cgroup_seqfile_show(struct seq_file *m, void *arg)
|
|
|
|
|
|
static struct kernfs_ops cgroup_kf_single_ops = {
|
|
static struct kernfs_ops cgroup_kf_single_ops = {
|
|
.atomic_write_len = PAGE_SIZE,
|
|
.atomic_write_len = PAGE_SIZE,
|
|
|
|
+ .open = cgroup_file_open,
|
|
|
|
+ .release = cgroup_file_release,
|
|
.write = cgroup_file_write,
|
|
.write = cgroup_file_write,
|
|
.seq_show = cgroup_seqfile_show,
|
|
.seq_show = cgroup_seqfile_show,
|
|
};
|
|
};
|
|
|
|
|
|
static struct kernfs_ops cgroup_kf_ops = {
|
|
static struct kernfs_ops cgroup_kf_ops = {
|
|
.atomic_write_len = PAGE_SIZE,
|
|
.atomic_write_len = PAGE_SIZE,
|
|
|
|
+ .open = cgroup_file_open,
|
|
|
|
+ .release = cgroup_file_release,
|
|
.write = cgroup_file_write,
|
|
.write = cgroup_file_write,
|
|
.seq_start = cgroup_seqfile_start,
|
|
.seq_start = cgroup_seqfile_start,
|
|
.seq_next = cgroup_seqfile_next,
|
|
.seq_next = cgroup_seqfile_next,
|