mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
io_uring: unify getting ctx from passed in file descriptor
io_uring_enter() and io_uring_register() end up having duplicated code for getting a ctx from a passed in file descriptor, for either a registered ring descriptor or a normal file descriptor. Move the io_uring_register_get_file() into io_uring.c and name it a bit more generically, and use it from both callsites rather than have that logic and handling duplicated. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -181,7 +181,7 @@ static int bpf_io_reg(void *kdata, struct bpf_link *link)
|
||||
struct file *file;
|
||||
int ret = -EBUSY;
|
||||
|
||||
file = io_uring_register_get_file(ops->ring_fd, false);
|
||||
file = io_uring_ctx_get_file(ops->ring_fd, false);
|
||||
if (IS_ERR(file))
|
||||
return PTR_ERR(file);
|
||||
ctx = file->private_data;
|
||||
|
||||
Reference in New Issue
Block a user