LCOV - code coverage report
Current view: top level - include/linux - io_uring.h (source / functions) Hit Total Coverage
Test: landlock.info Lines: 4 6 66.7 %
Date: 2021-04-22 12:43:58 Functions: 0 0 -

          Line data    Source code
       1             : /* SPDX-License-Identifier: GPL-2.0-or-later */
       2             : #ifndef _LINUX_IO_URING_H
       3             : #define _LINUX_IO_URING_H
       4             : 
       5             : #include <linux/sched.h>
       6             : #include <linux/xarray.h>
       7             : 
       8             : struct io_wq_work_node {
       9             :         struct io_wq_work_node *next;
      10             : };
      11             : 
      12             : struct io_wq_work_list {
      13             :         struct io_wq_work_node *first;
      14             :         struct io_wq_work_node *last;
      15             : };
      16             : 
      17             : struct io_uring_task {
      18             :         /* submission side */
      19             :         struct xarray           xa;
      20             :         struct wait_queue_head  wait;
      21             :         void                    *last;
      22             :         void                    *io_wq;
      23             :         struct percpu_counter   inflight;
      24             :         atomic_t                in_idle;
      25             :         bool                    sqpoll;
      26             : 
      27             :         spinlock_t              task_lock;
      28             :         struct io_wq_work_list  task_list;
      29             :         unsigned long           task_state;
      30             :         struct callback_head    task_work;
      31             : };
      32             : 
      33             : #if defined(CONFIG_IO_URING)
      34             : struct sock *io_uring_get_socket(struct file *file);
      35             : void __io_uring_task_cancel(void);
      36             : void __io_uring_files_cancel(struct files_struct *files);
      37             : void __io_uring_free(struct task_struct *tsk);
      38             : 
      39             : static inline void io_uring_task_cancel(void)
      40             : {
      41             :         if (current->io_uring)
      42             :                 __io_uring_task_cancel();
      43             : }
      44             : static inline void io_uring_files_cancel(struct files_struct *files)
      45             : {
      46             :         if (current->io_uring)
      47             :                 __io_uring_files_cancel(files);
      48             : }
      49             : static inline void io_uring_free(struct task_struct *tsk)
      50             : {
      51             :         if (tsk->io_uring)
      52             :                 __io_uring_free(tsk);
      53             : }
      54             : #else
      55             : static inline struct sock *io_uring_get_socket(struct file *file)
      56             : {
      57             :         return NULL;
      58             : }
      59        1021 : static inline void io_uring_task_cancel(void)
      60             : {
      61        1021 : }
      62           0 : static inline void io_uring_files_cancel(struct files_struct *files)
      63             : {
      64           0 : }
      65         834 : static inline void io_uring_free(struct task_struct *tsk)
      66             : {
      67         834 : }
      68             : #endif
      69             : 
      70             : #endif

Generated by: LCOV version 1.14