* [PATCH] Fixes for the deferqueue_add() function (v2)
@ 2009-06-19 18:18 Dan Smith
[not found] ` <1245435505-24842-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Dan Smith @ 2009-06-19 18:18 UTC (permalink / raw)
To: containers-qjLDD68F18O7TbgM5vRIOg
I'm not sure how the deferqueue would (or has ever) worked without these
modifications, but I had to make them in order to use it :)
Changes (v2):
- Remove unnecessary initialization of the new list item
Cc: orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org
Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
kernel/deferqueue.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/deferqueue.c b/kernel/deferqueue.c
index efd99d5..3fb388b 100644
--- a/kernel/deferqueue.c
+++ b/kernel/deferqueue.c
@@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
{
struct deferqueue_entry *dq;
- dq = kmalloc(sizeof(dq) + size, GFP_KERNEL);
+ dq = kmalloc(sizeof(*dq) + size, GFP_KERNEL);
if (!dq)
return -ENOMEM;
@@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
pr_debug("%s: adding work %p func %p dtor %p\n",
__func__, dq, func, dtor);
spin_lock(&head->lock);
- list_add_tail(&head->list, &dq->list);
+ list_add_tail(&dq->list, &head->list);
spin_unlock(&head->lock);
return 0;
}
--
1.6.0.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fixes for the deferqueue_add() function (v2)
[not found] ` <1245435505-24842-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2009-06-19 18:36 ` Serge E. Hallyn
2009-06-22 3:20 ` Amerigo Wang
2009-06-24 16:38 ` Oren Laadan
2 siblings, 0 replies; 4+ messages in thread
From: Serge E. Hallyn @ 2009-06-19 18:36 UTC (permalink / raw)
To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
Quoting Dan Smith (danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> I'm not sure how the deferqueue would (or has ever) worked without these
> modifications, but I had to make them in order to use it :)
>
> Changes (v2):
> - Remove unnecessary initialization of the new list item
Reviewed-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
thanks,
-serge
> Cc: orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
> kernel/deferqueue.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/deferqueue.c b/kernel/deferqueue.c
> index efd99d5..3fb388b 100644
> --- a/kernel/deferqueue.c
> +++ b/kernel/deferqueue.c
> @@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> {
> struct deferqueue_entry *dq;
>
> - dq = kmalloc(sizeof(dq) + size, GFP_KERNEL);
> + dq = kmalloc(sizeof(*dq) + size, GFP_KERNEL);
> if (!dq)
> return -ENOMEM;
>
> @@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> pr_debug("%s: adding work %p func %p dtor %p\n",
> __func__, dq, func, dtor);
> spin_lock(&head->lock);
> - list_add_tail(&head->list, &dq->list);
> + list_add_tail(&dq->list, &head->list);
> spin_unlock(&head->lock);
> return 0;
> }
> --
> 1.6.0.4
>
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fixes for the deferqueue_add() function (v2)
[not found] ` <1245435505-24842-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-19 18:36 ` Serge E. Hallyn
@ 2009-06-22 3:20 ` Amerigo Wang
2009-06-24 16:38 ` Oren Laadan
2 siblings, 0 replies; 4+ messages in thread
From: Amerigo Wang @ 2009-06-22 3:20 UTC (permalink / raw)
To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
On Fri, Jun 19, 2009 at 11:18:25AM -0700, Dan Smith wrote:
>I'm not sure how the deferqueue would (or has ever) worked without these
>modifications, but I had to make them in order to use it :)
>
>Changes (v2):
> - Remove unnecessary initialization of the new list item
>
>Cc: orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org
>Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Good catch!!
Reviewed-by: WANG Cong <xiyou.wangcong-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>---
> kernel/deferqueue.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/deferqueue.c b/kernel/deferqueue.c
>index efd99d5..3fb388b 100644
>--- a/kernel/deferqueue.c
>+++ b/kernel/deferqueue.c
>@@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> {
> struct deferqueue_entry *dq;
>
>- dq = kmalloc(sizeof(dq) + size, GFP_KERNEL);
>+ dq = kmalloc(sizeof(*dq) + size, GFP_KERNEL);
> if (!dq)
> return -ENOMEM;
>
>@@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> pr_debug("%s: adding work %p func %p dtor %p\n",
> __func__, dq, func, dtor);
> spin_lock(&head->lock);
>- list_add_tail(&head->list, &dq->list);
>+ list_add_tail(&dq->list, &head->list);
> spin_unlock(&head->lock);
> return 0;
> }
>--
>1.6.0.4
>
>_______________________________________________
>Containers mailing list
>Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
>https://lists.linux-foundation.org/mailman/listinfo/containers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fixes for the deferqueue_add() function (v2)
[not found] ` <1245435505-24842-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-19 18:36 ` Serge E. Hallyn
2009-06-22 3:20 ` Amerigo Wang
@ 2009-06-24 16:38 ` Oren Laadan
2 siblings, 0 replies; 4+ messages in thread
From: Oren Laadan @ 2009-06-24 16:38 UTC (permalink / raw)
To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
Dan Smith wrote:
> I'm not sure how the deferqueue would (or has ever) worked without these
> modifications, but I had to make them in order to use it :)
>
> Changes (v2):
> - Remove unnecessary initialization of the new list item
>
> Cc: orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Of course... added.
Thanks,
Oren.
> ---
> kernel/deferqueue.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/deferqueue.c b/kernel/deferqueue.c
> index efd99d5..3fb388b 100644
> --- a/kernel/deferqueue.c
> +++ b/kernel/deferqueue.c
> @@ -66,7 +66,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> {
> struct deferqueue_entry *dq;
>
> - dq = kmalloc(sizeof(dq) + size, GFP_KERNEL);
> + dq = kmalloc(sizeof(*dq) + size, GFP_KERNEL);
> if (!dq)
> return -ENOMEM;
>
> @@ -77,7 +77,7 @@ int deferqueue_add(struct deferqueue_head *head, void *data, int size,
> pr_debug("%s: adding work %p func %p dtor %p\n",
> __func__, dq, func, dtor);
> spin_lock(&head->lock);
> - list_add_tail(&head->list, &dq->list);
> + list_add_tail(&dq->list, &head->list);
> spin_unlock(&head->lock);
> return 0;
> }
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-06-24 16:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-19 18:18 [PATCH] Fixes for the deferqueue_add() function (v2) Dan Smith
[not found] ` <1245435505-24842-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2009-06-19 18:36 ` Serge E. Hallyn
2009-06-22 3:20 ` Amerigo Wang
2009-06-24 16:38 ` Oren Laadan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox