• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _LINUX_SUNRPC_SCHED_H_
20 #define _LINUX_SUNRPC_SCHED_H_
21 #include <linux/timer.h>
22 #include <linux/sunrpc/types.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #include <linux/spinlock.h>
25 #include <linux/wait.h>
26 #include <linux/workqueue.h>
27 #include <linux/sunrpc/xdr.h>
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 struct rpc_procinfo;
30 struct rpc_message {
31  struct rpc_procinfo * rpc_proc;
32  void * rpc_argp;
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  void * rpc_resp;
35  struct rpc_cred * rpc_cred;
36 };
37 struct rpc_call_ops;
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 struct rpc_wait_queue;
40 struct rpc_wait {
41  struct list_head list;
42  struct list_head links;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  struct rpc_wait_queue * rpc_waitq;
45 };
46 struct rpc_task {
47 #ifdef RPC_DEBUG
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  unsigned long tk_magic;
50 #endif
51  atomic_t tk_count;
52  struct list_head tk_task;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  struct rpc_clnt * tk_client;
55  struct rpc_rqst * tk_rqstp;
56  int tk_status;
57  struct rpc_message tk_msg;
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  __u8 tk_garb_retry;
60  __u8 tk_cred_retry;
61  unsigned long tk_cookie;
62  void (*tk_timeout_fn)(struct rpc_task *);
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  void (*tk_callback)(struct rpc_task *);
65  void (*tk_action)(struct rpc_task *);
66  const struct rpc_call_ops *tk_ops;
67  void * tk_calldata;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  struct timer_list tk_timer;
70  unsigned long tk_timeout;
71  unsigned short tk_flags;
72  unsigned char tk_priority : 2;
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74  unsigned long tk_runstate;
75  struct workqueue_struct *tk_workqueue;
76  union {
77  struct work_struct tk_work;
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  struct rpc_wait tk_wait;
80  } u;
81  unsigned short tk_timeouts;
82  size_t tk_bytes_sent;
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84  unsigned long tk_start;
85  long tk_rtt;
86 #ifdef RPC_DEBUG
87  unsigned short tk_pid;
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #endif
90 };
91 #define tk_auth tk_client->cl_auth
92 #define tk_xprt tk_client->cl_xprt
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define task_for_each(task, pos, head)   list_for_each(pos, head)   if ((task=list_entry(pos, struct rpc_task, u.tk_wait.list)),1)
95 #define task_for_first(task, head)   if (!list_empty(head) &&   ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1))
96 #define alltask_for_each(task, pos, head)   list_for_each(pos, head)   if ((task=list_entry(pos, struct rpc_task, tk_task)),1)
97 typedef void (*rpc_action)(struct rpc_task *);
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 struct rpc_call_ops {
100  void (*rpc_call_prepare)(struct rpc_task *, void *);
101  void (*rpc_call_done)(struct rpc_task *, void *);
102  void (*rpc_release)(void *);
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 };
105 #define RPC_TASK_ASYNC 0x0001
106 #define RPC_TASK_SWAPPER 0x0002
107 #define RPC_TASK_CHILD 0x0008
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 #define RPC_CALL_MAJORSEEN 0x0020
110 #define RPC_TASK_ROOTCREDS 0x0040
111 #define RPC_TASK_DYNAMIC 0x0080
112 #define RPC_TASK_KILLED 0x0100
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 #define RPC_TASK_SOFT 0x0200
115 #define RPC_TASK_NOINTR 0x0400
116 #define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
117 #define RPC_IS_CHILD(t) ((t)->tk_flags & RPC_TASK_CHILD)
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
120 #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
121 #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
122 #define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL)
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
125 #define RPC_TASK_UNINTERRUPTIBLE(t) ((t)->tk_flags & RPC_TASK_NOINTR)
126 #define RPC_TASK_RUNNING 0
127 #define RPC_TASK_QUEUED 1
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 #define RPC_TASK_WAKEUP 2
130 #define RPC_TASK_HAS_TIMER 3
131 #define RPC_TASK_ACTIVE 4
132 #define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 #define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
135 #define rpc_test_and_set_running(t)   (test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
136 #define rpc_clear_running(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_RUNNING, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while (0)
137 #define RPC_IS_QUEUED(t) (test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate))
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 #define rpc_set_queued(t) (set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate))
140 #define rpc_clear_queued(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_QUEUED, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while (0)
141 #define rpc_start_wakeup(t)   (test_and_set_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate) == 0)
142 #define rpc_finish_wakeup(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_WAKEUP, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while (0)
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 #define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
145 #define rpc_set_active(t) (set_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
146 #define rpc_clear_active(t)   do {   smp_mb__before_clear_bit();   clear_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate);   smp_mb__after_clear_bit();   } while(0)
147 #define RPC_PRIORITY_LOW 0
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #define RPC_PRIORITY_NORMAL 1
150 #define RPC_PRIORITY_HIGH 2
151 #define RPC_NR_PRIORITY (RPC_PRIORITY_HIGH+1)
152 struct rpc_wait_queue {
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  spinlock_t lock;
155  struct list_head tasks[RPC_NR_PRIORITY];
156  unsigned long cookie;
157  unsigned char maxpriority;
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159  unsigned char priority;
160  unsigned char count;
161  unsigned char nr;
162  unsigned short qlen;
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 #ifdef RPC_DEBUG
165  const char * name;
166 #endif
167 };
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169 #define RPC_BATCH_COUNT 16
170 #ifndef RPC_DEBUG
171 #define RPC_WAITQ_INIT(var,qname) {   .lock = SPIN_LOCK_UNLOCKED,   .tasks = {   [0] = LIST_HEAD_INIT(var.tasks[0]),   [1] = LIST_HEAD_INIT(var.tasks[1]),   [2] = LIST_HEAD_INIT(var.tasks[2]),   },   }
172 #else
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174 #define RPC_WAITQ_INIT(var,qname) {   .lock = SPIN_LOCK_UNLOCKED,   .tasks = {   [0] = LIST_HEAD_INIT(var.tasks[0]),   [1] = LIST_HEAD_INIT(var.tasks[1]),   [2] = LIST_HEAD_INIT(var.tasks[2]),   },   .name = qname,   }
175 #endif
176 #define RPC_WAITQ(var,qname) struct rpc_wait_queue var = RPC_WAITQ_INIT(var,qname)
177 #define RPC_IS_PRIORITY(q) ((q)->maxpriority > 0)
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179 struct rpc_task *rpc_new_task(struct rpc_clnt *, int flags,
180  const struct rpc_call_ops *ops, void *data);
181 struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
182  const struct rpc_call_ops *ops, void *data);
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent);
185 struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *);
186 #ifdef RPC_DEBUG
187 #endif
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 #ifdef RPC_DEBUG
190 #endif
191 #endif
192