[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3130eb62-e3b7-12d7-e724-7d549c68b6cf@suse.de>
Date: Tue, 11 Jun 2019 18:25:22 +0800
From: Coly Li <colyli@...e.de>
To: Kent Overstreet <kent.overstreet@...il.com>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-bcache@...r.kernel.org
Subject: Re: [PATCH 11/12] closures: closure_wait_event()
On 2019/6/11 3:14 上午, Kent Overstreet wrote:
> Signed-off-by: Kent Overstreet <kent.overstreet@...il.com>
Acked-by: Coly Li <colyli@...e.de>
Thanks.
Coly Li
> ---
> include/linux/closure.h | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/include/linux/closure.h b/include/linux/closure.h
> index 308e38028c..abacb91c35 100644
> --- a/include/linux/closure.h
> +++ b/include/linux/closure.h
> @@ -379,4 +379,26 @@ static inline void closure_call(struct closure *cl, closure_fn fn,
> continue_at_nobarrier(cl, fn, wq);
> }
>
> +#define __closure_wait_event(waitlist, _cond) \
> +do { \
> + struct closure cl; \
> + \
> + closure_init_stack(&cl); \
> + \
> + while (1) { \
> + closure_wait(waitlist, &cl); \
> + if (_cond) \
> + break; \
> + closure_sync(&cl); \
> + } \
> + closure_wake_up(waitlist); \
> + closure_sync(&cl); \
> +} while (0)
> +
> +#define closure_wait_event(waitlist, _cond) \
> +do { \
> + if (!(_cond)) \
> + __closure_wait_event(waitlist, _cond); \
> +} while (0)
> +
> #endif /* _LINUX_CLOSURE_H */
>
--
Coly Li
Powered by blists - more mailing lists