Re: [PATCH] blkcg: stop iteration early if root_rl is the only request list

2012-10-22 Thread Jens Axboe
On 2012-10-22 03:15, Jun'ichi Nomura wrote:
> __blk_queue_next_rl() finds next request list based on blkg_list
> while skipping root_blkg in the list.
> OTOH, root_rl is special as it may exist even without root_blkg.
> 
> Though the later part of the function handles such a case correctly,
> exiting early is good for readability of the code.

Applied to for-linus, thanks.

-- 
Jens Axboe

--
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] blkcg: stop iteration early if root_rl is the only request list

2012-10-22 Thread Vivek Goyal
On Mon, Oct 22, 2012 at 10:15:37AM +0900, Jun'ichi Nomura wrote:
> __blk_queue_next_rl() finds next request list based on blkg_list
> while skipping root_blkg in the list.
> OTOH, root_rl is special as it may exist even without root_blkg.
> 
> Though the later part of the function handles such a case correctly,
> exiting early is good for readability of the code.
> 

Thanks for the patch Junichi. This one looks good to me.

Acked-by: Vivek Goyal 

Vivek

> Signed-off-by: Jun'ichi Nomura 
> Cc: Vivek Goyal 
> Cc: Tejun Heo 
> Cc: Jens Axboe 
> ---
>  block/blk-cgroup.c |3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
> index 54f35d1..a31e678 100644
> --- a/block/blk-cgroup.c
> +++ b/block/blk-cgroup.c
> @@ -333,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct 
> request_list *rl,
>*/
>   if (rl == >root_rl) {
>   ent = >blkg_list;
> + /* There are no more block groups, hence no request lists */
> + if (list_empty(ent))
> + return NULL;
>   } else {
>   blkg = container_of(rl, struct blkcg_gq, rl);
>   ent = >q_node;
--
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] blkcg: stop iteration early if root_rl is the only request list

2012-10-22 Thread Vivek Goyal
On Mon, Oct 22, 2012 at 10:15:37AM +0900, Jun'ichi Nomura wrote:
 __blk_queue_next_rl() finds next request list based on blkg_list
 while skipping root_blkg in the list.
 OTOH, root_rl is special as it may exist even without root_blkg.
 
 Though the later part of the function handles such a case correctly,
 exiting early is good for readability of the code.
 

Thanks for the patch Junichi. This one looks good to me.

Acked-by: Vivek Goyal vgo...@redhat.com

Vivek

 Signed-off-by: Jun'ichi Nomura j-nom...@ce.jp.nec.com
 Cc: Vivek Goyal vgo...@redhat.com
 Cc: Tejun Heo t...@kernel.org
 Cc: Jens Axboe ax...@kernel.dk
 ---
  block/blk-cgroup.c |3 +++
  1 files changed, 3 insertions(+), 0 deletions(-)
 
 diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
 index 54f35d1..a31e678 100644
 --- a/block/blk-cgroup.c
 +++ b/block/blk-cgroup.c
 @@ -333,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct 
 request_list *rl,
*/
   if (rl == q-root_rl) {
   ent = q-blkg_list;
 + /* There are no more block groups, hence no request lists */
 + if (list_empty(ent))
 + return NULL;
   } else {
   blkg = container_of(rl, struct blkcg_gq, rl);
   ent = blkg-q_node;
--
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] blkcg: stop iteration early if root_rl is the only request list

2012-10-22 Thread Jens Axboe
On 2012-10-22 03:15, Jun'ichi Nomura wrote:
 __blk_queue_next_rl() finds next request list based on blkg_list
 while skipping root_blkg in the list.
 OTOH, root_rl is special as it may exist even without root_blkg.
 
 Though the later part of the function handles such a case correctly,
 exiting early is good for readability of the code.

Applied to for-linus, thanks.

-- 
Jens Axboe

--
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] blkcg: stop iteration early if root_rl is the only request list

2012-10-21 Thread Jun'ichi Nomura
__blk_queue_next_rl() finds next request list based on blkg_list
while skipping root_blkg in the list.
OTOH, root_rl is special as it may exist even without root_blkg.

Though the later part of the function handles such a case correctly,
exiting early is good for readability of the code.

Signed-off-by: Jun'ichi Nomura 
Cc: Vivek Goyal 
Cc: Tejun Heo 
Cc: Jens Axboe 
---
 block/blk-cgroup.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 54f35d1..a31e678 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -333,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct 
request_list *rl,
 */
if (rl == >root_rl) {
ent = >blkg_list;
+   /* There are no more block groups, hence no request lists */
+   if (list_empty(ent))
+   return NULL;
} else {
blkg = container_of(rl, struct blkcg_gq, rl);
ent = >q_node;

--
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] blkcg: stop iteration early if root_rl is the only request list

2012-10-21 Thread Jun'ichi Nomura
__blk_queue_next_rl() finds next request list based on blkg_list
while skipping root_blkg in the list.
OTOH, root_rl is special as it may exist even without root_blkg.

Though the later part of the function handles such a case correctly,
exiting early is good for readability of the code.

Signed-off-by: Jun'ichi Nomura j-nom...@ce.jp.nec.com
Cc: Vivek Goyal vgo...@redhat.com
Cc: Tejun Heo t...@kernel.org
Cc: Jens Axboe ax...@kernel.dk
---
 block/blk-cgroup.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 54f35d1..a31e678 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -333,6 +333,9 @@ struct request_list *__blk_queue_next_rl(struct 
request_list *rl,
 */
if (rl == q-root_rl) {
ent = q-blkg_list;
+   /* There are no more block groups, hence no request lists */
+   if (list_empty(ent))
+   return NULL;
} else {
blkg = container_of(rl, struct blkcg_gq, rl);
ent = blkg-q_node;

--
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/