From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751163AbdFBCIy (ORCPT ); Thu, 1 Jun 2017 22:08:54 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:49218 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbdFBCIx (ORCPT ); Thu, 1 Jun 2017 22:08:53 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 165.244.249.26 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Fri, 2 Jun 2017 11:08:48 +0900 From: Byungchul Park To: , CC: , Subject: Re: [RESEND PATCH] bcache: Don't reinvent the wheel but use existing llist API Message-ID: <20170602020848.GB3623@X58A-UD3R> References: <1494549302-9695-1-git-send-email-byungchul.park@lge.com> MIME-Version: 1.0 In-Reply-To: <1494549302-9695-1-git-send-email-byungchul.park@lge.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB03/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/06/02 11:08:50, Serialize by Router on LGEKRMHUB03/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2017/06/02 11:08:50, Serialize complete at 2017/06/02 11:08:50 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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