enum { /* ring mapped provided buffers */
IOBL_BUF_RING = 1, /* buffers are consumed incrementally rather than always fully */
IOBL_INC = 2,
};
struct io_buffer_list { /* * If ->buf_nr_pages is set, then buf_pages/buf_ring are used. If not, * then these are classic provided buffers and ->buf_list is used.
*/ union { struct list_head buf_list; struct io_uring_buf_ring *buf_ring;
}; /* count of classic/legacy buffers in buffer list */ int nbufs;
__u16 bgid;
/* below is for ring provided buffers */
__u16 buf_nr_pages;
__u16 nr_entries;
__u16 head;
__u16 mask;
unsignedint __io_put_kbufs(struct io_kiocb *req, int len, int nbufs); bool io_kbuf_commit(struct io_kiocb *req, struct io_buffer_list *bl, int len, int nr);
staticinlinebool io_kbuf_recycle_ring(struct io_kiocb *req)
{ /* * We don't need to recycle for REQ_F_BUFFER_RING, we can just clear * the flag and hence ensure that bl->head doesn't get incremented. * If the tail has already been incremented, hang on to it. * The exception is partial io, that case we should increment bl->head * to monopolize the buffer.
*/ if (req->buf_list) {
req->flags &= ~(REQ_F_BUFFER_RING|REQ_F_BUFFERS_COMMIT); returntrue;
} returnfalse;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.