[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fc01874b-c01e-7d4b-2c1c-55973f2c1390@gmail.com>
Date: Wed, 22 Jan 2020 05:24:32 +0300
From: Pavel Begunkov <asml.silence@...il.com>
To: Jens Axboe <axboe@...nel.dk>, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH 2/3] io_uring: add interface for getting files
On 22/01/2020 04:54, Jens Axboe wrote:
> On 1/21/20 5:05 PM, Pavel Begunkov wrote:
>> Preparation without functional changes. Adds io_get_file(), that allows
>> to grab files not only into req->file.
>>
>> Signed-off-by: Pavel Begunkov <asml.silence@...il.com>
>> ---
>> fs/io_uring.c | 66 ++++++++++++++++++++++++++++++++-------------------
>> 1 file changed, 41 insertions(+), 25 deletions(-)
>>
>> diff --git a/fs/io_uring.c b/fs/io_uring.c
>> index 8f7846cb1ebf..e9e4aee0fb99 100644
>> --- a/fs/io_uring.c
>> +++ b/fs/io_uring.c
>> @@ -1161,6 +1161,15 @@ static struct io_kiocb *io_get_req(struct io_ring_ctx *ctx,
>> return NULL;
>> }
>>
>> +static inline void io_put_file(struct io_ring_ctx *ctx, struct file *file,
>> + bool fixed)
>> +{
>> + if (fixed)
>> + percpu_ref_put(&ctx->file_data->refs);
>> + else
>> + fput(file);
>> +}
>
> Just make this take struct io_kiocb?
>
Ok, I'll make it io_put_file(req, file, is_fixed);
It still needs @file, as there can be many per req as in splice.
> Apart from that, looks fine to me.
>
--
Pavel Begunkov
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists