mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: "Serge E. Hallyn" <serue@us.ibm.com>,
	Paul Menage <menage@google.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] cgroups: introduce cft->read_seq()
Date: Wed, 2 Apr 2008 22:53:47 -0500	[thread overview]
Message-ID: <20080403035347.GB25873@sergelap.austin.ibm.com> (raw)
In-Reply-To: <47F440F7.6080308@cn.fujitsu.com>

Quoting Li Zefan (lizf@cn.fujitsu.com):
> Li Zefan wrote:
> > Serge E. Hallyn wrote:
> >> Hi Paul,
> >>
> >> the following (against 2.6.25-rc8-mm1) is a first attempt
> >> at a simple seq_file usage in cgroups.  Comments much
> >> appreciated.
> >>
> >> thanks,
> >> -serge
> >>
> >> >From bd0977a5819dc43866fff325ae1e2726e747e2f4 Mon Sep 17 00:00:00 2001
> >> From: Serge E. Hallyn <serue@us.ibm.com>
> >> Date: Wed, 2 Apr 2008 17:54:21 -0700
> >> Subject: [PATCH 1/1] cgroups: introduce cft->read_seq()
> >>
> >> Introduce a read_seq() helper in cftype, which uses
> >> seq_file to print out lists.  Use it in the devices
> >> cgroup.  Also split devices.allow into two files, so
> >> now devices.deny and devices.allow are the ones to
> >> use to manipulate the whitelist, while devices.list
> >> outputs the cgroup's current whitelist.
> >>
> >> Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
> >> ---
> >>  include/linux/cgroup.h   |    6 ++++
> >>  kernel/cgroup.c          |   22 ++++++++++++-
> >>  security/device_cgroup.c |   74 ++++++++++++++-------------------------------
> >>  3 files changed, 49 insertions(+), 53 deletions(-)
> >>
> >> diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
> >> index 2d1d151..feb83dd 100644
> >> --- a/include/linux/cgroup.h
> >> +++ b/include/linux/cgroup.h
> >> @@ -227,6 +227,12 @@ struct cftype {
> >>  	 */
> >>  	int (*read_map) (struct cgroup *cont, struct cftype *cft,
> >>  			 struct cgroup_map_cb *cb);
> >> +	/*
> >> +	 * read_seq() is used for outputting a simple sequence
> >> +	 * using seqfile.
> >> +	 */
> >> +	int (*read_seq) (struct cgroup *cont, struct cftype *cft,
> >> +			 struct seq_file *m);
> >>  
> > 
> > Can't we remove read_map() ?
> > 
> > btw: s/cont/cgrp
> > 
> 
> It seems read_seq() is the general case of read_map(). A read_seq() method can
> produce the output freely, and read_map() strictly produces string->u64 maps.

Right, the memcontroller cgroup is using read_map(), and I seem to recall
it was intended to be of pretty general use so I was going to just
leave it there.

As for s/cont/cgrp I agree but that's for a separate pure renaming
patch.  In the meantime I just wanted to follow the existing style.
I could rebase this patch on top of a renaming patch but that's
definately wrong for just soliciting comments on this being the right
approach.

Thanks for taking a look.

-serge

  reply	other threads:[~2008-04-03  3:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03  1:01 Serge E. Hallyn
2008-04-03  1:48 ` Li Zefan
2008-04-03  2:29   ` Li Zefan
2008-04-03  3:53     ` Serge E. Hallyn [this message]
2008-04-03  4:36 ` Paul Menage
2008-04-03  4:53   ` serge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080403035347.GB25873@sergelap.austin.ibm.com \
    --to=serue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=menage@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®