2013-04-16 20:25:21

by Rami Rosen

[permalink] [raw]
Subject: [PATCH] devcg: remove parent_cgroup.

In devcgroup_css_alloc(), there is no longer need for parent_cgroup.
bd2953ebbb("devcg: propagate local changes down the hierarchy") made
the variable parent_cgroup redundant. This patch removes parent_cgroup
from devcgroup_css_alloc().

Signed-off-by: Rami Rosen <[email protected]>
---
security/device_cgroup.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/security/device_cgroup.c b/security/device_cgroup.c
index 994aecc..dd0dc57 100644
--- a/security/device_cgroup.c
+++ b/security/device_cgroup.c
@@ -236,7 +236,6 @@ static void devcgroup_offline(struct cgroup *cgroup)
static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
{
struct dev_cgroup *dev_cgroup;
- struct cgroup *parent_cgroup;

dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL);
if (!dev_cgroup)
@@ -244,7 +243,6 @@ static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
INIT_LIST_HEAD(&dev_cgroup->exceptions);
INIT_LIST_HEAD(&dev_cgroup->propagate_pending);
dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
- parent_cgroup = cgroup->parent;

return &dev_cgroup->css;
}
--
1.8.1.4


2013-04-16 20:37:13

by Aristeu Rozanski

[permalink] [raw]
Subject: Re: [PATCH] devcg: remove parent_cgroup.

On Tue, Apr 16, 2013 at 11:24:55PM +0300, Rami Rosen wrote:
> In devcgroup_css_alloc(), there is no longer need for parent_cgroup.
> bd2953ebbb("devcg: propagate local changes down the hierarchy") made
> the variable parent_cgroup redundant. This patch removes parent_cgroup
> from devcgroup_css_alloc().
>
> Signed-off-by: Rami Rosen <[email protected]>
> ---
> security/device_cgroup.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/security/device_cgroup.c b/security/device_cgroup.c
> index 994aecc..dd0dc57 100644
> --- a/security/device_cgroup.c
> +++ b/security/device_cgroup.c
> @@ -236,7 +236,6 @@ static void devcgroup_offline(struct cgroup *cgroup)
> static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
> {
> struct dev_cgroup *dev_cgroup;
> - struct cgroup *parent_cgroup;
>
> dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL);
> if (!dev_cgroup)
> @@ -244,7 +243,6 @@ static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
> INIT_LIST_HEAD(&dev_cgroup->exceptions);
> INIT_LIST_HEAD(&dev_cgroup->propagate_pending);
> dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
> - parent_cgroup = cgroup->parent;
>
> return &dev_cgroup->css;
> }

oops

ACK

--
Aristeu

2013-04-16 21:07:39

by Serge Hallyn

[permalink] [raw]
Subject: Re: [PATCH] devcg: remove parent_cgroup.

Quoting Aristeu Rozanski ([email protected]):
> On Tue, Apr 16, 2013 at 11:24:55PM +0300, Rami Rosen wrote:
> > In devcgroup_css_alloc(), there is no longer need for parent_cgroup.
> > bd2953ebbb("devcg: propagate local changes down the hierarchy") made
> > the variable parent_cgroup redundant. This patch removes parent_cgroup
> > from devcgroup_css_alloc().
> >
> > Signed-off-by: Rami Rosen <[email protected]>
> > ---
> > security/device_cgroup.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/security/device_cgroup.c b/security/device_cgroup.c
> > index 994aecc..dd0dc57 100644
> > --- a/security/device_cgroup.c
> > +++ b/security/device_cgroup.c
> > @@ -236,7 +236,6 @@ static void devcgroup_offline(struct cgroup *cgroup)
> > static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
> > {
> > struct dev_cgroup *dev_cgroup;
> > - struct cgroup *parent_cgroup;
> >
> > dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL);
> > if (!dev_cgroup)
> > @@ -244,7 +243,6 @@ static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
> > INIT_LIST_HEAD(&dev_cgroup->exceptions);
> > INIT_LIST_HEAD(&dev_cgroup->propagate_pending);
> > dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
> > - parent_cgroup = cgroup->parent;
> >
> > return &dev_cgroup->css;
> > }
>
> oops
>
> ACK

Not seeing the patches this is based on in Linus' tree yet, but given
the context above I don't see how it could not be right :)

Acked-by: Serge E. Hallyn <[email protected]>

2013-04-16 21:24:11

by Aristeu Rozanski

[permalink] [raw]
Subject: Re: [PATCH] devcg: remove parent_cgroup.

On Tue, Apr 16, 2013 at 04:07:25PM -0500, Serge Hallyn wrote:
> Quoting Aristeu Rozanski ([email protected]):
> > On Tue, Apr 16, 2013 at 11:24:55PM +0300, Rami Rosen wrote:
> > > In devcgroup_css_alloc(), there is no longer need for parent_cgroup.
> > > bd2953ebbb("devcg: propagate local changes down the hierarchy") made
> > > the variable parent_cgroup redundant. This patch removes parent_cgroup
> > > from devcgroup_css_alloc().
> > >
> > > Signed-off-by: Rami Rosen <[email protected]>
> > > ---
> > > security/device_cgroup.c | 2 --
> > > 1 file changed, 2 deletions(-)
> > >
> > > diff --git a/security/device_cgroup.c b/security/device_cgroup.c
> > > index 994aecc..dd0dc57 100644
> > > --- a/security/device_cgroup.c
> > > +++ b/security/device_cgroup.c
> > > @@ -236,7 +236,6 @@ static void devcgroup_offline(struct cgroup *cgroup)
> > > static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
> > > {
> > > struct dev_cgroup *dev_cgroup;
> > > - struct cgroup *parent_cgroup;
> > >
> > > dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL);
> > > if (!dev_cgroup)
> > > @@ -244,7 +243,6 @@ static struct cgroup_subsys_state *devcgroup_css_alloc(struct cgroup *cgroup)
> > > INIT_LIST_HEAD(&dev_cgroup->exceptions);
> > > INIT_LIST_HEAD(&dev_cgroup->propagate_pending);
> > > dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
> > > - parent_cgroup = cgroup->parent;
> > >
> > > return &dev_cgroup->css;
> > > }
> >
> > oops
> >
> > ACK
>
> Not seeing the patches this is based on in Linus' tree yet, but given
> the context above I don't see how it could not be right :)

they're on Tejun's tree

--
Aristeu

2013-04-18 18:36:06

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH] devcg: remove parent_cgroup.

On Tue, Apr 16, 2013 at 11:24:55PM +0300, Rami Rosen wrote:
> In devcgroup_css_alloc(), there is no longer need for parent_cgroup.
> bd2953ebbb("devcg: propagate local changes down the hierarchy") made
> the variable parent_cgroup redundant. This patch removes parent_cgroup
> from devcgroup_css_alloc().
>
> Signed-off-by: Rami Rosen <[email protected]>

Applied to cgroup/for-3.10.

Thanks.

--
tejun