linux/io_uring/kbuf.h

// SPDX-License-Identifier: GPL-2.0
#ifndef IOU_KBUF_H
#define IOU_KBUF_H

#include <uapi/linux/io_uring.h>

struct io_buffer_list {};

struct io_buffer {};

enum {};

struct buf_sel_arg {};

void __user *io_buffer_select(struct io_kiocb *req, size_t *len,
			      unsigned int issue_flags);
int io_buffers_select(struct io_kiocb *req, struct buf_sel_arg *arg,
		      unsigned int issue_flags);
int io_buffers_peek(struct io_kiocb *req, struct buf_sel_arg *arg);
void io_destroy_buffers(struct io_ring_ctx *ctx);

int io_remove_buffers_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_remove_buffers(struct io_kiocb *req, unsigned int issue_flags);

int io_provide_buffers_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
int io_provide_buffers(struct io_kiocb *req, unsigned int issue_flags);

int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg);
int io_unregister_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg);
int io_register_pbuf_status(struct io_ring_ctx *ctx, void __user *arg);

void __io_put_kbuf(struct io_kiocb *req, unsigned issue_flags);

bool io_kbuf_recycle_legacy(struct io_kiocb *req, unsigned issue_flags);

void io_put_bl(struct io_ring_ctx *ctx, struct io_buffer_list *bl);
struct io_buffer_list *io_pbuf_get_bl(struct io_ring_ctx *ctx,
				      unsigned long bgid);
int io_pbuf_mmap(struct file *file, struct vm_area_struct *vma);

static inline bool io_kbuf_recycle_ring(struct io_kiocb *req)
{}

static inline bool io_do_buffer_select(struct io_kiocb *req)
{}

static inline bool io_kbuf_recycle(struct io_kiocb *req, unsigned issue_flags)
{}

static inline void __io_put_kbuf_ring(struct io_kiocb *req, int nr)
{}

static inline void __io_put_kbuf_list(struct io_kiocb *req,
				      struct list_head *list)
{}

static inline void io_kbuf_drop(struct io_kiocb *req)
{}

static inline unsigned int __io_put_kbufs(struct io_kiocb *req, int nbufs,
					  unsigned issue_flags)
{}

static inline unsigned int io_put_kbuf(struct io_kiocb *req,
				       unsigned issue_flags)
{}

static inline unsigned int io_put_kbufs(struct io_kiocb *req, int nbufs,
					unsigned issue_flags)
{}
#endif