mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-21 21:07:20 +00:00
1664498d4a
This patch adds basic native vectored AIO functions. These functions should be optimized to process multiple io requests at once. Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
44 lines
1.5 KiB
C
44 lines
1.5 KiB
C
#ifndef KVM_READ_WRITE_H
|
|
#define KVM_READ_WRITE_H
|
|
|
|
#include <sys/types.h>
|
|
#include <sys/uio.h>
|
|
#include <unistd.h>
|
|
|
|
#ifdef CONFIG_HAS_AIO
|
|
#include <libaio.h>
|
|
#endif
|
|
|
|
ssize_t xread(int fd, void *buf, size_t count);
|
|
ssize_t xwrite(int fd, const void *buf, size_t count);
|
|
|
|
ssize_t read_in_full(int fd, void *buf, size_t count);
|
|
ssize_t write_in_full(int fd, const void *buf, size_t count);
|
|
|
|
ssize_t xpread(int fd, void *buf, size_t count, off_t offset);
|
|
ssize_t xpwrite(int fd, const void *buf, size_t count, off_t offset);
|
|
|
|
ssize_t pread_in_full(int fd, void *buf, size_t count, off_t offset);
|
|
ssize_t pwrite_in_full(int fd, const void *buf, size_t count, off_t offset);
|
|
|
|
ssize_t xreadv(int fd, const struct iovec *iov, int iovcnt);
|
|
ssize_t xwritev(int fd, const struct iovec *iov, int iovcnt);
|
|
|
|
ssize_t readv_in_full(int fd, const struct iovec *iov, int iovcnt);
|
|
ssize_t writev_in_full(int fd, const struct iovec *iov, int iovcnt);
|
|
|
|
ssize_t xpreadv(int fd, const struct iovec *iov, int iovcnt, off_t offset);
|
|
ssize_t xpwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset);
|
|
|
|
ssize_t preadv_in_full(int fd, const struct iovec *iov, int iovcnt, off_t offset);
|
|
ssize_t pwritev_in_full(int fd, const struct iovec *iov, int iovcnt, off_t offset);
|
|
|
|
#ifdef CONFIG_HAS_AIO
|
|
int aio_preadv(io_context_t ctx, struct iocb *iocb, int fd, const struct iovec *iov, int iovcnt,
|
|
off_t offset, int ev, void *param);
|
|
int aio_pwritev(io_context_t ctx, struct iocb *iocb, int fd, const struct iovec *iov, int iovcnt,
|
|
off_t offset, int ev, void *param);
|
|
#endif
|
|
|
|
#endif /* KVM_READ_WRITE_H */
|