diff options
| author | Jens Axboe <axboe@kernel.dk> | 2024-08-12 09:25:36 -0600 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2024-08-29 08:44:42 -0600 |
| commit | 2c8fa70bf3e981193ecda0eedf2100f933ef7085 (patch) | |
| tree | 7885bd00d47328f81951f225eed52bd596f78a4a /io_uring/kbuf.h | |
| parent | ecd5c9b29643f383d39320e30d21b8615bd893da (diff) | |
io_uring/kbuf: move io_ring_head_to_buf() to kbuf.h
In preparation for using this helper in kbuf.h as well, move it there and
turn it into a macro.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/kbuf.h')
| -rw-r--r-- | io_uring/kbuf.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/io_uring/kbuf.h b/io_uring/kbuf.h index 43c7b18244b3..4c34ff3144b9 100644 --- a/io_uring/kbuf.h +++ b/io_uring/kbuf.h @@ -121,6 +121,9 @@ static inline bool io_kbuf_recycle(struct io_kiocb *req, unsigned issue_flags) return false; } +/* Mapped buffer ring, return io_uring_buf from head */ +#define io_ring_head_to_buf(br, head, mask) &(br)->bufs[(head) & (mask)] + static inline void io_kbuf_commit(struct io_kiocb *req, struct io_buffer_list *bl, int nr) { |
