From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Zefan Subject: Re: [PATCH 10/12] cgroup: attach cgroup_open_file to all cgroup files Date: Wed, 4 Dec 2013 14:04:36 +0800 Message-ID: <529EC5F4.10708@huawei.com> References: <1385595759-17656-1-git-send-email-tj@kernel.org> <1385595759-17656-11-git-send-email-tj@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1385595759-17656-11-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Tejun Heo Cc: nhorman-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, daniel.wagner-98C5kh4wR6ohFhg+JK9F0w@public.gmane.org, mhocko-AlSwsSmVLrQ@public.gmane.org, mingo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org > @@ -2353,10 +2338,18 @@ static int cgroup_file_open(struct inode *inode, struct file *file) > WARN_ON_ONCE(cfe->css && cfe->css != css); > cfe->css = css; > > - if (cft->open) > + if (cft->open) { > err = cft->open(inode, file); > - else > - err = single_open(file, cgroup_seqfile_show, cfe); > + } else { > + err = single_open_size(file, cgroup_seqfile_show, cfe, > + sizeof(struct cgroup_open_file)); This is wrong. I guess you wanted to use single_open_private(), which doesn't exist. > + if (!err) { > + struct seq_file *sf = file->private_data; > + struct cgroup_open_file *of = sf->private; > + > + of->cfe = cfe; > + } > + } > > if (css->ss && err) > css_put(css);