All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring: wire up allocated direct descriptors for socket
@ 2022-05-26 23:05 Jens Axboe
  2022-05-27  5:56 ` Hao Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2022-05-26 23:05 UTC (permalink / raw)
  To: io-uring

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;

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] io_uring: wire up allocated direct descriptors for socket
  2022-05-26 23:05 [PATCH] io_uring: wire up allocated direct descriptors for socket Jens Axboe
@ 2022-05-27  5:56 ` Hao Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Hao Xu @ 2022-05-27  5:56 UTC (permalink / raw)
  To: Jens Axboe, io-uring

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>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-27  5:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-26 23:05 [PATCH] io_uring: wire up allocated direct descriptors for socket Jens Axboe
2022-05-27  5:56 ` Hao Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.