Re: [PATCH v2 2/6] device_cgroup: introduce dev_whitelist_clean()

2012-09-04 Thread Serge E. Hallyn
Quoting Aristeu Rozanski (a...@redhat.com):
> This function cleans all the items in a whitelist and will be used by the next
> patches.
> 
> v2:
> - no changes
> 
> Cc: Tejun Heo 
> Cc: Li Zefan 
> Cc: James Morris 
> Cc: Pavel Emelyanov 
> Cc: Serge Hallyn 

Acked-by: Serge Hallyn 

> Signed-off-by: Aristeu Rozanski 
> 
> ---
>  security/device_cgroup.c |   22 +-
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> Index: github/security/device_cgroup.c
> ===
> --- github.orig/security/device_cgroup.c  2012-08-21 10:50:34.650810797 
> -0400
> +++ github/security/device_cgroup.c   2012-08-21 10:50:37.526892088 -0400
> @@ -157,6 +157,22 @@
>   }
>  }
>  
> +/**
> + * dev_whitelist_clean - frees all entries of the whitelist
> + * @dev_cgroup: dev_cgroup with the whitelist to be cleaned
> + *
> + * called under devcgroup_mutex
> + */
> +static void dev_whitelist_clean(struct dev_cgroup *dev_cgroup)
> +{
> + struct dev_whitelist_item *wh, *tmp;
> +
> + list_for_each_entry_safe(wh, tmp, _cgroup->whitelist, list) {
> + list_del(>list);
> + kfree(wh);
> + }
> +}
> +
>  /*
>   * called from kernel/cgroup.c with cgroup_lock() held.
>   */
> @@ -203,13 +219,9 @@
>  static void devcgroup_destroy(struct cgroup *cgroup)
>  {
>   struct dev_cgroup *dev_cgroup;
> - struct dev_whitelist_item *wh, *tmp;
>  
>   dev_cgroup = cgroup_to_devcgroup(cgroup);
> - list_for_each_entry_safe(wh, tmp, _cgroup->whitelist, list) {
> - list_del(>list);
> - kfree(wh);
> - }
> + dev_whitelist_clean(dev_cgroup);
>   kfree(dev_cgroup);
>  }
>  
> 
> --
> 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/
--
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 v2 2/6] device_cgroup: introduce dev_whitelist_clean()

2012-09-04 Thread Aristeu Rozanski
This function cleans all the items in a whitelist and will be used by the next
patches.

v2:
- no changes

Cc: Tejun Heo 
Cc: Li Zefan 
Cc: James Morris 
Cc: Pavel Emelyanov 
Cc: Serge Hallyn 
Signed-off-by: Aristeu Rozanski 

---
 security/device_cgroup.c |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

Index: github/security/device_cgroup.c
===
--- github.orig/security/device_cgroup.c2012-08-21 10:50:34.650810797 
-0400
+++ github/security/device_cgroup.c 2012-08-21 10:50:37.526892088 -0400
@@ -157,6 +157,22 @@
}
 }
 
+/**
+ * dev_whitelist_clean - frees all entries of the whitelist
+ * @dev_cgroup: dev_cgroup with the whitelist to be cleaned
+ *
+ * called under devcgroup_mutex
+ */
+static void dev_whitelist_clean(struct dev_cgroup *dev_cgroup)
+{
+   struct dev_whitelist_item *wh, *tmp;
+
+   list_for_each_entry_safe(wh, tmp, _cgroup->whitelist, list) {
+   list_del(>list);
+   kfree(wh);
+   }
+}
+
 /*
  * called from kernel/cgroup.c with cgroup_lock() held.
  */
@@ -203,13 +219,9 @@
 static void devcgroup_destroy(struct cgroup *cgroup)
 {
struct dev_cgroup *dev_cgroup;
-   struct dev_whitelist_item *wh, *tmp;
 
dev_cgroup = cgroup_to_devcgroup(cgroup);
-   list_for_each_entry_safe(wh, tmp, _cgroup->whitelist, list) {
-   list_del(>list);
-   kfree(wh);
-   }
+   dev_whitelist_clean(dev_cgroup);
kfree(dev_cgroup);
 }
 

--
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 v2 2/6] device_cgroup: introduce dev_whitelist_clean()

2012-09-04 Thread Aristeu Rozanski
This function cleans all the items in a whitelist and will be used by the next
patches.

