From patchwork Mon Jun 6 06:12:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12869983 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C046CCA473 for ; Mon, 6 Jun 2022 06:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229781AbiFFGMj (ORCPT ); Mon, 6 Jun 2022 02:12:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229836AbiFFGMh (ORCPT ); Mon, 6 Jun 2022 02:12:37 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23E1B218F for ; Sun, 5 Jun 2022 23:12:35 -0700 (PDT) Received: from integral2.. (unknown [36.73.79.120]) by gnuweeb.org (Postfix) with ESMTPSA id B087D7FA06; Mon, 6 Jun 2022 06:12:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1654495954; bh=aYSYkE3+A9+TQ9CjZcrIwWINA1KMjk4o3Pj624qbx9s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tKgXS9W7DpL5Zbn2vq0fzWgB45CUAemHtGxOol3J7pn/fsxEWuKcY6QfpSCWzdzY5 Q4udYurkf70JGkhticxVoD3ZhDmit62+nXEys+Ji7zIsqzSJ3IJHbDeaGpGPkdmV0+ rSub8mvbOt2WE3Af1YSAbxB3xKDF6FXipGv8Y2ugjB4I0dhYiybub60A72cG//xTqv GxyNgpZceGHRWvtqgGTnQy1h+WWygG22eatysBIPt9zbVG6ktSnSj9YhoGlN2ukLxp +XCVqI14WhgHWcP6jDHVMCY//qj4Kh+U35iFGg3a/Pbc+SYZIYwJwCw908CWLnTjUY H6gbIS17J6PDA== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , "Fernanda Ma'rouf" , Hao Xu , Alviro Iskandar Setiawan , io-uring Mailing List , GNU/Weeb Mailing List Subject: [RFC PATCH v1 1/5] lib: Don't indent in `#ifdef -> #define -> #endif` block Date: Mon, 6 Jun 2022 13:12:05 +0700 Message-Id: <20220606061209.335709-2-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> References: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Follow the surrounding code style. Signed-off-by: Ammar Faizi --- src/lib.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib.h b/src/lib.h index 6672cc5..5dabd28 100644 --- a/src/lib.h +++ b/src/lib.h @@ -23,14 +23,14 @@ #ifndef offsetof - #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) +#define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) #endif #ifndef container_of - #define container_of(PTR, TYPE, FIELD) ({ \ - __typeof__(((TYPE *)0)->FIELD) *__FIELD_PTR = (PTR); \ - (TYPE *)((char *) __FIELD_PTR - offsetof(TYPE, FIELD)); \ - }) +#define container_of(PTR, TYPE, FIELD) ({ \ + __typeof__(((TYPE *)0)->FIELD) *__FIELD_PTR = (PTR); \ + (TYPE *)((char *) __FIELD_PTR - offsetof(TYPE, FIELD)); \ +}) #endif void *__uring_malloc(size_t len); From patchwork Mon Jun 6 06:12:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12869984 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0AFBC433EF for ; Mon, 6 Jun 2022 06:12:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiFFGMk (ORCPT ); Mon, 6 Jun 2022 02:12:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbiFFGMk (ORCPT ); Mon, 6 Jun 2022 02:12:40 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1FA55B0 for ; Sun, 5 Jun 2022 23:12:38 -0700 (PDT) Received: from integral2.. (unknown [36.73.79.120]) by gnuweeb.org (Postfix) with ESMTPSA id 3B2677FA0A; Mon, 6 Jun 2022 06:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1654495958; bh=g0hFM7Sftj3Glht2ZLdg1dGmI4JnKxkQ3//5BI8JNPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cKO6rFzYp/xP/ebXzpg8ubu/ZmFA2p20lgu9w8QsubV+cbKs+ALWuWaAR4nk8rvBH X0uB2SnP5lslZvhtnLKGBHnYpnK25LxAPI066nxDRUs6FNV6qCaW9UY2bP+zpBecHo 6F5jBL8x4TSQoEz4/pdIxsFPqyNg/+hJgAs9EMSOG5iIj/szUg32KGdFtRvmk5fLOm RNkvSep4+jm6jNe6JWl44zHWSSvDdltnSKEz22NsxfM2/214yNMAv1xbbjdocTZSJD LLc3qNE2/kmDphaEeRnPW2BsYkaOKHSzmKoP3+SS3ErjNyzf7scLtS2/tC0fZBFkxn hxIb9PNPNch7w== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , "Fernanda Ma'rouf" , Hao Xu , Alviro Iskandar Setiawan , io-uring Mailing List , GNU/Weeb Mailing List Subject: [RFC PATCH v1 2/5] lib: Add `BUILD_BUG_ON()` macro Date: Mon, 6 Jun 2022 13:12:06 +0700 Message-Id: <20220606061209.335709-3-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> References: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org The first use case of this macro is for data structure assertion at compile time. It's like what we do in the io_uring.c in the kernel. Signed-off-by: Ammar Faizi --- src/lib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.h b/src/lib.h index 5dabd28..40e2817 100644 --- a/src/lib.h +++ b/src/lib.h @@ -5,6 +5,7 @@ #include #include #include +#include #define __INTERNAL__LIBURING_LIB_H #if defined(__x86_64__) || defined(__i386__) @@ -21,6 +22,9 @@ #endif #undef __INTERNAL__LIBURING_LIB_H +#ifndef BUILD_BUG_ON +#define BUILD_BUG_ON(EXPR) static_assert(!(EXPR), "!(" #EXPR ") failed") +#endif #ifndef offsetof #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) From patchwork Mon Jun 6 06:12:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12869985 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D46CC433EF for ; Mon, 6 Jun 2022 06:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229806AbiFFGMz (ORCPT ); Mon, 6 Jun 2022 02:12:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbiFFGMp (ORCPT ); Mon, 6 Jun 2022 02:12:45 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB0BF1838F for ; Sun, 5 Jun 2022 23:12:43 -0700 (PDT) Received: from integral2.. (unknown [36.73.79.120]) by gnuweeb.org (Postfix) with ESMTPSA id 50A877ED7E; Mon, 6 Jun 2022 06:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1654495963; bh=rCu1i8LhhlOrdGzVPKASiSeqaLaUQwOx8jlREhrRbJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pLFpC+ugkfj7xCmDohna4yz+shAWwP88Sh8PqRMBBzEUliow1ZieJl1mrztrpdnei WhzS2ZX3sHDeD+mSV9mObTxK2bl+CuGLuglvL96WX9Ql4wVxYdAJqWiiMOUUTC5rwn 6+N/M+i6h0QTASsfQJqUkIVC62GXHVZ2FUvFdxJ0OaW5WXy/ap4JxOrg6uexCu3GnG 1KcqxmkXyea9Y0m64syZ0wINC+ZnAkjrIPkurt+STA4OAJYaa1ot4bivpXcZx9podw koD8J9pHid16YibeStzgpj4YRtxdHEb9hoPvovxSciJEMTniMo+S/BE/JGOphLGqeN TLIrPubMzYHIg== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , "Fernanda Ma'rouf" , Hao Xu , Alviro Iskandar Setiawan , io-uring Mailing List , GNU/Weeb Mailing List Subject: [RFC PATCH v1 3/5] lib: Add `sizeof_field()` macro Date: Mon, 6 Jun 2022 13:12:07 +0700 Message-Id: <20220606061209.335709-4-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> References: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org The first use case of this macro is for data structure assertion at compile time. It's like what we do in the io_uring.c in the kernel. Signed-off-by: Ammar Faizi --- src/lib.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib.h b/src/lib.h index 40e2817..0db7499 100644 --- a/src/lib.h +++ b/src/lib.h @@ -26,6 +26,10 @@ #define BUILD_BUG_ON(EXPR) static_assert(!(EXPR), "!(" #EXPR ") failed") #endif +#ifndef sizeof_field +#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER)) +#endif + #ifndef offsetof #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD) #endif From patchwork Mon Jun 6 06:12:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12869987 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 20E64CCA47E for ; Mon, 6 Jun 2022 06:12:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbiFFGM5 (ORCPT ); Mon, 6 Jun 2022 02:12:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229881AbiFFGMs (ORCPT ); Mon, 6 Jun 2022 02:12:48 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 896EC18B39 for ; Sun, 5 Jun 2022 23:12:46 -0700 (PDT) Received: from integral2.. (unknown [36.73.79.120]) by gnuweeb.org (Postfix) with ESMTPSA id 176667FA12; Mon, 6 Jun 2022 06:12:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1654495966; bh=dBOpmAduDiXY4nER9lKHy68iLQirETS3vn0iIYcKfUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TEHfMOQ1s0AciECR4nno64ejyGcS3c7Qmypk27VrsEOgtLl/eZiy64OzE543oWdJC M3+heluXBBIkxQSOZ9j8H6ujTClHPfFyfVHKoYTKER2lAufuCQTmWl4wgcBXRqmg5t aE6mVLrZhjhWDxQ0aF6vsEVn0zt7afRAjjzZukdkZgSoXEeNIYcl4iKfqCWmTsYDK9 0mNnaMo1up4ARtqs7tnfiT/BmSWwuDbw/yipUeh049h2WCzlfIuw1qRUSPOvFmacG5 fOK22p2vFtdS0ZcC1qVbjkkSMtBDHGIeMuLrqKCKRZYbcC5qFQTZtVSWZg1mIiAr1q Q61XsPT/2SdhA== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , "Fernanda Ma'rouf" , Hao Xu , Alviro Iskandar Setiawan , io-uring Mailing List , GNU/Weeb Mailing List Subject: [RFC PATCH v1 4/5] Avoid macro redefinition warnings Date: Mon, 6 Jun 2022 13:12:08 +0700 Message-Id: <20220606061209.335709-5-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> References: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org This is a prep patch. The next patch will cause macro redefinition warnings if we don't have this patch. Signed-off-by: Ammar Faizi --- src/queue.c | 2 ++ src/register.c | 2 ++ src/setup.c | 2 ++ src/syscall.c | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/queue.c b/src/queue.c index ce0ecf6..800ae0c 100644 --- a/src/queue.c +++ b/src/queue.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: MIT */ +#ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200112L +#endif #include "lib.h" #include "syscall.h" diff --git a/src/register.c b/src/register.c index 993c450..f19a720 100644 --- a/src/register.c +++ b/src/register.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: MIT */ +#ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200112L +#endif #include "lib.h" #include "syscall.h" diff --git a/src/setup.c b/src/setup.c index d2adc7f..e28560d 100644 --- a/src/setup.c +++ b/src/setup.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: MIT */ +#ifndef _DEFAULT_SOURCE #define _DEFAULT_SOURCE +#endif #include "lib.h" #include "syscall.h" diff --git a/src/syscall.c b/src/syscall.c index 362f1f5..b10f8b0 100644 --- a/src/syscall.c +++ b/src/syscall.c @@ -1,5 +1,7 @@ /* SPDX-License-Identifier: MIT */ +#ifndef _DEFAULT_SOURCE #define _DEFAULT_SOURCE +#endif /* * Functions in this file require libc, only build them when we use libc. From patchwork Mon Jun 6 06:12:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 12869986 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5803C43334 for ; Mon, 6 Jun 2022 06:12:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229823AbiFFGM4 (ORCPT ); Mon, 6 Jun 2022 02:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229861AbiFFGMx (ORCPT ); Mon, 6 Jun 2022 02:12:53 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46CBC18B2E for ; Sun, 5 Jun 2022 23:12:49 -0700 (PDT) Received: from integral2.. (unknown [36.73.79.120]) by gnuweeb.org (Postfix) with ESMTPSA id B95147E583; Mon, 6 Jun 2022 06:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1654495968; bh=NpXbzefATnYVVKP3TUgeub8VK+12T8oHEB9/5rBxbvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AIXZqGn1yrFvcjncYqtIfdUq7Mt3yevC0pKn0OWVaIdmuo7t9PmYibddJlnaQNObi /Hfv1CvFzUPcx8zSoGqVL3a/Dueo99fB+vza7ve3pESyW49w5Ozd1diAV1FqyRJ4UY ef1WbFm/4+OT1tNZbP7YmHgXyPEoUfMthv2/iwOlqpCi5vnluPz8UYZ13KrtadBsO/ rXwQG9wSE6Zak8b8R83ZCN9fcUkfM0NBu8d/TEwSl4/P/bE8FxhbnkvjdNzdwER75I jsYIYfMA7azRvNyGD96WRY5/GQ+jFTw2ibYAhErGOgPoul0kRqoezB2PHil/ay/dxa Tavz8AVsy9TKg== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , "Fernanda Ma'rouf" , Hao Xu , Alviro Iskandar Setiawan , io-uring Mailing List , GNU/Weeb Mailing List Subject: [RFC PATCH v1 5/5] Add io_uring data structure build assertion Date: Mon, 6 Jun 2022 13:12:09 +0700 Message-Id: <20220606061209.335709-6-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> References: <20220606061209.335709-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Ensure io_uring data structure consistent between the kernel and user space. These assertions are taken from io_uring.c in the kernel. Signed-off-by: Ammar Faizi --- src/Makefile | 3 ++- src/build_assert.h | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/build_assert.h diff --git a/src/Makefile b/src/Makefile index 12cf49f..aed3c40 100644 --- a/src/Makefile +++ b/src/Makefile @@ -7,7 +7,8 @@ libdevdir ?= $(prefix)/lib CPPFLAGS ?= override CPPFLAGS += -D_GNU_SOURCE \ - -Iinclude/ -include ../config-host.h + -Iinclude/ -include ../config-host.h \ + -include build_assert.h CFLAGS ?= -g -O2 -Wall -Wextra -fno-stack-protector override CFLAGS += -Wno-unused-parameter -Wno-sign-compare -DLIBURING_INTERNAL SO_CFLAGS=-fPIC $(CFLAGS) diff --git a/src/build_assert.h b/src/build_assert.h new file mode 100644 index 0000000..5b2a9c6 --- /dev/null +++ b/src/build_assert.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef LIBURING_BUILD_ASSERT_H +#define LIBURING_BUILD_ASSERT_H + +#include "liburing/io_uring.h" +#include "lib.h" + +static inline __attribute__((__unused__)) void io_uring_build_assert(void) +{ +#define __BUILD_BUG_VERIFY_ELEMENT(stype, eoffset, etype, ename) do { \ + BUILD_BUG_ON(offsetof(stype, ename) != eoffset); \ + BUILD_BUG_ON(sizeof(etype) != sizeof_field(stype, ename)); \ +} while (0) + +#define BUILD_BUG_SQE_ELEM(eoffset, etype, ename) \ + __BUILD_BUG_VERIFY_ELEMENT(struct io_uring_sqe, eoffset, etype, ename) + BUILD_BUG_ON(sizeof(struct io_uring_sqe) != 64); + BUILD_BUG_SQE_ELEM(0, __u8, opcode); + BUILD_BUG_SQE_ELEM(1, __u8, flags); + BUILD_BUG_SQE_ELEM(2, __u16, ioprio); + BUILD_BUG_SQE_ELEM(4, __s32, fd); + BUILD_BUG_SQE_ELEM(8, __u64, off); + BUILD_BUG_SQE_ELEM(8, __u64, addr2); + BUILD_BUG_SQE_ELEM(16, __u64, addr); + BUILD_BUG_SQE_ELEM(16, __u64, splice_off_in); + BUILD_BUG_SQE_ELEM(24, __u32, len); + BUILD_BUG_SQE_ELEM(28, __kernel_rwf_t, rw_flags); + BUILD_BUG_SQE_ELEM(28, /* compat */ int, rw_flags); + BUILD_BUG_SQE_ELEM(28, /* compat */ __u32, rw_flags); + BUILD_BUG_SQE_ELEM(28, __u32, fsync_flags); + BUILD_BUG_SQE_ELEM(28, /* compat */ __u16, poll_events); + BUILD_BUG_SQE_ELEM(28, __u32, poll32_events); + BUILD_BUG_SQE_ELEM(28, __u32, sync_range_flags); + BUILD_BUG_SQE_ELEM(28, __u32, msg_flags); + BUILD_BUG_SQE_ELEM(28, __u32, timeout_flags); + BUILD_BUG_SQE_ELEM(28, __u32, accept_flags); + BUILD_BUG_SQE_ELEM(28, __u32, cancel_flags); + BUILD_BUG_SQE_ELEM(28, __u32, open_flags); + BUILD_BUG_SQE_ELEM(28, __u32, statx_flags); + BUILD_BUG_SQE_ELEM(28, __u32, fadvise_advice); + BUILD_BUG_SQE_ELEM(28, __u32, splice_flags); + BUILD_BUG_SQE_ELEM(32, __u64, user_data); + BUILD_BUG_SQE_ELEM(40, __u16, buf_index); + BUILD_BUG_SQE_ELEM(40, __u16, buf_group); + BUILD_BUG_SQE_ELEM(42, __u16, personality); + BUILD_BUG_SQE_ELEM(44, __s32, splice_fd_in); + BUILD_BUG_SQE_ELEM(44, __u32, file_index); + BUILD_BUG_SQE_ELEM(48, __u64, addr3); + + BUILD_BUG_ON(sizeof(struct io_uring_files_update) != + sizeof(struct io_uring_rsrc_update)); + BUILD_BUG_ON(sizeof(struct io_uring_rsrc_update) > + sizeof(struct io_uring_rsrc_update2)); +} + +#endif