Skip to content

Commit

Permalink
io_uring: kill io_rw_buffer_select() wrapper
Browse files Browse the repository at this point in the history
After the recent changes, this is direct call to io_buffer_select()
anyway. With this change, there are no wrappers left for provided
buffer selection.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed May 9, 2022
1 parent c54d52c commit e5b0034
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -3486,20 +3486,14 @@ static void __user *io_buffer_select(struct io_kiocb *req, size_t *len,
return ERR_PTR(-ENOBUFS);
}

static void __user *io_rw_buffer_select(struct io_kiocb *req, size_t *len,
unsigned int issue_flags)
{
return io_buffer_select(req, len, req->buf_index, issue_flags);
}

#ifdef CONFIG_COMPAT
static ssize_t io_compat_import(struct io_kiocb *req, struct iovec *iov,
unsigned int issue_flags)
{
struct compat_iovec __user *uiov;
compat_ssize_t clen;
void __user *buf;
ssize_t len;
size_t len;

uiov = u64_to_user_ptr(req->rw.addr);
if (!access_ok(uiov, sizeof(*uiov)))
Expand All @@ -3510,7 +3504,7 @@ static ssize_t io_compat_import(struct io_kiocb *req, struct iovec *iov,
return -EINVAL;

len = clen;
buf = io_rw_buffer_select(req, &len, issue_flags);
buf = io_buffer_select(req, &len, req->buf_index, issue_flags);
if (IS_ERR(buf))
return PTR_ERR(buf);
iov[0].iov_base = buf;
Expand All @@ -3532,7 +3526,7 @@ static ssize_t __io_iov_buffer_select(struct io_kiocb *req, struct iovec *iov,
len = iov[0].iov_len;
if (len < 0)
return -EINVAL;
buf = io_rw_buffer_select(req, &len, issue_flags);
buf = io_buffer_select(req, &len, req->buf_index, issue_flags);
if (IS_ERR(buf))
return PTR_ERR(buf);
iov[0].iov_base = buf;
Expand Down Expand Up @@ -3588,7 +3582,8 @@ static struct iovec *__io_import_iovec(int rw, struct io_kiocb *req,

if (opcode == IORING_OP_READ || opcode == IORING_OP_WRITE) {
if (req->flags & REQ_F_BUFFER_SELECT) {
buf = io_rw_buffer_select(req, &sqe_len, issue_flags);
buf = io_buffer_select(req, &sqe_len, req->buf_index,
issue_flags);
if (IS_ERR(buf))
return ERR_CAST(buf);
req->rw.len = sqe_len;
Expand Down

0 comments on commit e5b0034

Please sign in to comment.