v2:
- no changes

Cc: Tejun Heo t...@kernel.org
Cc: Li Zefan lize...@huawei.com
Cc: James Morris jmor...@namei.org
Cc: Pavel Emelyanov xe...@openvz.org
Cc: Serge Hallyn serge.hal...@canonical.com
Signed-off-by: Aristeu Rozanski a...@redhat.com

---
 security/device_cgroup.c |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

Index: github/security/device_cgroup.c
===
--- github.orig/security/device_cgroup.c2012-08-21 10:50:34.650810797 
-0400
+++ github/security/device_cgroup.c 2012-08-21 10:50:37.526892088 -0400
@@ -157,6 +157,22 @@
}
 }
 
+/**
+ * dev_whitelist_clean - frees all entries of the whitelist
+ * @dev_cgroup: dev_cgroup with the whitelist to be cleaned
+ *
+ * called under devcgroup_mutex
+ */
+static void dev_whitelist_clean(struct dev_cgroup *dev_cgroup)
+{
+   struct dev_whitelist_item *wh, *tmp;
+
+   list_for_each_entry_safe(wh, tmp, dev_cgroup-whitelist, list) {
+   list_del(wh-list);
+   kfree(wh);
+   }
+}
+
 /*
  * called from kernel/cgroup.c with cgroup_lock() held.
  */
@@ -203,13 +219,9 @@
 static void devcgroup_destroy(struct cgroup *cgroup)
 {
struct dev_cgroup *dev_cgroup;
-   struct dev_whitelist_item *wh, *tmp;
 
dev_cgroup = cgroup_to_devcgroup(cgroup);
-   list_for_each_entry_safe(wh, tmp, dev_cgroup-whitelist, list) {
-   list_del(wh-list);
-   kfree(wh);
-   }
+   dev_whitelist_clean(dev_cgroup);
kfree(dev_cgroup);
 }
 

--
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 v2 2/6] device_cgroup: introduce dev_whitelist_clean()

2012-09-04 Thread Serge E. Hallyn
Quoting Aristeu Rozanski (a...@redhat.com):
 This function cleans all the items in a whitelist and will be used by the next
 patches.
 
 v2:
 - no changes
 
 Cc: Tejun Heo t...@kernel.org
 Cc: Li Zefan lize...@huawei.com
 Cc: James Morris jmor...@namei.org
 Cc: Pavel Emelyanov xe...@openvz.org
 Cc: Serge Hallyn serge.hal...@canonical.com

Acked-by: Serge Hallyn serge.hal...@canonical.com

 Signed-off-by: Aristeu Rozanski a...@redhat.com
 
 ---
  security/device_cgroup.c |   22 +-
  1 file changed, 17 insertions(+), 5 deletions(-)
 
 Index: github/security/device_cgroup.c
 ===
 --- github.orig/security/device_cgroup.c  2012-08-21 10:50:34.650810797 
 -0400
 +++ github/security/device_cgroup.c   2012-08-21 10:50:37.526892088 -0400
 @@ -157,6 +157,22 @@
   }
  }
  
 +/**
 + * dev_whitelist_clean - frees all entries of the whitelist
 + * @dev_cgroup: dev_cgroup with the whitelist to be cleaned
 + *
 + * called under devcgroup_mutex
 + */
 +static void dev_whitelist_clean(struct dev_cgroup *dev_cgroup)
 +{
 + struct dev_whitelist_item *wh, *tmp;
 +
 + list_for_each_entry_safe(wh, tmp, dev_cgroup-whitelist, list) {
 + list_del(wh-list);
 + kfree(wh);
 + }
 +}
 +
  /*
   * called from kernel/cgroup.c with cgroup_lock() held.
   */
 @@ -203,13 +219,9 @@
  static void devcgroup_destroy(struct cgroup *cgroup)
  {
   struct dev_cgroup *dev_cgroup;
 - struct dev_whitelist_item *wh, *tmp;
  
   dev_cgroup = cgroup_to_devcgroup(cgroup);
 - list_for_each_entry_safe(wh, tmp, dev_cgroup-whitelist, list) {
 - list_del(wh-list);
 - kfree(wh);
 - }
 + dev_whitelist_clean(dev_cgroup);
   kfree(dev_cgroup);
  }
  
 
 --
 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/
--
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/