github.com/google/syzkaller@v0.0.0-20251211124644-a066d2bc4b02/tools/syz-declextract/testdata/io_uring.c (about)

     1  // Copyright 2024 syzkaller project authors. All rights reserved.
     2  // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
     3  
     4  #include "include/uapi/io_uring.h"
     5  
     6  struct io_issue_def {
     7  	void (*prep)(void);
     8  	void (*issue)(void);
     9  };
    10  
    11  void io_eopnotsupp_prep() {}
    12  void io_nop_prep() {}
    13  void io_nop() {}
    14  void io_readv_prep() {}
    15  void io_read() {}
    16  void io_writev_prep() {}
    17  void io_write() {}
    18  
    19  const struct io_issue_def ops[] = {
    20  	[IORING_OP_NOP] = {
    21  		.prep			= io_nop_prep,
    22  		.issue			= io_nop,
    23  	},
    24  	[IORING_OP_READV] = {
    25  		.prep			= io_readv_prep,
    26  		.issue			= io_read,
    27  	},
    28  	[IORING_OP_WRITEV] = {
    29  		.prep			= io_writev_prep,
    30  		.issue			= io_write,
    31  	},
    32  	[IORING_OP_NOT_SUPPORTED] = {
    33  		.prep			= io_eopnotsupp_prep,
    34  		.issue			= io_write,
    35  	},
    36  };