From nobody Mon Feb 12 00:18:38 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TY4nN1MFbz591kc; Mon, 12 Feb 2024 00:18:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TY4nM4rzhz4jh8; Mon, 12 Feb 2024 00:18:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 41C0IcQL020223; Mon, 12 Feb 2024 02:18:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 41C0IcQL020223 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 41C0IcVq020222; Mon, 12 Feb 2024 02:18:38 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Feb 2024 02:18:38 +0200 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 8dfc788b8480 - main - aio_read2/aio_write2: add AIO_OP2_VECTORED Message-ID: References: <202402110154.41B1scZ9090228@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4TY4nM4rzhz4jh8 X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated On Sun, Feb 11, 2024 at 07:28:17AM -0700, Alan Somers wrote: > What's the difference between this symbol and the existing > LIO_VECTORED symbol ? They seem redundant to me. Same relation as between LIO_FOFFSET and AIO_OP2_FOFFSET. aio_read2/aio_write2 are simpler to use when a single op is needed. > > On Sat, Feb 10, 2024 at 6:54 PM Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=8dfc788b8480a13f1f945f0a94d8b1e327af5c6f > > > > commit 8dfc788b8480a13f1f945f0a94d8b1e327af5c6f > > Author: Konstantin Belousov > > AuthorDate: 2024-02-03 18:09:36 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-02-11 01:54:11 +0000 > > > > aio_read2/aio_write2: add AIO_OP2_VECTORED > > > > 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 > > > > /*