[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201118150041.GF29991@casper.infradead.org>
Date: Wed, 18 Nov 2020 15:00:41 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
viro@...iv.linux.org.uk, akpm@...ux-foundation.org,
soheil.kdev@...il.com, arnd@...db.de, shuochen@...gle.com,
linux-man@...r.kernel.org, Willem de Bruijn <willemb@...gle.com>
Subject: Re: [PATCH v3 1/2] epoll: add nsec timeout support with epoll_pwait2
On Wed, Nov 18, 2020 at 09:46:15AM -0500, Willem de Bruijn wrote:
> -static inline struct timespec64 ep_set_mstimeout(long ms)
> +static inline struct timespec64 ep_set_nstimeout(s64 timeout)
> {
> - struct timespec64 now, ts = {
> - .tv_sec = ms / MSEC_PER_SEC,
> - .tv_nsec = NSEC_PER_MSEC * (ms % MSEC_PER_SEC),
> - };
> + struct timespec64 now, ts;
>
> + ts = ns_to_timespec64(timeout);
> ktime_get_ts64(&now);
> return timespec64_add_safe(now, ts);
> }
Why do you pass around an s64 for timeout, converting it to and from
a timespec64 instead of passing around a timespec64?
Powered by blists - more mailing lists