Skip to content

Commit

Permalink
io_uring/net: refactor io_sr_msg types
Browse files Browse the repository at this point in the history
[ upstream commit 0b04855 ]

In preparation for using struct io_sr_msg for zerocopy sends, clean up
types. First, flags can be u16 as it's provided by the userspace in u16
ioprio, as well as addr_len. This saves us 4 bytes. Also use unsigned
for size and done_io, both are as well limited to u32.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/42c2639d6385b8b2181342d2af3a42d3b1c5bcd2.1662639236.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
isilence authored and gregkh committed Oct 21, 2022
1 parent c4e29b2 commit a5841a6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions io_uring/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,21 @@ struct io_sr_msg {
struct user_msghdr __user *umsg;
void __user *buf;
};
unsigned len;
unsigned done_io;
unsigned msg_flags;
unsigned flags;
size_t len;
size_t done_io;
u16 flags;
};

struct io_sendzc {
struct file *file;
void __user *buf;
size_t len;
unsigned len;
unsigned done_io;
unsigned msg_flags;
unsigned flags;
unsigned addr_len;
u16 flags;
u16 addr_len;
void __user *addr;
size_t done_io;
struct io_kiocb *notif;
};

Expand Down

0 comments on commit a5841a6

Please sign in to comment.