From 8dfc788b8480a13f1f945f0a94d8b1e327af5c6f Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 3 Feb 2024 20:09:36 +0200 Subject: [PATCH] aio_read2/aio_write2: add AIO_OP2_VECTORED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested by: Vinícius dos Santos Oliveira Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D43448 --- lib/libc/gen/aio_read2.c | 4 +++- lib/libc/gen/aio_write2.c | 4 +++- sys/sys/aio.h | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/aio_read2.c b/lib/libc/gen/aio_read2.c index 3a783e1b1b15..a5186d509b26 100644 --- a/lib/libc/gen/aio_read2.c +++ b/lib/libc/gen/aio_read2.c @@ -37,13 +37,15 @@ aio_read2(struct aiocb *iocb, int flags) { int error; - if ((flags & ~(AIO_OP2_FOFFSET)) != 0) { + if ((flags & ~(AIO_OP2_FOFFSET | AIO_OP2_VECTORED)) != 0) { errno = EINVAL; return (-1); } iocb->aio_lio_opcode = LIO_READ; if ((flags & AIO_OP2_FOFFSET) != 0) iocb->aio_lio_opcode |= LIO_FOFFSET; + if ((flags & AIO_OP2_VECTORED) != 0) + iocb->aio_lio_opcode |= LIO_VECTORED; error = lio_listio(LIO_NOWAIT, &iocb, 1, NULL); if (error == -1 && errno == EIO) { diff --git a/lib/libc/gen/aio_write2.c b/lib/libc/gen/aio_write2.c index 8b5d4a38a6c5..8f4f6a35fd4d 100644 --- a/lib/libc/gen/aio_write2.c +++ b/lib/libc/gen/aio_write2.c @@ -37,13 +37,15 @@ aio_write2(struct aiocb *iocb, int flags) { int error; - if ((flags & ~(AIO_OP2_FOFFSET)) != 0) { + if ((flags & ~(AIO_OP2_FOFFSET | AIO_OP2_VECTORED)) != 0) { errno = EINVAL; return (-1); } iocb->aio_lio_opcode = LIO_WRITE; if ((flags & AIO_OP2_FOFFSET) != 0) iocb->aio_lio_opcode |= LIO_FOFFSET; + if ((flags & AIO_OP2_VECTORED) != 0) + iocb->aio_lio_opcode |= LIO_VECTORED; error = lio_listio(LIO_NOWAIT, &iocb, 1, NULL); if (error == -1 && errno == EIO) { diff --git a/sys/sys/aio.h b/sys/sys/aio.h index 6680f9fed3fa..919a6180b130 100644 --- a/sys/sys/aio.h +++ b/sys/sys/aio.h @@ -58,6 +58,7 @@ /* aio_read2/aio_write2 flags */ #if __BSD_VISIBLE #define AIO_OP2_FOFFSET 0x00000001 +#define AIO_OP2_VECTORED 0x00000002 #endif /*