[Devel] Re: [PATCH 1/2] [RFC] Add file f_flags to cgroup write_string ops

Matt Helsley matthltc at us.ibm.com
Wed Oct 28 00:24:48 PDT 2009


On Tue, Oct 27, 2009 at 11:06:19PM -0700, Paul Menage wrote:
> On Tue, Oct 27, 2009 at 11:04 PM, Paul Menage <menage at google.com> wrote:
> > On Tue, Oct 27, 2009 at 6:04 PM, Li Zefan <lizf at cn.fujitsu.com> wrote:
> >>
> >> I think maybe it's better to store struct file *file to struct cftype,
> >> so we don't need to change write_string(), write(), write_u64()
> >> and write_s64().
> >
> > We can't do that - multiple open files could be using the same cftype
> > at the same time. I'd be inclined if necessary to just pass the struct
> > file* in, rather than risk needing to change it to pass more
> > parameters later.
> 
> And I imagine that the number of handlers that actually make use of
> the cftype* is rather small. If we pass the file* to the handler
> instead of passing the cftype*, and provide an inline function to get
> from the file* to the cftype*, then we can avoid adding an extra
> parameter to the handlers.

OK, I've done this for write_string(). I named the inline function
cgroup_file_cftype(). It seems that, if we do this for one, then 
we should do it for all of the cgroup file io ops. Agreed?

Cheers,
	-Matt Helsley
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list