Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: Avoid anonymous enums in io_uring uapi

While valid C, anonymous enums confuse Cython (Python to C translator),
as reported by Ritesh (YoSTEALTH) [1] . Since people rely on it when
building against liburing and we want to keep this header in sync with
the library version, let's name the existing enums in the uapi header.

[1] https://github.com/cython/cython/issues/3240

Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/20240328210935.25640-1-krisman@suse.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Gabriel Krisman Bertazi and committed by
Jens Axboe
0f21a957 22537c9f

+8 -10
+8 -10
include/uapi/linux/io_uring.h
··· 115 115 */ 116 116 #define IORING_FILE_INDEX_ALLOC (~0U) 117 117 118 - enum { 118 + enum io_uring_sqe_flags_bit { 119 119 IOSQE_FIXED_FILE_BIT, 120 120 IOSQE_IO_DRAIN_BIT, 121 121 IOSQE_IO_LINK_BIT, ··· 374 374 /* 375 375 * IORING_OP_MSG_RING command types, stored in sqe->addr 376 376 */ 377 - enum { 377 + enum io_uring_msg_ring_flags { 378 378 IORING_MSG_DATA, /* pass sqe->len as 'res' and off as user_data */ 379 379 IORING_MSG_SEND_FD, /* send a registered fd to another ring */ 380 380 }; ··· 425 425 #define IORING_CQE_F_SOCK_NONEMPTY (1U << 2) 426 426 #define IORING_CQE_F_NOTIF (1U << 3) 427 427 428 - enum { 429 - IORING_CQE_BUFFER_SHIFT = 16, 430 - }; 428 + #define IORING_CQE_BUFFER_SHIFT 16 431 429 432 430 /* 433 431 * Magic offsets for the application to mmap the data it needs ··· 524 526 /* 525 527 * io_uring_register(2) opcodes and arguments 526 528 */ 527 - enum { 529 + enum io_uring_register_op { 528 530 IORING_REGISTER_BUFFERS = 0, 529 531 IORING_UNREGISTER_BUFFERS = 1, 530 532 IORING_REGISTER_FILES = 2, ··· 581 583 }; 582 584 583 585 /* io-wq worker categories */ 584 - enum { 586 + enum io_wq_type { 585 587 IO_WQ_BOUND, 586 588 IO_WQ_UNBOUND, 587 589 }; ··· 686 688 * IORING_OFF_PBUF_RING | (bgid << IORING_OFF_PBUF_SHIFT) 687 689 * to get a virtual mapping for the ring. 688 690 */ 689 - enum { 691 + enum io_uring_register_pbuf_ring_flags { 690 692 IOU_PBUF_RING_MMAP = 1, 691 693 }; 692 694 ··· 717 719 /* 718 720 * io_uring_restriction->opcode values 719 721 */ 720 - enum { 722 + enum io_uring_register_restriction_op { 721 723 /* Allow an io_uring_register(2) opcode */ 722 724 IORING_RESTRICTION_REGISTER_OP = 0, 723 725 ··· 773 775 /* 774 776 * Argument for IORING_OP_URING_CMD when file is a socket 775 777 */ 776 - enum { 778 + enum io_uring_socket_op { 777 779 SOCKET_URING_OP_SIOCINQ = 0, 778 780 SOCKET_URING_OP_SIOCOUTQ, 779 781 SOCKET_URING_OP_GETSOCKOPT,