[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a0d5c015-1985-280e-2253-8e2663b234e9@kernel.dk>
Date: Wed, 8 Jul 2020 21:25:03 -0600
From: Jens Axboe <axboe@...nel.dk>
To: "Matthew Wilcox (Oracle)" <willy@...radead.org>
Cc: linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-aio@...ck.org, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org, Kanchan Joshi <joshi.k@...sung.com>,
Javier Gonzalez <javier.gonz@...sung.com>
Subject: Re: [PATCH 2/2] fs: Remove kiocb->ki_complete
On 7/8/20 4:26 PM, Matthew Wilcox (Oracle) wrote:
> +void unregister_kiocb_completion(int id)
> +{
> + ki_cmpls[id - 1] = NULL;
> +}
> +EXPORT_SYMBOL(unregister_kiocb_completion);
This should have a limit check (<= 0 || > max).
> void complete_kiocb(struct kiocb *iocb, long ret, long ret2)
> {
> - iocb->ki_complete(iocb, ret, ret2);
> + unsigned int id = kiocb_completion_id(iocb);
> +
> + if (id > 0)
> + ki_cmpls[id - 1](iocb, ret, ret2);
> }
I'd make id == 0 be a dummy funciton to avoid this branch.
--
Jens Axboe
Powered by blists - more mailing lists