From patchwork Tue Nov 15 21:29:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13044201 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 78059C4332F for ; Tue, 15 Nov 2022 21:30:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238728AbiKOVap (ORCPT ); Tue, 15 Nov 2022 16:30:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238631AbiKOVan (ORCPT ); Tue, 15 Nov 2022 16:30:43 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30892C1C; Tue, 15 Nov 2022 13:30:43 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.117]) by gnuweeb.org (Postfix) with ESMTPSA id 0A587815D8; Tue, 15 Nov 2022 21:30:39 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1668547842; bh=Xn8f4c/AFH0Ra0/h2Gix+NhkQDSMoiw3WSJtA+3ePEg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pI1QqcBLYHv9bzz8GHTKtY/0som5LvguT6zF43bsRHQFtMaR2AiNtIFZeNTbzxo8o BjMf1xsaROAGSN+ZnxjbzBHMkSBitq0cvYGP1US0NY2S8askxicY+7cUZxPvQFtlxz qE/AB5pvIPmMG39QhvKUltBpFssQJRcm2X6WFa2YkWhtsb1RNbWjLQgKx2VVk/j6qw nFko6DF9lVeJ9mYZqri9MFwPe97HRMD69z/Z7j0u6MBJvHcc286ZnjO+Ze3cmFzjW9 R3j8l2kYakkGyg9XfQxyhhsuNkTtrxXsFrd73xmY2ObDDijy8Xmh8dhjfj6yM13o+j 9ws8vKNx16KLA== From: Ammar Faizi To: Jens Axboe Cc: Pavel Begunkov , Stefan Metzmacher , Linux Kernel Mailing List , io-uring Mailing List , GNU/Weeb Mailing List , Ammar Faizi Subject: [PATCH v1 1/2] io_uring: uapi: Don't force linux/time_types.h for userspace Date: Wed, 16 Nov 2022 04:29:52 +0700 Message-Id: <20221115212614.1308132-2-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115212614.1308132-1-ammar.faizi@intel.com> References: <20221115212614.1308132-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Stefan Metzmacher include/uapi/linux/io_uring.h is synced 1:1 into liburing:src/include/liburing/io_uring.h. liburing has a configure check to detect the need for linux/time_types.h. Fixes: 78a861b9495920f8609dee5b670dacbff09d359f ("io_uring: add sync cancelation API through io_uring_register()") Link: https://github.com/axboe/liburing/issues/708 Link: https://github.com/axboe/liburing/pull/709 Signed-off-by: Stefan Metzmacher Signed-off-by: Ammar Faizi --- include/uapi/linux/io_uring.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 2df3225b562f..77027cbaf786 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -1,25 +1,34 @@ /* SPDX-License-Identifier: (GPL-2.0 WITH Linux-syscall-note) OR MIT */ /* * Header file for the io_uring interface. * * Copyright (C) 2019 Jens Axboe * Copyright (C) 2019 Christoph Hellwig */ #ifndef LINUX_IO_URING_H #define LINUX_IO_URING_H #include #include +/* + * This file is shared with liburing and it has to autodetect + * if linux/time_types.h is available + */ +#ifdef __KERNEL__ +#define HAVE_LINUX_TIME_TYPES_H 1 +#endif +#ifdef HAVE_LINUX_TIME_TYPES_H #include +#endif #ifdef __cplusplus extern "C" { #endif /* * IO submission data structure (Submission Queue Entry) */ struct io_uring_sqe { __u8 opcode; /* type of operation for this sqe */ __u8 flags; /* IOSQE_ flags */ __u16 ioprio; /* ioprio for the request */ From patchwork Tue Nov 15 21:29:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ammar Faizi X-Patchwork-Id: 13044202 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 201E2C4332F for ; Tue, 15 Nov 2022 21:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238760AbiKOVay (ORCPT ); Tue, 15 Nov 2022 16:30:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238744AbiKOVar (ORCPT ); Tue, 15 Nov 2022 16:30:47 -0500 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A733225CD; Tue, 15 Nov 2022 13:30:46 -0800 (PST) Received: from localhost.localdomain (unknown [182.253.183.117]) by gnuweeb.org (Postfix) with ESMTPSA id 7DA30815D2; Tue, 15 Nov 2022 21:30:43 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1668547846; bh=26iFCX8cR32AVALAdkE5K60JTO8wkkvkeG+T6XtVZcU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5OIZror9lxmQ7YS0bjnNs3GN98mD/owZAWYxhcSH+pLXileUTQEdPJv8b09xSyNH qhg7GWQyDjJ5YdM4Bq8CXLsV/Ud0mXPOCG5sFLc8WjVIqiDjxX7StphFkfbo6sDqgy iEmJVC5vFOMIjGErHbTTCMaBWFFxZ5XyLrVRDyESlSdutijRl1lPpzAlVyYdLfkGHq 30WxwY2B9DSZHnSzjdh/TWKzCvg5YD3S6/BHQn0XGCeuQlQEW6s6mo658SMk/nHCva ZKrVCf930bEg8sko6YtSeZC0+7naGRB0Kj3ENe9mLvH31ciPdwh3RhznanGN8rdBmq wUo59XC2yCPXQ== From: Ammar Faizi To: Jens Axboe Cc: Pavel Begunkov , Stefan Metzmacher , Linux Kernel Mailing List , io-uring Mailing List , GNU/Weeb Mailing List , Ammar Faizi Subject: [PATCH v1 2/2] io_uring: uapi: Don't use a zero-size array Date: Wed, 16 Nov 2022 04:29:53 +0700 Message-Id: <20221115212614.1308132-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221115212614.1308132-1-ammar.faizi@intel.com> References: <20221115212614.1308132-1-ammar.faizi@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org From: Ammar Faizi Don't use a zero-size array because it doesn't allow the user to compile an app that uses liburing with the `-pedantic-errors` flag: io_uring.h:611:28: error: zero size arrays are an extension [-Werror,-Wzero-length-array] Replace the array size from 0 to 1. - No functional change is intended. - No struct/union size change. Signed-off-by: Ammar Faizi --- include/uapi/linux/io_uring.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 77027cbaf786..0890784fcc9e 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -85,25 +85,25 @@ struct io_uring_sqe { __u16 __pad3[1]; }; }; union { struct { __u64 addr3; __u64 __pad2[1]; }; /* * If the ring is initialized with IORING_SETUP_SQE128, then * this field is used for 80 bytes of arbitrary command data */ - __u8 cmd[0]; + __u8 cmd[1]; }; }; /* * If sqe->file_index is set to this for opcodes that instantiate a new * direct descriptor (like openat/openat2/accept), then io_uring will allocate * an available direct descriptor instead of having the application pass one * in. The picked direct descriptor will be returned in cqe->res, or -ENFILE * if the space is full. */ #define IORING_FILE_INDEX_ALLOC (~0U) @@ -599,25 +599,25 @@ struct io_uring_buf { struct io_uring_buf_ring { union { /* * To avoid spilling into more pages than we need to, the * ring tail is overlaid with the io_uring_buf->resv field. */ struct { __u64 resv1; __u32 resv2; __u16 resv3; __u16 tail; }; - struct io_uring_buf bufs[0]; + struct io_uring_buf bufs[1]; }; }; /* argument for IORING_(UN)REGISTER_PBUF_RING */ struct io_uring_buf_reg { __u64 ring_addr; __u32 ring_entries; __u16 bgid; __u16 pad; __u64 resv[3]; };