diff mbox series

io_uring: wire up allocated direct descriptors for socket

Message ID fdf98193-26d2-b543-acac-82e9557d3072@kernel.dk (mailing list archive)
State New
Headers show
Series io_uring: wire up allocated direct descriptors for socket | expand

Commit Message

Jens Axboe May 26, 2022, 11:05 p.m. UTC
The socket support was merged in an earlier branch that didn't yet
have support for allocating direct descriptors, hence only open
and accept got support for that.

Do the one-liner to enable it now, so we have consistent support for
any request that can instantiate a file/direct descriptor.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

---

Comments

Hao Xu May 27, 2022, 5:56 a.m. UTC | #1
On 5/27/22 07:05, Jens Axboe wrote:
> The socket support was merged in an earlier branch that didn't yet
> have support for allocating direct descriptors, hence only open
> and accept got support for that.
> 
> Do the one-liner to enable it now, so we have consistent support for
> any request that can instantiate a file/direct descriptor.
> 
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 
> ---
> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index ccb47d87a65a..d50bbf8de4fb 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -6676,8 +6676,8 @@ static int io_socket(struct io_kiocb *req, unsigned int issue_flags)
>   		fd_install(fd, file);
>   		ret = fd;
>   	} else {
> -		ret = io_install_fixed_file(req, file, issue_flags,
> -					    sock->file_slot - 1);
> +		ret = io_fixed_fd_install(req, issue_flags, file,
> +					    sock->file_slot);
>   	}
>   	__io_req_complete(req, issue_flags, ret, 0);
>   	return 0;
> 


Reviewed-by: Hao Xu <howeyxu@tencent.com>
diff mbox series

Patch

diff --git a/fs/io_uring.c b/fs/io_uring.c
index ccb47d87a65a..d50bbf8de4fb 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6676,8 +6676,8 @@  static int io_socket(struct io_kiocb *req, unsigned int issue_flags)
 		fd_install(fd, file);
 		ret = fd;
 	} else {
-		ret = io_install_fixed_file(req, file, issue_flags,
-					    sock->file_slot - 1);
+		ret = io_fixed_fd_install(req, issue_flags, file,
+					    sock->file_slot);
 	}
 	__io_req_complete(req, issue_flags, ret, 0);
 	return 0;