Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1714507
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Byungchul Park <byungchul.park@lge.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4] bcache: Don't reinvent the wheel but use existing llist API |
| Date | Fri, 18 Aug 2017 03:30:02 +0200 |
| Message-ID | <ufEgO-4CU-3@gated-at.bofh.it> (permalink) |
| References | <uda3v-7k6-3@gated-at.bofh.it> |
| 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 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.21 (2010-09-15) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 42 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, i@coly.li, nborisov@suse.com, linux-kernel@vger.kernel.org, kernel-team@lge.com |
| X-Original-Date | Fri, 18 Aug 2017 10:24:26 +0900 |
| X-Original-Message-ID | <20170818012426.GX20323@X58A-UD3R> |
| X-Original-References | <1502426543-15229-1-git-send-email-byungchul.park@lge.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1714507 |
Show key headers only | View raw
On Fri, Aug 11, 2017 at 01:42:23PM +0900, Byungchul Park wrote:
> Although llist provides proper APIs, they are not used. Make them used.
Any opinions about this?
>
> Signed-off-by: Byungchul Park <byungchul.park@lge.com>
> Acked-by: Coly Li <colyli@suse.de>
> ---
> drivers/md/bcache/closure.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/md/bcache/closure.c b/drivers/md/bcache/closure.c
> index 864e673..7d5286b 100644
> --- a/drivers/md/bcache/closure.c
> +++ b/drivers/md/bcache/closure.c
> @@ -70,21 +70,10 @@ void __closure_wake_up(struct closure_waitlist *wait_list)
> 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(cl, reverse, list) {
> closure_set_waiting(cl, 0);
> closure_sub(cl, CLOSURE_WAITING + 1);
> }
> --
> 1.9.1
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH v4] bcache: Don't reinvent the wheel but use existing llist API Byungchul Park <byungchul.park@lge.com> - 2017-08-18 03:30 +0200
Re: [PATCH v4] bcache: Don't reinvent the wheel but use existing llist API Coly Li <i@coly.li> - 2017-08-18 08:10 +0200
Re: [PATCH v4] bcache: Don't reinvent the wheel but use existing llist API Byungchul Park <byungchul.park@lge.com> - 2017-08-18 08:20 +0200
csiph-web