From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753119AbdFMAjR (ORCPT ); Mon, 12 Jun 2017 20:39:17 -0400 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:38018 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752501AbdFMAjQ (ORCPT ); Mon, 12 Jun 2017 20:39:16 -0400 X-Original-SENDERIP: 156.147.1.151 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Tue, 13 Jun 2017 09:39:01 +0900 From: Byungchul Park To: axboe@fb.com, axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, kernel-team@lge.com Subject: Re: [RESEND PATCH] bcache: Don't reinvent the wheel but use existing llist API Message-ID: <20170613003900.GJ3623@X58A-UD3R> References: <1494549302-9695-1-git-send-email-byungchul.park@lge.com> <20170602020848.GB3623@X58A-UD3R> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170602020848.GB3623@X58A-UD3R> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 02, 2017 at 11:08:48AM +0900, Byungchul Park wrote: > On Fri, May 12, 2017 at 09:35:02AM +0900, Byungchul Park wrote: > > Although llist provides proper APIs, they are not used. Make them used. > > +to axboe@kernel.dk > > I didn't know your e-mail address has been changed. > Could you give your opinion about this patch? I am sorry if I sent the patch to a wrong person. But otherwise, it would be appriciated if you give your opinions on it, or let me know the right person. Thank you, Byungchul > > > Signed-off-by: Byungchul Park > > --- > > drivers/md/bcache/closure.c | 17 +++-------------- > > 1 file changed, 3 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c > > index 864e673..1841d03 100644 > > --- a/drivers/md/bcache/closure.c > > +++ b/drivers/md/bcache/closure.c > > @@ -64,27 +64,16 @@ void closure_put(struct closure *cl) > > void __closure_wake_up(struct closure_waitlist *wait_list) > > { > > struct llist_node *list; > > - struct closure *cl; > > + struct closure *cl, *t; > > struct llist_node *reverse = NULL; > > > > list = llist_del_all(&wait_list->list); > > > > /* We first reverse the list to preserve FIFO ordering and fairness */ > > - > > - while (list) { > > - struct llist_node *t = list; > > - list = llist_next(list); > > - > > - t->next = reverse; > > - reverse = t; > > - } > > + reverse = llist_reverse_order(list); > > > > /* Then do the wakeups */ > > - > > - while (reverse) { > > - cl = container_of(reverse, struct closure, list); > > - reverse = llist_next(reverse); > > - > > + llist_for_each_entry_safe(cl, t, reverse, list) { > > closure_set_waiting(cl, 0); > > closure_sub(cl, CLOSURE_WAITING + 1); > > } > > -- > > 1.9.1