Re: [PATCH v3 7/9] devcg: split single exception copy from dev_exceptions_copy()

2013-01-29 Thread Tejun Heo
On Tue, Jan 29, 2013 at 02:08:06PM -0500, a...@redhat.com wrote:
> This patch is in preparation for hierarchy support

It would be nice to note this is purely organizational and doesn't
make any functional changes.

> Cc: Tejun Heo 
> Cc: Serge Hallyn 
> Signed-off-by: Aristeu Rozanski 

Acked-by: Tejun Heo 

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 7/9] devcg: split single exception copy from dev_exceptions_copy()

2013-01-29 Thread aris
This patch is in preparation for hierarchy support

Cc: Tejun Heo 
Cc: Serge Hallyn 
Signed-off-by: Aristeu Rozanski 

---
 security/device_cgroup.c |   18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

--- github.orig/security/device_cgroup.c2013-01-29 11:49:16.076677425 
-0500
+++ github/security/device_cgroup.c 2013-01-29 11:49:16.374681863 -0500
@@ -89,20 +89,30 @@ static int devcgroup_can_attach(struct c
return 0;
 }
 
+static int dev_exception_copy(struct list_head *dest,
+ struct dev_exception_item *ex)
+{
+   struct dev_exception_item *new;
+
+   new = kmemdup(ex, sizeof(*ex), GFP_KERNEL);
+   if (!new)
+   return -ENOMEM;
+   list_add_tail(>list, dest);
+   return 0;
+}
+
 /*
  * called under devcgroup_mutex
  */
 static int dev_exceptions_copy(struct list_head *dest, struct list_head *orig)
 {
-   struct dev_exception_item *ex, *tmp, *new;
+   struct dev_exception_item *ex, *tmp;
 
lockdep_assert_held(_mutex);
 
list_for_each_entry(ex, orig, list) {
-   new = kmemdup(ex, sizeof(*ex), GFP_KERNEL);
-   if (!new)
+   if (dev_exception_copy(dest, ex))
goto free_and_exit;
-   list_add_tail(>list, dest);
}
 
return 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 7/9] devcg: split single exception copy from dev_exceptions_copy()

2013-01-29 Thread aris
This patch is in preparation for hierarchy support

Cc: Tejun Heo t...@kernel.org
Cc: Serge Hallyn serge.hal...@canonical.com
Signed-off-by: Aristeu Rozanski a...@redhat.com

---
 security/device_cgroup.c |   18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

--- github.orig/security/device_cgroup.c2013-01-29 11:49:16.076677425 
-0500
+++ github/security/device_cgroup.c 2013-01-29 11:49:16.374681863 -0500
@@ -89,20 +89,30 @@ static int devcgroup_can_attach(struct c
return 0;
 }
 
+static int dev_exception_copy(struct list_head *dest,
+ struct dev_exception_item *ex)
+{
+   struct dev_exception_item *new;
+
+   new = kmemdup(ex, sizeof(*ex), GFP_KERNEL);
+   if (!new)
+   return -ENOMEM;
+   list_add_tail(new-list, dest);
+   return 0;
+}
+
 /*
  * called under devcgroup_mutex
  */
 static int dev_exceptions_copy(struct list_head *dest, struct list_head *orig)
 {
-   struct dev_exception_item *ex, *tmp, *new;
+   struct dev_exception_item *ex, *tmp;
 
lockdep_assert_held(devcgroup_mutex);
 
list_for_each_entry(ex, orig, list) {
-   new = kmemdup(ex, sizeof(*ex), GFP_KERNEL);
-   if (!new)
+   if (dev_exception_copy(dest, ex))
goto free_and_exit;
-   list_add_tail(new-list, dest);
}
 
return 0;

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 7/9] devcg: split single exception copy from dev_exceptions_copy()

2013-01-29 Thread Tejun Heo
On Tue, Jan 29, 2013 at 02:08:06PM -0500, a...@redhat.com wrote:
 This patch is in preparation for hierarchy support

It would be nice to note this is purely organizational and doesn't
make any functional changes.

 Cc: Tejun Heo t...@kernel.org
 Cc: Serge Hallyn serge.hal...@canonical.com
 Signed-off-by: Aristeu Rozanski a...@redhat.com

Acked-by: Tejun Heo t...@kernel.org

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/