diff options
Diffstat (limited to 'include/linux')
45 files changed, 1332 insertions, 161 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 7ac8303c8471..e3ffd14a3f0b 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -47,6 +47,7 @@ header-y += coda_psdev.h | |||
47 | header-y += coff.h | 47 | header-y += coff.h |
48 | header-y += comstats.h | 48 | header-y += comstats.h |
49 | header-y += const.h | 49 | header-y += const.h |
50 | header-y += cgroupstats.h | ||
50 | header-y += cycx_cfm.h | 51 | header-y += cycx_cfm.h |
51 | header-y += dlm_device.h | 52 | header-y += dlm_device.h |
52 | header-y += dlm_netlink.h | 53 | header-y += dlm_netlink.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index bf5e0009de75..8ccedf7a0a5a 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -189,32 +189,6 @@ extern int ec_transaction(u8 command, | |||
189 | extern int acpi_blacklisted(void); | 189 | extern int acpi_blacklisted(void); |
190 | extern void acpi_bios_year(char *s); | 190 | extern void acpi_bios_year(char *s); |
191 | 191 | ||
192 | #define ACPI_CSTATE_LIMIT_DEFINED /* for driver builds */ | ||
193 | #ifdef CONFIG_ACPI | ||
194 | |||
195 | /* | ||
196 | * Set highest legal C-state | ||
197 | * 0: C0 okay, but not C1 | ||
198 | * 1: C1 okay, but not C2 | ||
199 | * 2: C2 okay, but not C3 etc. | ||
200 | */ | ||
201 | |||
202 | extern unsigned int max_cstate; | ||
203 | |||
204 | static inline unsigned int acpi_get_cstate_limit(void) | ||
205 | { | ||
206 | return max_cstate; | ||
207 | } | ||
208 | static inline void acpi_set_cstate_limit(unsigned int new_limit) | ||
209 | { | ||
210 | max_cstate = new_limit; | ||
211 | return; | ||
212 | } | ||
213 | #else | ||
214 | static inline unsigned int acpi_get_cstate_limit(void) { return 0; } | ||
215 | static inline void acpi_set_cstate_limit(unsigned int new_limit) { return; } | ||
216 | #endif | ||
217 | |||
218 | #ifdef CONFIG_ACPI_NUMA | 192 | #ifdef CONFIG_ACPI_NUMA |
219 | int acpi_get_pxm(acpi_handle handle); | 193 | int acpi_get_pxm(acpi_handle handle); |
220 | int acpi_get_node(acpi_handle *handle); | 194 | int acpi_get_node(acpi_handle *handle); |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 64b4641904fe..acad1105d942 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/bitops.h> | 7 | #include <linux/bitops.h> |
8 | #include <linux/string.h> | 8 | #include <linux/string.h> |
9 | #include <linux/kernel.h> | ||
9 | 10 | ||
10 | /* | 11 | /* |
11 | * bitmaps provide bit arrays that consume one or more unsigned | 12 | * bitmaps provide bit arrays that consume one or more unsigned |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index b9fb8ee3308b..69c1edb9fe54 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -2,6 +2,14 @@ | |||
2 | #define _LINUX_BITOPS_H | 2 | #define _LINUX_BITOPS_H |
3 | #include <asm/types.h> | 3 | #include <asm/types.h> |
4 | 4 | ||
5 | #ifdef __KERNEL__ | ||
6 | #define BIT(nr) (1UL << (nr)) | ||
7 | #define BIT_MASK(nr) (1UL << ((nr) % BITS_PER_LONG)) | ||
8 | #define BIT_WORD(nr) ((nr) / BITS_PER_LONG) | ||
9 | #define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_LONG) | ||
10 | #define BITS_PER_BYTE 8 | ||
11 | #endif | ||
12 | |||
5 | /* | 13 | /* |
6 | * Include this here because some architectures need generic_ffs/fls in | 14 | * Include this here because some architectures need generic_ffs/fls in |
7 | * scope | 15 | * scope |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h new file mode 100644 index 000000000000..87479328d46d --- /dev/null +++ b/include/linux/cgroup.h | |||
@@ -0,0 +1,327 @@ | |||
1 | #ifndef _LINUX_CGROUP_H | ||
2 | #define _LINUX_CGROUP_H | ||
3 | /* | ||
4 | * cgroup interface | ||
5 | * | ||
6 | * Copyright (C) 2003 BULL SA | ||
7 | * Copyright (C) 2004-2006 Silicon Graphics, Inc. | ||
8 | * | ||
9 | */ | ||
10 | |||
11 | #include <linux/sched.h> | ||
12 | #include <linux/kref.h> | ||
13 | #include <linux/cpumask.h> | ||
14 | #include <linux/nodemask.h> | ||
15 | #include <linux/rcupdate.h> | ||
16 | #include <linux/cgroupstats.h> | ||
17 | |||
18 | #ifdef CONFIG_CGROUPS | ||
19 | |||
20 | struct cgroupfs_root; | ||
21 | struct cgroup_subsys; | ||
22 | struct inode; | ||
23 | |||
24 | extern int cgroup_init_early(void); | ||
25 | extern int cgroup_init(void); | ||
26 | extern void cgroup_init_smp(void); | ||
27 | extern void cgroup_lock(void); | ||
28 | extern void cgroup_unlock(void); | ||
29 | extern void cgroup_fork(struct task_struct *p); | ||
30 | extern void cgroup_fork_callbacks(struct task_struct *p); | ||
31 | extern void cgroup_post_fork(struct task_struct *p); | ||
32 | extern void cgroup_exit(struct task_struct *p, int run_callbacks); | ||
33 | extern int cgroupstats_build(struct cgroupstats *stats, | ||
34 | struct dentry *dentry); | ||
35 | |||
36 | extern struct file_operations proc_cgroup_operations; | ||
37 | |||
38 | /* Define the enumeration of all cgroup subsystems */ | ||
39 | #define SUBSYS(_x) _x ## _subsys_id, | ||
40 | enum cgroup_subsys_id { | ||
41 | #include <linux/cgroup_subsys.h> | ||
42 | CGROUP_SUBSYS_COUNT | ||
43 | }; | ||
44 | #undef SUBSYS | ||
45 | |||
46 | /* Per-subsystem/per-cgroup state maintained by the system. */ | ||
47 | struct cgroup_subsys_state { | ||
48 | /* The cgroup that this subsystem is attached to. Useful | ||
49 | * for subsystems that want to know about the cgroup | ||
50 | * hierarchy structure */ | ||
51 | struct cgroup *cgroup; | ||
52 | |||
53 | /* State maintained by the cgroup system to allow | ||
54 | * subsystems to be "busy". Should be accessed via css_get() | ||
55 | * and css_put() */ | ||
56 | |||
57 | atomic_t refcnt; | ||
58 | |||
59 | unsigned long flags; | ||
60 | }; | ||
61 | |||
62 | /* bits in struct cgroup_subsys_state flags field */ | ||
63 | enum { | ||
64 | CSS_ROOT, /* This CSS is the root of the subsystem */ | ||
65 | }; | ||
66 | |||
67 | /* | ||
68 | * Call css_get() to hold a reference on the cgroup; | ||
69 | * | ||
70 | */ | ||
71 | |||
72 | static inline void css_get(struct cgroup_subsys_state *css) | ||
73 | { | ||
74 | /* We don't need to reference count the root state */ | ||
75 | if (!test_bit(CSS_ROOT, &css->flags)) | ||
76 | atomic_inc(&css->refcnt); | ||
77 | } | ||
78 | /* | ||
79 | * css_put() should be called to release a reference taken by | ||
80 | * css_get() | ||
81 | */ | ||
82 | |||
83 | extern void __css_put(struct cgroup_subsys_state *css); | ||
84 | static inline void css_put(struct cgroup_subsys_state *css) | ||
85 | { | ||
86 | if (!test_bit(CSS_ROOT, &css->flags)) | ||
87 | __css_put(css); | ||
88 | } | ||
89 | |||
90 | struct cgroup { | ||
91 | unsigned long flags; /* "unsigned long" so bitops work */ | ||
92 | |||
93 | /* count users of this cgroup. >0 means busy, but doesn't | ||
94 | * necessarily indicate the number of tasks in the | ||
95 | * cgroup */ | ||
96 | atomic_t count; | ||
97 | |||
98 | /* | ||
99 | * We link our 'sibling' struct into our parent's 'children'. | ||
100 | * Our children link their 'sibling' into our 'children'. | ||
101 | */ | ||
102 | struct list_head sibling; /* my parent's children */ | ||
103 | struct list_head children; /* my children */ | ||
104 | |||
105 | struct cgroup *parent; /* my parent */ | ||
106 | struct dentry *dentry; /* cgroup fs entry */ | ||
107 | |||
108 | /* Private pointers for each registered subsystem */ | ||
109 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | ||
110 | |||
111 | struct cgroupfs_root *root; | ||
112 | struct cgroup *top_cgroup; | ||
113 | |||
114 | /* | ||
115 | * List of cg_cgroup_links pointing at css_sets with | ||
116 | * tasks in this cgroup. Protected by css_set_lock | ||
117 | */ | ||
118 | struct list_head css_sets; | ||
119 | |||
120 | /* | ||
121 | * Linked list running through all cgroups that can | ||
122 | * potentially be reaped by the release agent. Protected by | ||
123 | * release_list_lock | ||
124 | */ | ||
125 | struct list_head release_list; | ||
126 | }; | ||
127 | |||
128 | /* A css_set is a structure holding pointers to a set of | ||
129 | * cgroup_subsys_state objects. This saves space in the task struct | ||
130 | * object and speeds up fork()/exit(), since a single inc/dec and a | ||
131 | * list_add()/del() can bump the reference count on the entire | ||
132 | * cgroup set for a task. | ||
133 | */ | ||
134 | |||
135 | struct css_set { | ||
136 | |||
137 | /* Reference count */ | ||
138 | struct kref ref; | ||
139 | |||
140 | /* | ||
141 | * List running through all cgroup groups. Protected by | ||
142 | * css_set_lock | ||
143 | */ | ||
144 | struct list_head list; | ||
145 | |||
146 | /* | ||
147 | * List running through all tasks using this cgroup | ||
148 | * group. Protected by css_set_lock | ||
149 | */ | ||
150 | struct list_head tasks; | ||
151 | |||
152 | /* | ||
153 | * List of cg_cgroup_link objects on link chains from | ||
154 | * cgroups referenced from this css_set. Protected by | ||
155 | * css_set_lock | ||
156 | */ | ||
157 | struct list_head cg_links; | ||
158 | |||
159 | /* | ||
160 | * Set of subsystem states, one for each subsystem. This array | ||
161 | * is immutable after creation apart from the init_css_set | ||
162 | * during subsystem registration (at boot time). | ||
163 | */ | ||
164 | struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; | ||
165 | |||
166 | }; | ||
167 | |||
168 | /* struct cftype: | ||
169 | * | ||
170 | * The files in the cgroup filesystem mostly have a very simple read/write | ||
171 | * handling, some common function will take care of it. Nevertheless some cases | ||
172 | * (read tasks) are special and therefore I define this structure for every | ||
173 | * kind of file. | ||
174 | * | ||
175 | * | ||
176 | * When reading/writing to a file: | ||
177 | * - the cgroup to use in file->f_dentry->d_parent->d_fsdata | ||
178 | * - the 'cftype' of the file is file->f_dentry->d_fsdata | ||
179 | */ | ||
180 | |||
181 | #define MAX_CFTYPE_NAME 64 | ||
182 | struct cftype { | ||
183 | /* By convention, the name should begin with the name of the | ||
184 | * subsystem, followed by a period */ | ||
185 | char name[MAX_CFTYPE_NAME]; | ||
186 | int private; | ||
187 | int (*open) (struct inode *inode, struct file *file); | ||
188 | ssize_t (*read) (struct cgroup *cont, struct cftype *cft, | ||
189 | struct file *file, | ||
190 | char __user *buf, size_t nbytes, loff_t *ppos); | ||
191 | /* | ||
192 | * read_uint() is a shortcut for the common case of returning a | ||
193 | * single integer. Use it in place of read() | ||
194 | */ | ||
195 | u64 (*read_uint) (struct cgroup *cont, struct cftype *cft); | ||
196 | ssize_t (*write) (struct cgroup *cont, struct cftype *cft, | ||
197 | struct file *file, | ||
198 | const char __user *buf, size_t nbytes, loff_t *ppos); | ||
199 | |||
200 | /* | ||
201 | * write_uint() is a shortcut for the common case of accepting | ||
202 | * a single integer (as parsed by simple_strtoull) from | ||
203 | * userspace. Use in place of write(); return 0 or error. | ||
204 | */ | ||
205 | int (*write_uint) (struct cgroup *cont, struct cftype *cft, u64 val); | ||
206 | |||
207 | int (*release) (struct inode *inode, struct file *file); | ||
208 | }; | ||
209 | |||
210 | /* Add a new file to the given cgroup directory. Should only be | ||
211 | * called by subsystems from within a populate() method */ | ||
212 | int cgroup_add_file(struct cgroup *cont, struct cgroup_subsys *subsys, | ||
213 | const struct cftype *cft); | ||
214 | |||
215 | /* Add a set of new files to the given cgroup directory. Should | ||
216 | * only be called by subsystems from within a populate() method */ | ||
217 | int cgroup_add_files(struct cgroup *cont, | ||
218 | struct cgroup_subsys *subsys, | ||
219 | const struct cftype cft[], | ||
220 | int count); | ||
221 | |||
222 | int cgroup_is_removed(const struct cgroup *cont); | ||
223 | |||
224 | int cgroup_path(const struct cgroup *cont, char *buf, int buflen); | ||
225 | |||
226 | int cgroup_task_count(const struct cgroup *cont); | ||
227 | |||
228 | /* Return true if the cgroup is a descendant of the current cgroup */ | ||
229 | int cgroup_is_descendant(const struct cgroup *cont); | ||
230 | |||
231 | /* Control Group subsystem type. See Documentation/cgroups.txt for details */ | ||
232 | |||
233 | struct cgroup_subsys { | ||
234 | struct cgroup_subsys_state *(*create)(struct cgroup_subsys *ss, | ||
235 | struct cgroup *cont); | ||
236 | void (*destroy)(struct cgroup_subsys *ss, struct cgroup *cont); | ||
237 | int (*can_attach)(struct cgroup_subsys *ss, | ||
238 | struct cgroup *cont, struct task_struct *tsk); | ||
239 | void (*attach)(struct cgroup_subsys *ss, struct cgroup *cont, | ||
240 | struct cgroup *old_cont, struct task_struct *tsk); | ||
241 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | ||
242 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); | ||
243 | int (*populate)(struct cgroup_subsys *ss, | ||
244 | struct cgroup *cont); | ||
245 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cont); | ||
246 | void (*bind)(struct cgroup_subsys *ss, struct cgroup *root); | ||
247 | int subsys_id; | ||
248 | int active; | ||
249 | int early_init; | ||
250 | #define MAX_CGROUP_TYPE_NAMELEN 32 | ||
251 | const char *name; | ||
252 | |||
253 | /* Protected by RCU */ | ||
254 | struct cgroupfs_root *root; | ||
255 | |||
256 | struct list_head sibling; | ||
257 | |||
258 | void *private; | ||
259 | }; | ||
260 | |||
261 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; | ||
262 | #include <linux/cgroup_subsys.h> | ||
263 | #undef SUBSYS | ||
264 | |||
265 | static inline struct cgroup_subsys_state *cgroup_subsys_state( | ||
266 | struct cgroup *cont, int subsys_id) | ||
267 | { | ||
268 | return cont->subsys[subsys_id]; | ||
269 | } | ||
270 | |||
271 | static inline struct cgroup_subsys_state *task_subsys_state( | ||
272 | struct task_struct *task, int subsys_id) | ||
273 | { | ||
274 | return rcu_dereference(task->cgroups->subsys[subsys_id]); | ||
275 | } | ||
276 | |||
277 | static inline struct cgroup* task_cgroup(struct task_struct *task, | ||
278 | int subsys_id) | ||
279 | { | ||
280 | return task_subsys_state(task, subsys_id)->cgroup; | ||
281 | } | ||
282 | |||
283 | int cgroup_path(const struct cgroup *cont, char *buf, int buflen); | ||
284 | |||
285 | int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *ss); | ||
286 | |||
287 | /* A cgroup_iter should be treated as an opaque object */ | ||
288 | struct cgroup_iter { | ||
289 | struct list_head *cg_link; | ||
290 | struct list_head *task; | ||
291 | }; | ||
292 | |||
293 | /* To iterate across the tasks in a cgroup: | ||
294 | * | ||
295 | * 1) call cgroup_iter_start to intialize an iterator | ||
296 | * | ||
297 | * 2) call cgroup_iter_next() to retrieve member tasks until it | ||
298 | * returns NULL or until you want to end the iteration | ||
299 | * | ||
300 | * 3) call cgroup_iter_end() to destroy the iterator. | ||
301 | */ | ||
302 | void cgroup_iter_start(struct cgroup *cont, struct cgroup_iter *it); | ||
303 | struct task_struct *cgroup_iter_next(struct cgroup *cont, | ||
304 | struct cgroup_iter *it); | ||
305 | void cgroup_iter_end(struct cgroup *cont, struct cgroup_iter *it); | ||
306 | |||
307 | #else /* !CONFIG_CGROUPS */ | ||
308 | |||
309 | static inline int cgroup_init_early(void) { return 0; } | ||
310 | static inline int cgroup_init(void) { return 0; } | ||
311 | static inline void cgroup_init_smp(void) {} | ||
312 | static inline void cgroup_fork(struct task_struct *p) {} | ||
313 | static inline void cgroup_fork_callbacks(struct task_struct *p) {} | ||
314 | static inline void cgroup_post_fork(struct task_struct *p) {} | ||
315 | static inline void cgroup_exit(struct task_struct *p, int callbacks) {} | ||
316 | |||
317 | static inline void cgroup_lock(void) {} | ||
318 | static inline void cgroup_unlock(void) {} | ||
319 | static inline int cgroupstats_build(struct cgroupstats *stats, | ||
320 | struct dentry *dentry) | ||
321 | { | ||
322 | return -EINVAL; | ||
323 | } | ||
324 | |||
325 | #endif /* !CONFIG_CGROUPS */ | ||
326 | |||
327 | #endif /* _LINUX_CGROUP_H */ | ||
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h new file mode 100644 index 000000000000..0b9bfbde8168 --- /dev/null +++ b/include/linux/cgroup_subsys.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* Add subsystem definitions of the form SUBSYS(<name>) in this | ||
2 | * file. Surround each one by a line of comment markers so that | ||
3 | * patches don't collide | ||
4 | */ | ||
5 | |||
6 | /* */ | ||
7 | |||
8 | /* */ | ||
9 | |||
10 | #ifdef CONFIG_CPUSETS | ||
11 | SUBSYS(cpuset) | ||
12 | #endif | ||
13 | |||
14 | /* */ | ||
15 | |||
16 | #ifdef CONFIG_CGROUP_CPUACCT | ||
17 | SUBSYS(cpuacct) | ||
18 | #endif | ||
19 | |||
20 | /* */ | ||
21 | |||
22 | #ifdef CONFIG_CGROUP_DEBUG | ||
23 | SUBSYS(debug) | ||
24 | #endif | ||
25 | |||
26 | /* */ | ||
27 | |||
28 | #ifdef CONFIG_CGROUP_NS | ||
29 | SUBSYS(ns) | ||
30 | #endif | ||
31 | |||
32 | /* */ | ||
33 | |||
34 | #ifdef CONFIG_FAIR_CGROUP_SCHED | ||
35 | SUBSYS(cpu_cgroup) | ||
36 | #endif | ||
37 | |||
38 | /* */ | ||
diff --git a/include/linux/cgroupstats.h b/include/linux/cgroupstats.h new file mode 100644 index 000000000000..4f53abf6855d --- /dev/null +++ b/include/linux/cgroupstats.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* cgroupstats.h - exporting per-cgroup statistics | ||
2 | * | ||
3 | * Copyright IBM Corporation, 2007 | ||
4 | * Author Balbir Singh <balbir@linux.vnet.ibm.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of version 2.1 of the GNU Lesser General Public License | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it would be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | */ | ||
14 | |||
15 | #ifndef _LINUX_CGROUPSTATS_H | ||
16 | #define _LINUX_CGROUPSTATS_H | ||
17 | |||
18 | #include <linux/taskstats.h> | ||
19 | |||
20 | /* | ||
21 | * Data shared between user space and kernel space on a per cgroup | ||
22 | * basis. This data is shared using taskstats. | ||
23 | * | ||
24 | * Most of these states are derived by looking at the task->state value | ||
25 | * For the nr_io_wait state, a flag in the delay accounting structure | ||
26 | * indicates that the task is waiting on IO | ||
27 | * | ||
28 | * Each member is aligned to a 8 byte boundary. | ||
29 | */ | ||
30 | struct cgroupstats { | ||
31 | __u64 nr_sleeping; /* Number of tasks sleeping */ | ||
32 | __u64 nr_running; /* Number of tasks running */ | ||
33 | __u64 nr_stopped; /* Number of tasks in stopped state */ | ||
34 | __u64 nr_uninterruptible; /* Number of tasks in uninterruptible */ | ||
35 | /* state */ | ||
36 | __u64 nr_io_wait; /* Number of tasks waiting on IO */ | ||
37 | }; | ||
38 | |||
39 | /* | ||
40 | * Commands sent from userspace | ||
41 | * Not versioned. New commands should only be inserted at the enum's end | ||
42 | * prior to __CGROUPSTATS_CMD_MAX | ||
43 | */ | ||
44 | |||
45 | enum { | ||
46 | CGROUPSTATS_CMD_UNSPEC = __TASKSTATS_CMD_MAX, /* Reserved */ | ||
47 | CGROUPSTATS_CMD_GET, /* user->kernel request/get-response */ | ||
48 | CGROUPSTATS_CMD_NEW, /* kernel->user event */ | ||
49 | __CGROUPSTATS_CMD_MAX, | ||
50 | }; | ||
51 | |||
52 | #define CGROUPSTATS_CMD_MAX (__CGROUPSTATS_CMD_MAX - 1) | ||
53 | |||
54 | enum { | ||
55 | CGROUPSTATS_TYPE_UNSPEC = 0, /* Reserved */ | ||
56 | CGROUPSTATS_TYPE_CGROUP_STATS, /* contains name + stats */ | ||
57 | __CGROUPSTATS_TYPE_MAX, | ||
58 | }; | ||
59 | |||
60 | #define CGROUPSTATS_TYPE_MAX (__CGROUPSTATS_TYPE_MAX - 1) | ||
61 | |||
62 | enum { | ||
63 | CGROUPSTATS_CMD_ATTR_UNSPEC = 0, | ||
64 | CGROUPSTATS_CMD_ATTR_FD, | ||
65 | __CGROUPSTATS_CMD_ATTR_MAX, | ||
66 | }; | ||
67 | |||
68 | #define CGROUPSTATS_CMD_ATTR_MAX (__CGROUPSTATS_CMD_ATTR_MAX - 1) | ||
69 | |||
70 | #endif /* _LINUX_CGROUPSTATS_H */ | ||
diff --git a/include/linux/cpu_acct.h b/include/linux/cpu_acct.h new file mode 100644 index 000000000000..6b5fd8a66c8d --- /dev/null +++ b/include/linux/cpu_acct.h | |||
@@ -0,0 +1,14 @@ | |||
1 | |||
2 | #ifndef _LINUX_CPU_ACCT_H | ||
3 | #define _LINUX_CPU_ACCT_H | ||
4 | |||
5 | #include <linux/cgroup.h> | ||
6 | #include <asm/cputime.h> | ||
7 | |||
8 | #ifdef CONFIG_CGROUP_CPUACCT | ||
9 | extern void cpuacct_charge(struct task_struct *, cputime_t cputime); | ||
10 | #else | ||
11 | static void inline cpuacct_charge(struct task_struct *p, cputime_t cputime) {} | ||
12 | #endif | ||
13 | |||
14 | #endif | ||
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h new file mode 100644 index 000000000000..16a51546db44 --- /dev/null +++ b/include/linux/cpuidle.h | |||
@@ -0,0 +1,180 @@ | |||
1 | /* | ||
2 | * cpuidle.h - a generic framework for CPU idle power management | ||
3 | * | ||
4 | * (C) 2007 Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> | ||
5 | * Shaohua Li <shaohua.li@intel.com> | ||
6 | * Adam Belay <abelay@novell.com> | ||
7 | * | ||
8 | * This code is licenced under the GPL. | ||
9 | */ | ||
10 | |||
11 | #ifndef _LINUX_CPUIDLE_H | ||
12 | #define _LINUX_CPUIDLE_H | ||
13 | |||
14 | #include <linux/percpu.h> | ||
15 | #include <linux/list.h> | ||
16 | #include <linux/module.h> | ||
17 | #include <linux/kobject.h> | ||
18 | #include <linux/completion.h> | ||
19 | |||
20 | #define CPUIDLE_STATE_MAX 8 | ||
21 | #define CPUIDLE_NAME_LEN 16 | ||
22 | |||
23 | struct cpuidle_device; | ||
24 | |||
25 | |||
26 | /**************************** | ||
27 | * CPUIDLE DEVICE INTERFACE * | ||
28 | ****************************/ | ||
29 | |||
30 | struct cpuidle_state { | ||
31 | char name[CPUIDLE_NAME_LEN]; | ||
32 | void *driver_data; | ||
33 | |||
34 | unsigned int flags; | ||
35 | unsigned int exit_latency; /* in US */ | ||
36 | unsigned int power_usage; /* in mW */ | ||
37 | unsigned int target_residency; /* in US */ | ||
38 | |||
39 | unsigned int usage; | ||
40 | unsigned int time; /* in US */ | ||
41 | |||
42 | int (*enter) (struct cpuidle_device *dev, | ||
43 | struct cpuidle_state *state); | ||
44 | }; | ||
45 | |||
46 | /* Idle State Flags */ | ||
47 | #define CPUIDLE_FLAG_TIME_VALID (0x01) /* is residency time measurable? */ | ||
48 | #define CPUIDLE_FLAG_CHECK_BM (0x02) /* BM activity will exit state */ | ||
49 | #define CPUIDLE_FLAG_SHALLOW (0x10) /* low latency, minimal savings */ | ||
50 | #define CPUIDLE_FLAG_BALANCED (0x20) /* medium latency, moderate savings */ | ||
51 | #define CPUIDLE_FLAG_DEEP (0x40) /* high latency, large savings */ | ||
52 | |||
53 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | ||
54 | |||
55 | /** | ||
56 | * cpuidle_get_statedata - retrieves private driver state data | ||
57 | * @state: the state | ||
58 | */ | ||
59 | static inline void * cpuidle_get_statedata(struct cpuidle_state *state) | ||
60 | { | ||
61 | return state->driver_data; | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * cpuidle_set_statedata - stores private driver state data | ||
66 | * @state: the state | ||
67 | * @data: the private data | ||
68 | */ | ||
69 | static inline void | ||
70 | cpuidle_set_statedata(struct cpuidle_state *state, void *data) | ||
71 | { | ||
72 | state->driver_data = data; | ||
73 | } | ||
74 | |||
75 | struct cpuidle_state_kobj { | ||
76 | struct cpuidle_state *state; | ||
77 | struct completion kobj_unregister; | ||
78 | struct kobject kobj; | ||
79 | }; | ||
80 | |||
81 | struct cpuidle_device { | ||
82 | int enabled:1; | ||
83 | unsigned int cpu; | ||
84 | |||
85 | int last_residency; | ||
86 | int state_count; | ||
87 | struct cpuidle_state states[CPUIDLE_STATE_MAX]; | ||
88 | struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; | ||
89 | struct cpuidle_state *last_state; | ||
90 | |||
91 | struct list_head device_list; | ||
92 | struct kobject kobj; | ||
93 | struct completion kobj_unregister; | ||
94 | void *governor_data; | ||
95 | }; | ||
96 | |||
97 | DECLARE_PER_CPU(struct cpuidle_device *, cpuidle_devices); | ||
98 | |||
99 | /** | ||
100 | * cpuidle_get_last_residency - retrieves the last state's residency time | ||
101 | * @dev: the target CPU | ||
102 | * | ||
103 | * NOTE: this value is invalid if CPUIDLE_FLAG_TIME_VALID isn't set | ||
104 | */ | ||
105 | static inline int cpuidle_get_last_residency(struct cpuidle_device *dev) | ||
106 | { | ||
107 | return dev->last_residency; | ||
108 | } | ||
109 | |||
110 | |||
111 | /**************************** | ||
112 | * CPUIDLE DRIVER INTERFACE * | ||
113 | ****************************/ | ||
114 | |||
115 | struct cpuidle_driver { | ||
116 | char name[CPUIDLE_NAME_LEN]; | ||
117 | struct module *owner; | ||
118 | }; | ||
119 | |||
120 | #ifdef CONFIG_CPU_IDLE | ||
121 | |||
122 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); | ||
123 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); | ||
124 | extern int cpuidle_register_device(struct cpuidle_device *dev); | ||
125 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); | ||
126 | |||
127 | extern void cpuidle_pause_and_lock(void); | ||
128 | extern void cpuidle_resume_and_unlock(void); | ||
129 | extern int cpuidle_enable_device(struct cpuidle_device *dev); | ||
130 | extern void cpuidle_disable_device(struct cpuidle_device *dev); | ||
131 | |||
132 | #else | ||
133 | |||
134 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) | ||
135 | {return 0;} | ||
136 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } | ||
137 | static inline int cpuidle_register_device(struct cpuidle_device *dev) | ||
138 | {return 0;} | ||
139 | static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { } | ||
140 | |||
141 | static inline void cpuidle_pause_and_lock(void) { } | ||
142 | static inline void cpuidle_resume_and_unlock(void) { } | ||
143 | static inline int cpuidle_enable_device(struct cpuidle_device *dev) | ||
144 | {return 0;} | ||
145 | static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } | ||
146 | |||
147 | #endif | ||
148 | |||
149 | /****************************** | ||
150 | * CPUIDLE GOVERNOR INTERFACE * | ||
151 | ******************************/ | ||
152 | |||
153 | struct cpuidle_governor { | ||
154 | char name[CPUIDLE_NAME_LEN]; | ||
155 | struct list_head governor_list; | ||
156 | unsigned int rating; | ||
157 | |||
158 | int (*enable) (struct cpuidle_device *dev); | ||
159 | void (*disable) (struct cpuidle_device *dev); | ||
160 | |||
161 | int (*select) (struct cpuidle_device *dev); | ||
162 | void (*reflect) (struct cpuidle_device *dev); | ||
163 | |||
164 | struct module *owner; | ||
165 | }; | ||
166 | |||
167 | #ifdef CONFIG_CPU_IDLE | ||
168 | |||
169 | extern int cpuidle_register_governor(struct cpuidle_governor *gov); | ||
170 | extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); | ||
171 | |||
172 | #else | ||
173 | |||
174 | static inline int cpuidle_register_governor(struct cpuidle_governor *gov) | ||
175 | {return 0;} | ||
176 | static inline void cpuidle_unregister_governor(struct cpuidle_governor *gov) { } | ||
177 | |||
178 | #endif | ||
179 | |||
180 | #endif /* _LINUX_CPUIDLE_H */ | ||
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index ea44d2e768a0..ecae585ec3da 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/cpumask.h> | 12 | #include <linux/cpumask.h> |
13 | #include <linux/nodemask.h> | 13 | #include <linux/nodemask.h> |
14 | #include <linux/cgroup.h> | ||
14 | 15 | ||
15 | #ifdef CONFIG_CPUSETS | 16 | #ifdef CONFIG_CPUSETS |
16 | 17 | ||
@@ -19,9 +20,8 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */ | |||
19 | extern int cpuset_init_early(void); | 20 | extern int cpuset_init_early(void); |
20 | extern int cpuset_init(void); | 21 | extern int cpuset_init(void); |
21 | extern void cpuset_init_smp(void); | 22 | extern void cpuset_init_smp(void); |
22 | extern void cpuset_fork(struct task_struct *p); | ||
23 | extern void cpuset_exit(struct task_struct *p); | ||
24 | extern cpumask_t cpuset_cpus_allowed(struct task_struct *p); | 23 | extern cpumask_t cpuset_cpus_allowed(struct task_struct *p); |
24 | extern cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p); | ||
25 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); | 25 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); |
26 | #define cpuset_current_mems_allowed (current->mems_allowed) | 26 | #define cpuset_current_mems_allowed (current->mems_allowed) |
27 | void cpuset_init_current_mems_allowed(void); | 27 | void cpuset_init_current_mems_allowed(void); |
@@ -76,18 +76,22 @@ static inline int cpuset_do_slab_mem_spread(void) | |||
76 | 76 | ||
77 | extern void cpuset_track_online_nodes(void); | 77 | extern void cpuset_track_online_nodes(void); |
78 | 78 | ||
79 | extern int current_cpuset_is_being_rebound(void); | ||
80 | |||
79 | #else /* !CONFIG_CPUSETS */ | 81 | #else /* !CONFIG_CPUSETS */ |
80 | 82 | ||
81 | static inline int cpuset_init_early(void) { return 0; } | 83 | static inline int cpuset_init_early(void) { return 0; } |
82 | static inline int cpuset_init(void) { return 0; } | 84 | static inline int cpuset_init(void) { return 0; } |
83 | static inline void cpuset_init_smp(void) {} | 85 | static inline void cpuset_init_smp(void) {} |
84 | static inline void cpuset_fork(struct task_struct *p) {} | ||
85 | static inline void cpuset_exit(struct task_struct *p) {} | ||
86 | 86 | ||
87 | static inline cpumask_t cpuset_cpus_allowed(struct task_struct *p) | 87 | static inline cpumask_t cpuset_cpus_allowed(struct task_struct *p) |
88 | { | 88 | { |
89 | return cpu_possible_map; | 89 | return cpu_possible_map; |
90 | } | 90 | } |
91 | static inline cpumask_t cpuset_cpus_allowed_locked(struct task_struct *p) | ||
92 | { | ||
93 | return cpu_possible_map; | ||
94 | } | ||
91 | 95 | ||
92 | static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) | 96 | static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) |
93 | { | 97 | { |
@@ -148,6 +152,11 @@ static inline int cpuset_do_slab_mem_spread(void) | |||
148 | 152 | ||
149 | static inline void cpuset_track_online_nodes(void) {} | 153 | static inline void cpuset_track_online_nodes(void) {} |
150 | 154 | ||
155 | static inline int current_cpuset_is_being_rebound(void) | ||
156 | { | ||
157 | return 0; | ||
158 | } | ||
159 | |||
151 | #endif /* !CONFIG_CPUSETS */ | 160 | #endif /* !CONFIG_CPUSETS */ |
152 | 161 | ||
153 | #endif /* _LINUX_CPUSET_H */ | 162 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/delayacct.h b/include/linux/delayacct.h index 55d1ca5e60f5..ab94bc083558 100644 --- a/include/linux/delayacct.h +++ b/include/linux/delayacct.h | |||
@@ -26,6 +26,7 @@ | |||
26 | * Used to set current->delays->flags | 26 | * Used to set current->delays->flags |
27 | */ | 27 | */ |
28 | #define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */ | 28 | #define DELAYACCT_PF_SWAPIN 0x00000001 /* I am doing a swapin */ |
29 | #define DELAYACCT_PF_BLKIO 0x00000002 /* I am waiting on IO */ | ||
29 | 30 | ||
30 | #ifdef CONFIG_TASK_DELAY_ACCT | 31 | #ifdef CONFIG_TASK_DELAY_ACCT |
31 | 32 | ||
@@ -39,6 +40,14 @@ extern void __delayacct_blkio_end(void); | |||
39 | extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); | 40 | extern int __delayacct_add_tsk(struct taskstats *, struct task_struct *); |
40 | extern __u64 __delayacct_blkio_ticks(struct task_struct *); | 41 | extern __u64 __delayacct_blkio_ticks(struct task_struct *); |
41 | 42 | ||
43 | static inline int delayacct_is_task_waiting_on_io(struct task_struct *p) | ||
44 | { | ||
45 | if (p->delays) | ||
46 | return (p->delays->flags & DELAYACCT_PF_BLKIO); | ||
47 | else | ||
48 | return 0; | ||
49 | } | ||
50 | |||
42 | static inline void delayacct_set_flag(int flag) | 51 | static inline void delayacct_set_flag(int flag) |
43 | { | 52 | { |
44 | if (current->delays) | 53 | if (current->delays) |
@@ -71,6 +80,7 @@ static inline void delayacct_tsk_free(struct task_struct *tsk) | |||
71 | 80 | ||
72 | static inline void delayacct_blkio_start(void) | 81 | static inline void delayacct_blkio_start(void) |
73 | { | 82 | { |
83 | delayacct_set_flag(DELAYACCT_PF_BLKIO); | ||
74 | if (current->delays) | 84 | if (current->delays) |
75 | __delayacct_blkio_start(); | 85 | __delayacct_blkio_start(); |
76 | } | 86 | } |
@@ -79,6 +89,7 @@ static inline void delayacct_blkio_end(void) | |||
79 | { | 89 | { |
80 | if (current->delays) | 90 | if (current->delays) |
81 | __delayacct_blkio_end(); | 91 | __delayacct_blkio_end(); |
92 | delayacct_clear_flag(DELAYACCT_PF_BLKIO); | ||
82 | } | 93 | } |
83 | 94 | ||
84 | static inline int delayacct_add_tsk(struct taskstats *d, | 95 | static inline int delayacct_add_tsk(struct taskstats *d, |
@@ -116,6 +127,8 @@ static inline int delayacct_add_tsk(struct taskstats *d, | |||
116 | { return 0; } | 127 | { return 0; } |
117 | static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) | 128 | static inline __u64 delayacct_blkio_ticks(struct task_struct *tsk) |
118 | { return 0; } | 129 | { return 0; } |
130 | static inline int delayacct_is_task_waiting_on_io(struct task_struct *p) | ||
131 | { return 0; } | ||
119 | #endif /* CONFIG_TASK_DELAY_ACCT */ | 132 | #endif /* CONFIG_TASK_DELAY_ACCT */ |
120 | 133 | ||
121 | #endif | 134 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 6a4d170ad9a5..1657e995f72c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -123,6 +123,7 @@ extern int dir_notify_enable; | |||
123 | #define MS_SLAVE (1<<19) /* change to slave */ | 123 | #define MS_SLAVE (1<<19) /* change to slave */ |
124 | #define MS_SHARED (1<<20) /* change to shared */ | 124 | #define MS_SHARED (1<<20) /* change to shared */ |
125 | #define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */ | 125 | #define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */ |
126 | #define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ | ||
126 | #define MS_ACTIVE (1<<30) | 127 | #define MS_ACTIVE (1<<30) |
127 | #define MS_NOUSER (1<<31) | 128 | #define MS_NOUSER (1<<31) |
128 | 129 | ||
@@ -1459,7 +1460,8 @@ void unnamed_dev_init(void); | |||
1459 | 1460 | ||
1460 | extern int register_filesystem(struct file_system_type *); | 1461 | extern int register_filesystem(struct file_system_type *); |
1461 | extern int unregister_filesystem(struct file_system_type *); | 1462 | extern int unregister_filesystem(struct file_system_type *); |
1462 | extern struct vfsmount *kern_mount(struct file_system_type *); | 1463 | extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); |
1464 | #define kern_mount(type) kern_mount_data(type, NULL) | ||
1463 | extern int may_umount_tree(struct vfsmount *); | 1465 | extern int may_umount_tree(struct vfsmount *); |
1464 | extern int may_umount(struct vfsmount *); | 1466 | extern int may_umount(struct vfsmount *); |
1465 | extern void umount_tree(struct vfsmount *, int, struct list_head *); | 1467 | extern void umount_tree(struct vfsmount *, int, struct list_head *); |
@@ -1922,6 +1924,8 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
1922 | 1924 | ||
1923 | extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); | 1925 | extern int vfs_ioctl(struct file *, unsigned int, unsigned int, unsigned long); |
1924 | 1926 | ||
1927 | extern void get_filesystem(struct file_system_type *fs); | ||
1928 | extern void put_filesystem(struct file_system_type *fs); | ||
1925 | extern struct file_system_type *get_fs_type(const char *name); | 1929 | extern struct file_system_type *get_fs_type(const char *name); |
1926 | extern struct super_block *get_super(struct block_device *); | 1930 | extern struct super_block *get_super(struct block_device *); |
1927 | extern struct super_block *user_get_super(dev_t); | 1931 | extern struct super_block *user_get_super(dev_t); |
diff --git a/include/linux/hid.h b/include/linux/hid.h index edb8024d744b..6e35b92b1d2c 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -469,8 +469,8 @@ struct hid_device { /* device report descriptor */ | |||
469 | /* handler for raw output data, used by hidraw */ | 469 | /* handler for raw output data, used by hidraw */ |
470 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); | 470 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); |
471 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK | 471 | #ifdef CONFIG_USB_HIDINPUT_POWERBOOK |
472 | unsigned long pb_pressed_fn[NBITS(KEY_MAX)]; | 472 | unsigned long pb_pressed_fn[BITS_TO_LONGS(KEY_CNT)]; |
473 | unsigned long pb_pressed_numlock[NBITS(KEY_MAX)]; | 473 | unsigned long pb_pressed_numlock[BITS_TO_LONGS(KEY_CNT)]; |
474 | #endif | 474 | #endif |
475 | }; | 475 | }; |
476 | 476 | ||
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index d4b2f1c76e12..cae35b6b9aec 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -67,9 +67,6 @@ | |||
67 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ | 67 | .posix_timers = LIST_HEAD_INIT(sig.posix_timers), \ |
68 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ | 68 | .cpu_timers = INIT_CPU_TIMERS(sig.cpu_timers), \ |
69 | .rlim = INIT_RLIMITS, \ | 69 | .rlim = INIT_RLIMITS, \ |
70 | .pgrp = 0, \ | ||
71 | .tty_old_pgrp = NULL, \ | ||
72 | { .__session = 0}, \ | ||
73 | } | 70 | } |
74 | 71 | ||
75 | extern struct nsproxy init_nsproxy; | 72 | extern struct nsproxy init_nsproxy; |
@@ -94,15 +91,18 @@ extern struct group_info init_groups; | |||
94 | 91 | ||
95 | #define INIT_STRUCT_PID { \ | 92 | #define INIT_STRUCT_PID { \ |
96 | .count = ATOMIC_INIT(1), \ | 93 | .count = ATOMIC_INIT(1), \ |
97 | .nr = 0, \ | ||
98 | /* Don't put this struct pid in pid_hash */ \ | ||
99 | .pid_chain = { .next = NULL, .pprev = NULL }, \ | ||
100 | .tasks = { \ | 94 | .tasks = { \ |
101 | { .first = &init_task.pids[PIDTYPE_PID].node }, \ | 95 | { .first = &init_task.pids[PIDTYPE_PID].node }, \ |
102 | { .first = &init_task.pids[PIDTYPE_PGID].node }, \ | 96 | { .first = &init_task.pids[PIDTYPE_PGID].node }, \ |
103 | { .first = &init_task.pids[PIDTYPE_SID].node }, \ | 97 | { .first = &init_task.pids[PIDTYPE_SID].node }, \ |
104 | }, \ | 98 | }, \ |
105 | .rcu = RCU_HEAD_INIT, \ | 99 | .rcu = RCU_HEAD_INIT, \ |
100 | .level = 0, \ | ||
101 | .numbers = { { \ | ||
102 | .nr = 0, \ | ||
103 | .ns = &init_pid_ns, \ | ||
104 | .pid_chain = { .next = NULL, .pprev = NULL }, \ | ||
105 | }, } \ | ||
106 | } | 106 | } |
107 | 107 | ||
108 | #define INIT_PID_LINK(type) \ | 108 | #define INIT_PID_LINK(type) \ |
diff --git a/include/linux/input.h b/include/linux/input.h index f30da6fc08e3..62268929856c 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -98,6 +98,7 @@ struct input_absinfo { | |||
98 | #define EV_PWR 0x16 | 98 | #define EV_PWR 0x16 |
99 | #define EV_FF_STATUS 0x17 | 99 | #define EV_FF_STATUS 0x17 |
100 | #define EV_MAX 0x1f | 100 | #define EV_MAX 0x1f |
101 | #define EV_CNT (EV_MAX+1) | ||
101 | 102 | ||
102 | /* | 103 | /* |
103 | * Synchronization events. | 104 | * Synchronization events. |
@@ -567,6 +568,7 @@ struct input_absinfo { | |||
567 | /* We avoid low common keys in module aliases so they don't get huge. */ | 568 | /* We avoid low common keys in module aliases so they don't get huge. */ |
568 | #define KEY_MIN_INTERESTING KEY_MUTE | 569 | #define KEY_MIN_INTERESTING KEY_MUTE |
569 | #define KEY_MAX 0x1ff | 570 | #define KEY_MAX 0x1ff |
571 | #define KEY_CNT (KEY_MAX+1) | ||
570 | 572 | ||
571 | /* | 573 | /* |
572 | * Relative axes | 574 | * Relative axes |
@@ -583,6 +585,7 @@ struct input_absinfo { | |||
583 | #define REL_WHEEL 0x08 | 585 | #define REL_WHEEL 0x08 |
584 | #define REL_MISC 0x09 | 586 | #define REL_MISC 0x09 |
585 | #define REL_MAX 0x0f | 587 | #define REL_MAX 0x0f |
588 | #define REL_CNT (REL_MAX+1) | ||
586 | 589 | ||
587 | /* | 590 | /* |
588 | * Absolute axes | 591 | * Absolute axes |
@@ -615,6 +618,7 @@ struct input_absinfo { | |||
615 | #define ABS_VOLUME 0x20 | 618 | #define ABS_VOLUME 0x20 |
616 | #define ABS_MISC 0x28 | 619 | #define ABS_MISC 0x28 |
617 | #define ABS_MAX 0x3f | 620 | #define ABS_MAX 0x3f |
621 | #define ABS_CNT (ABS_MAX+1) | ||
618 | 622 | ||
619 | /* | 623 | /* |
620 | * Switch events | 624 | * Switch events |
@@ -625,6 +629,7 @@ struct input_absinfo { | |||
625 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ | 629 | #define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ |
626 | #define SW_RADIO 0x03 /* set = radio enabled */ | 630 | #define SW_RADIO 0x03 /* set = radio enabled */ |
627 | #define SW_MAX 0x0f | 631 | #define SW_MAX 0x0f |
632 | #define SW_CNT (SW_MAX+1) | ||
628 | 633 | ||
629 | /* | 634 | /* |
630 | * Misc events | 635 | * Misc events |
@@ -636,6 +641,7 @@ struct input_absinfo { | |||
636 | #define MSC_RAW 0x03 | 641 | #define MSC_RAW 0x03 |
637 | #define MSC_SCAN 0x04 | 642 | #define MSC_SCAN 0x04 |
638 | #define MSC_MAX 0x07 | 643 | #define MSC_MAX 0x07 |
644 | #define MSC_CNT (MSC_MAX+1) | ||
639 | 645 | ||
640 | /* | 646 | /* |
641 | * LEDs | 647 | * LEDs |
@@ -653,6 +659,7 @@ struct input_absinfo { | |||
653 | #define LED_MAIL 0x09 | 659 | #define LED_MAIL 0x09 |
654 | #define LED_CHARGING 0x0a | 660 | #define LED_CHARGING 0x0a |
655 | #define LED_MAX 0x0f | 661 | #define LED_MAX 0x0f |
662 | #define LED_CNT (LED_MAX+1) | ||
656 | 663 | ||
657 | /* | 664 | /* |
658 | * Autorepeat values | 665 | * Autorepeat values |
@@ -670,6 +677,7 @@ struct input_absinfo { | |||
670 | #define SND_BELL 0x01 | 677 | #define SND_BELL 0x01 |
671 | #define SND_TONE 0x02 | 678 | #define SND_TONE 0x02 |
672 | #define SND_MAX 0x07 | 679 | #define SND_MAX 0x07 |
680 | #define SND_CNT (SND_MAX+1) | ||
673 | 681 | ||
674 | /* | 682 | /* |
675 | * IDs. | 683 | * IDs. |
@@ -920,6 +928,7 @@ struct ff_effect { | |||
920 | #define FF_AUTOCENTER 0x61 | 928 | #define FF_AUTOCENTER 0x61 |
921 | 929 | ||
922 | #define FF_MAX 0x7f | 930 | #define FF_MAX 0x7f |
931 | #define FF_CNT (FF_MAX+1) | ||
923 | 932 | ||
924 | #ifdef __KERNEL__ | 933 | #ifdef __KERNEL__ |
925 | 934 | ||
@@ -932,10 +941,6 @@ struct ff_effect { | |||
932 | #include <linux/timer.h> | 941 | #include <linux/timer.h> |
933 | #include <linux/mod_devicetable.h> | 942 | #include <linux/mod_devicetable.h> |
934 | 943 | ||
935 | #define NBITS(x) (((x)/BITS_PER_LONG)+1) | ||
936 | #define BIT(x) (1UL<<((x)%BITS_PER_LONG)) | ||
937 | #define LONG(x) ((x)/BITS_PER_LONG) | ||
938 | |||
939 | /** | 944 | /** |
940 | * struct input_dev - represents an input device | 945 | * struct input_dev - represents an input device |
941 | * @name: name of the device | 946 | * @name: name of the device |
@@ -1005,28 +1010,30 @@ struct ff_effect { | |||
1005 | * @going_away: marks devices that are in a middle of unregistering and | 1010 | * @going_away: marks devices that are in a middle of unregistering and |
1006 | * causes input_open_device*() fail with -ENODEV. | 1011 | * causes input_open_device*() fail with -ENODEV. |
1007 | * @dev: driver model's view of this device | 1012 | * @dev: driver model's view of this device |
1013 | * @cdev: union for struct device pointer | ||
1008 | * @h_list: list of input handles associated with the device. When | 1014 | * @h_list: list of input handles associated with the device. When |
1009 | * accessing the list dev->mutex must be held | 1015 | * accessing the list dev->mutex must be held |
1010 | * @node: used to place the device onto input_dev_list | 1016 | * @node: used to place the device onto input_dev_list |
1011 | */ | 1017 | */ |
1012 | struct input_dev { | 1018 | struct input_dev { |
1013 | 1019 | /* private: */ | |
1014 | void *private; /* do not use */ | 1020 | void *private; /* do not use */ |
1021 | /* public: */ | ||
1015 | 1022 | ||
1016 | const char *name; | 1023 | const char *name; |
1017 | const char *phys; | 1024 | const char *phys; |
1018 | const char *uniq; | 1025 | const char *uniq; |
1019 | struct input_id id; | 1026 | struct input_id id; |
1020 | 1027 | ||
1021 | unsigned long evbit[NBITS(EV_MAX)]; | 1028 | unsigned long evbit[BITS_TO_LONGS(EV_CNT)]; |
1022 | unsigned long keybit[NBITS(KEY_MAX)]; | 1029 | unsigned long keybit[BITS_TO_LONGS(KEY_CNT)]; |
1023 | unsigned long relbit[NBITS(REL_MAX)]; | 1030 | unsigned long relbit[BITS_TO_LONGS(REL_CNT)]; |
1024 | unsigned long absbit[NBITS(ABS_MAX)]; | 1031 | unsigned long absbit[BITS_TO_LONGS(ABS_CNT)]; |
1025 | unsigned long mscbit[NBITS(MSC_MAX)]; | 1032 | unsigned long mscbit[BITS_TO_LONGS(MSC_CNT)]; |
1026 | unsigned long ledbit[NBITS(LED_MAX)]; | 1033 | unsigned long ledbit[BITS_TO_LONGS(LED_CNT)]; |
1027 | unsigned long sndbit[NBITS(SND_MAX)]; | 1034 | unsigned long sndbit[BITS_TO_LONGS(SND_CNT)]; |
1028 | unsigned long ffbit[NBITS(FF_MAX)]; | 1035 | unsigned long ffbit[BITS_TO_LONGS(FF_CNT)]; |
1029 | unsigned long swbit[NBITS(SW_MAX)]; | 1036 | unsigned long swbit[BITS_TO_LONGS(SW_CNT)]; |
1030 | 1037 | ||
1031 | unsigned int keycodemax; | 1038 | unsigned int keycodemax; |
1032 | unsigned int keycodesize; | 1039 | unsigned int keycodesize; |
@@ -1044,10 +1051,10 @@ struct input_dev { | |||
1044 | int abs[ABS_MAX + 1]; | 1051 | int abs[ABS_MAX + 1]; |
1045 | int rep[REP_MAX + 1]; | 1052 | int rep[REP_MAX + 1]; |
1046 | 1053 | ||
1047 | unsigned long key[NBITS(KEY_MAX)]; | 1054 | unsigned long key[BITS_TO_LONGS(KEY_CNT)]; |
1048 | unsigned long led[NBITS(LED_MAX)]; | 1055 | unsigned long led[BITS_TO_LONGS(LED_CNT)]; |
1049 | unsigned long snd[NBITS(SND_MAX)]; | 1056 | unsigned long snd[BITS_TO_LONGS(SND_CNT)]; |
1050 | unsigned long sw[NBITS(SW_MAX)]; | 1057 | unsigned long sw[BITS_TO_LONGS(SW_CNT)]; |
1051 | 1058 | ||
1052 | int absmax[ABS_MAX + 1]; | 1059 | int absmax[ABS_MAX + 1]; |
1053 | int absmin[ABS_MAX + 1]; | 1060 | int absmin[ABS_MAX + 1]; |
@@ -1291,7 +1298,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1291 | dev->absfuzz[axis] = fuzz; | 1298 | dev->absfuzz[axis] = fuzz; |
1292 | dev->absflat[axis] = flat; | 1299 | dev->absflat[axis] = flat; |
1293 | 1300 | ||
1294 | dev->absbit[LONG(axis)] |= BIT(axis); | 1301 | dev->absbit[BIT_WORD(axis)] |= BIT_MASK(axis); |
1295 | } | 1302 | } |
1296 | 1303 | ||
1297 | extern struct class input_class; | 1304 | extern struct class input_class; |
@@ -1332,7 +1339,7 @@ struct ff_device { | |||
1332 | 1339 | ||
1333 | void *private; | 1340 | void *private; |
1334 | 1341 | ||
1335 | unsigned long ffbit[NBITS(FF_MAX)]; | 1342 | unsigned long ffbit[BITS_TO_LONGS(FF_CNT)]; |
1336 | 1343 | ||
1337 | struct mutex mutex; | 1344 | struct mutex mutex; |
1338 | 1345 | ||
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index ee111834091c..408696ea5189 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
@@ -89,6 +89,7 @@ struct kern_ipc_perm | |||
89 | { | 89 | { |
90 | spinlock_t lock; | 90 | spinlock_t lock; |
91 | int deleted; | 91 | int deleted; |
92 | int id; | ||
92 | key_t key; | 93 | key_t key; |
93 | uid_t uid; | 94 | uid_t uid; |
94 | gid_t gid; | 95 | gid_t gid; |
@@ -110,6 +111,8 @@ struct ipc_namespace { | |||
110 | int msg_ctlmax; | 111 | int msg_ctlmax; |
111 | int msg_ctlmnb; | 112 | int msg_ctlmnb; |
112 | int msg_ctlmni; | 113 | int msg_ctlmni; |
114 | atomic_t msg_bytes; | ||
115 | atomic_t msg_hdrs; | ||
113 | 116 | ||
114 | size_t shm_ctlmax; | 117 | size_t shm_ctlmax; |
115 | size_t shm_ctlall; | 118 | size_t shm_ctlall; |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index a3abf51e488f..16e7ed855a18 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -58,7 +58,7 @@ | |||
58 | * CONFIG_JBD_DEBUG is on. | 58 | * CONFIG_JBD_DEBUG is on. |
59 | */ | 59 | */ |
60 | #define JBD_EXPENSIVE_CHECKING | 60 | #define JBD_EXPENSIVE_CHECKING |
61 | extern int journal_enable_debug; | 61 | extern u8 journal_enable_debug; |
62 | 62 | ||
63 | #define jbd_debug(n, f, a...) \ | 63 | #define jbd_debug(n, f, a...) \ |
64 | do { \ | 64 | do { \ |
@@ -248,17 +248,7 @@ typedef struct journal_superblock_s | |||
248 | #include <linux/fs.h> | 248 | #include <linux/fs.h> |
249 | #include <linux/sched.h> | 249 | #include <linux/sched.h> |
250 | 250 | ||
251 | #define JBD_ASSERTIONS | 251 | #define J_ASSERT(assert) BUG_ON(!(assert)) |
252 | #ifdef JBD_ASSERTIONS | ||
253 | #define J_ASSERT(assert) \ | ||
254 | do { \ | ||
255 | if (!(assert)) { \ | ||
256 | printk (KERN_EMERG \ | ||
257 | "Assertion failure in %s() at %s:%d: \"%s\"\n", \ | ||
258 | __FUNCTION__, __FILE__, __LINE__, # assert); \ | ||
259 | BUG(); \ | ||
260 | } \ | ||
261 | } while (0) | ||
262 | 252 | ||
263 | #if defined(CONFIG_BUFFER_DEBUG) | 253 | #if defined(CONFIG_BUFFER_DEBUG) |
264 | void buffer_assertion_failure(struct buffer_head *bh); | 254 | void buffer_assertion_failure(struct buffer_head *bh); |
@@ -274,10 +264,6 @@ void buffer_assertion_failure(struct buffer_head *bh); | |||
274 | #define J_ASSERT_JH(jh, expr) J_ASSERT(expr) | 264 | #define J_ASSERT_JH(jh, expr) J_ASSERT(expr) |
275 | #endif | 265 | #endif |
276 | 266 | ||
277 | #else | ||
278 | #define J_ASSERT(assert) do { } while (0) | ||
279 | #endif /* JBD_ASSERTIONS */ | ||
280 | |||
281 | #if defined(JBD_PARANOID_IOFAIL) | 267 | #if defined(JBD_PARANOID_IOFAIL) |
282 | #define J_EXPECT(expr, why...) J_ASSERT(expr) | 268 | #define J_EXPECT(expr, why...) J_ASSERT(expr) |
283 | #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) | 269 | #define J_EXPECT_BH(bh, expr, why...) J_ASSERT_BH(bh, expr) |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index ad4b82ce84af..2d9c448d8c52 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -187,6 +187,8 @@ extern u32 vmcoreinfo_note[VMCOREINFO_NOTE_SIZE/4]; | |||
187 | extern size_t vmcoreinfo_size; | 187 | extern size_t vmcoreinfo_size; |
188 | extern size_t vmcoreinfo_max_size; | 188 | extern size_t vmcoreinfo_max_size; |
189 | 189 | ||
190 | int __init parse_crashkernel(char *cmdline, unsigned long long system_ram, | ||
191 | unsigned long long *crash_size, unsigned long long *crash_base); | ||
190 | 192 | ||
191 | #else /* !CONFIG_KEXEC */ | 193 | #else /* !CONFIG_KEXEC */ |
192 | struct pt_regs; | 194 | struct pt_regs; |
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h index 33b5c2e325b9..65c2d70853e9 100644 --- a/include/linux/keyboard.h +++ b/include/linux/keyboard.h | |||
@@ -23,10 +23,21 @@ | |||
23 | #define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */ | 23 | #define MAX_NR_OF_USER_KEYMAPS 256 /* should be at least 7 */ |
24 | 24 | ||
25 | #ifdef __KERNEL__ | 25 | #ifdef __KERNEL__ |
26 | struct notifier_block; | ||
26 | extern const int NR_TYPES; | 27 | extern const int NR_TYPES; |
27 | extern const int max_vals[]; | 28 | extern const int max_vals[]; |
28 | extern unsigned short *key_maps[MAX_NR_KEYMAPS]; | 29 | extern unsigned short *key_maps[MAX_NR_KEYMAPS]; |
29 | extern unsigned short plain_map[NR_KEYS]; | 30 | extern unsigned short plain_map[NR_KEYS]; |
31 | |||
32 | struct keyboard_notifier_param { | ||
33 | struct vc_data *vc; /* VC on which the keyboard press was done */ | ||
34 | int down; /* Pressure of the key? */ | ||
35 | int shift; /* Current shift mask */ | ||
36 | unsigned int value; /* keycode, unicode value or keysym */ | ||
37 | }; | ||
38 | |||
39 | extern int register_keyboard_notifier(struct notifier_block *nb); | ||
40 | extern int unregister_keyboard_notifier(struct notifier_block *nb); | ||
30 | #endif | 41 | #endif |
31 | 42 | ||
32 | #define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */ | 43 | #define MAX_NR_FUNC 256 /* max nr of strings assigned to keys */ |
diff --git a/include/linux/list.h b/include/linux/list.h index b0cf0135fe3e..75ce2cb4ff6e 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -478,8 +478,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
478 | pos = n, n = pos->next) | 478 | pos = n, n = pos->next) |
479 | 479 | ||
480 | /** | 480 | /** |
481 | * list_for_each_prev_safe - iterate over a list backwards safe against removal | 481 | * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry |
482 | of list entry | ||
483 | * @pos: the &struct list_head to use as a loop cursor. | 482 | * @pos: the &struct list_head to use as a loop cursor. |
484 | * @n: another &struct list_head to use as temporary storage | 483 | * @n: another &struct list_head to use as temporary storage |
485 | * @head: the head for your list. | 484 | * @head: the head for your list. |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index f6279f68a827..4c4d236ded18 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -276,6 +276,14 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
276 | (lock)->dep_map.key, sub) | 276 | (lock)->dep_map.key, sub) |
277 | 277 | ||
278 | /* | 278 | /* |
279 | * To initialize a lockdep_map statically use this macro. | ||
280 | * Note that _name must not be NULL. | ||
281 | */ | ||
282 | #define STATIC_LOCKDEP_MAP_INIT(_name, _key) \ | ||
283 | { .name = (_name), .key = (void *)(_key), } | ||
284 | |||
285 | |||
286 | /* | ||
279 | * Acquire a lock. | 287 | * Acquire a lock. |
280 | * | 288 | * |
281 | * Values for "read": | 289 | * Values for "read": |
diff --git a/include/linux/magic.h b/include/linux/magic.h index 722d4755060f..1fa0c2ce4dec 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -37,6 +37,7 @@ | |||
37 | 37 | ||
38 | #define SMB_SUPER_MAGIC 0x517B | 38 | #define SMB_SUPER_MAGIC 0x517B |
39 | #define USBDEVICE_SUPER_MAGIC 0x9fa2 | 39 | #define USBDEVICE_SUPER_MAGIC 0x9fa2 |
40 | #define CGROUP_SUPER_MAGIC 0x27e0eb | ||
40 | 41 | ||
41 | #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA | 42 | #define FUTEXFS_SUPER_MAGIC 0xBAD1DEA |
42 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA | 43 | #define INOTIFYFS_SUPER_MAGIC 0x2BAD1DEA |
diff --git a/include/linux/marker.h b/include/linux/marker.h new file mode 100644 index 000000000000..5f36cf946bcb --- /dev/null +++ b/include/linux/marker.h | |||
@@ -0,0 +1,129 @@ | |||
1 | #ifndef _LINUX_MARKER_H | ||
2 | #define _LINUX_MARKER_H | ||
3 | |||
4 | /* | ||
5 | * Code markup for dynamic and static tracing. | ||
6 | * | ||
7 | * See Documentation/marker.txt. | ||
8 | * | ||
9 | * (C) Copyright 2006 Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | ||
10 | * | ||
11 | * This file is released under the GPLv2. | ||
12 | * See the file COPYING for more details. | ||
13 | */ | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | |||
17 | struct module; | ||
18 | struct marker; | ||
19 | |||
20 | /** | ||
21 | * marker_probe_func - Type of a marker probe function | ||
22 | * @mdata: pointer of type struct marker | ||
23 | * @private_data: caller site private data | ||
24 | * @fmt: format string | ||
25 | * @...: variable argument list | ||
26 | * | ||
27 | * Type of marker probe functions. They receive the mdata and need to parse the | ||
28 | * format string to recover the variable argument list. | ||
29 | */ | ||
30 | typedef void marker_probe_func(const struct marker *mdata, | ||
31 | void *private_data, const char *fmt, ...); | ||
32 | |||
33 | struct marker { | ||
34 | const char *name; /* Marker name */ | ||
35 | const char *format; /* Marker format string, describing the | ||
36 | * variable argument list. | ||
37 | */ | ||
38 | char state; /* Marker state. */ | ||
39 | marker_probe_func *call;/* Probe handler function pointer */ | ||
40 | void *private; /* Private probe data */ | ||
41 | } __attribute__((aligned(8))); | ||
42 | |||
43 | #ifdef CONFIG_MARKERS | ||
44 | |||
45 | /* | ||
46 | * Note : the empty asm volatile with read constraint is used here instead of a | ||
47 | * "used" attribute to fix a gcc 4.1.x bug. | ||
48 | * Make sure the alignment of the structure in the __markers section will | ||
49 | * not add unwanted padding between the beginning of the section and the | ||
50 | * structure. Force alignment to the same alignment as the section start. | ||
51 | */ | ||
52 | #define __trace_mark(name, call_data, format, args...) \ | ||
53 | do { \ | ||
54 | static const char __mstrtab_name_##name[] \ | ||
55 | __attribute__((section("__markers_strings"))) \ | ||
56 | = #name; \ | ||
57 | static const char __mstrtab_format_##name[] \ | ||
58 | __attribute__((section("__markers_strings"))) \ | ||
59 | = format; \ | ||
60 | static struct marker __mark_##name \ | ||
61 | __attribute__((section("__markers"), aligned(8))) = \ | ||
62 | { __mstrtab_name_##name, __mstrtab_format_##name, \ | ||
63 | 0, __mark_empty_function, NULL }; \ | ||
64 | __mark_check_format(format, ## args); \ | ||
65 | if (unlikely(__mark_##name.state)) { \ | ||
66 | preempt_disable(); \ | ||
67 | (*__mark_##name.call) \ | ||
68 | (&__mark_##name, call_data, \ | ||
69 | format, ## args); \ | ||
70 | preempt_enable(); \ | ||
71 | } \ | ||
72 | } while (0) | ||
73 | |||
74 | extern void marker_update_probe_range(struct marker *begin, | ||
75 | struct marker *end, struct module *probe_module, int *refcount); | ||
76 | #else /* !CONFIG_MARKERS */ | ||
77 | #define __trace_mark(name, call_data, format, args...) \ | ||
78 | __mark_check_format(format, ## args) | ||
79 | static inline void marker_update_probe_range(struct marker *begin, | ||
80 | struct marker *end, struct module *probe_module, int *refcount) | ||
81 | { } | ||
82 | #endif /* CONFIG_MARKERS */ | ||
83 | |||
84 | /** | ||
85 | * trace_mark - Marker | ||
86 | * @name: marker name, not quoted. | ||
87 | * @format: format string | ||
88 | * @args...: variable argument list | ||
89 | * | ||
90 | * Places a marker. | ||
91 | */ | ||
92 | #define trace_mark(name, format, args...) \ | ||
93 | __trace_mark(name, NULL, format, ## args) | ||
94 | |||
95 | #define MARK_MAX_FORMAT_LEN 1024 | ||
96 | |||
97 | /** | ||
98 | * MARK_NOARGS - Format string for a marker with no argument. | ||
99 | */ | ||
100 | #define MARK_NOARGS " " | ||
101 | |||
102 | /* To be used for string format validity checking with gcc */ | ||
103 | static inline void __printf(1, 2) __mark_check_format(const char *fmt, ...) | ||
104 | { | ||
105 | } | ||
106 | |||
107 | extern marker_probe_func __mark_empty_function; | ||
108 | |||
109 | /* | ||
110 | * Connect a probe to a marker. | ||
111 | * private data pointer must be a valid allocated memory address, or NULL. | ||
112 | */ | ||
113 | extern int marker_probe_register(const char *name, const char *format, | ||
114 | marker_probe_func *probe, void *private); | ||
115 | |||
116 | /* | ||
117 | * Returns the private data given to marker_probe_register. | ||
118 | */ | ||
119 | extern void *marker_probe_unregister(const char *name); | ||
120 | /* | ||
121 | * Unregister a marker by providing the registered private data. | ||
122 | */ | ||
123 | extern void *marker_probe_unregister_private_data(void *private); | ||
124 | |||
125 | extern int marker_arm(const char *name); | ||
126 | extern int marker_disarm(const char *name); | ||
127 | extern void *marker_get_private_data(const char *name); | ||
128 | |||
129 | #endif | ||
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 38c04d61ee06..59c4865bc85f 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -148,14 +148,6 @@ extern void mpol_rebind_task(struct task_struct *tsk, | |||
148 | const nodemask_t *new); | 148 | const nodemask_t *new); |
149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); | 149 | extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); |
150 | extern void mpol_fix_fork_child_flag(struct task_struct *p); | 150 | extern void mpol_fix_fork_child_flag(struct task_struct *p); |
151 | #define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) | ||
152 | |||
153 | #ifdef CONFIG_CPUSETS | ||
154 | #define current_cpuset_is_being_rebound() \ | ||
155 | (cpuset_being_rebound == current->cpuset) | ||
156 | #else | ||
157 | #define current_cpuset_is_being_rebound() 0 | ||
158 | #endif | ||
159 | 151 | ||
160 | extern struct mempolicy default_policy; | 152 | extern struct mempolicy default_policy; |
161 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 153 | extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
@@ -173,8 +165,6 @@ static inline void check_highest_zone(enum zone_type k) | |||
173 | int do_migrate_pages(struct mm_struct *mm, | 165 | int do_migrate_pages(struct mm_struct *mm, |
174 | const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags); | 166 | const nodemask_t *from_nodes, const nodemask_t *to_nodes, int flags); |
175 | 167 | ||
176 | extern void *cpuset_being_rebound; /* Trigger mpol_copy vma rebind */ | ||
177 | |||
178 | #else | 168 | #else |
179 | 169 | ||
180 | struct mempolicy {}; | 170 | struct mempolicy {}; |
@@ -248,8 +238,6 @@ static inline void mpol_fix_fork_child_flag(struct task_struct *p) | |||
248 | { | 238 | { |
249 | } | 239 | } |
250 | 240 | ||
251 | #define set_cpuset_being_rebound(x) do {} while (0) | ||
252 | |||
253 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, | 241 | static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, |
254 | unsigned long addr, gfp_t gfp_flags, struct mempolicy **mpol) | 242 | unsigned long addr, gfp_t gfp_flags, struct mempolicy **mpol) |
255 | { | 243 | { |
diff --git a/include/linux/module.h b/include/linux/module.h index 642f325e4917..2cbc0b87e329 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/stringify.h> | 15 | #include <linux/stringify.h> |
16 | #include <linux/kobject.h> | 16 | #include <linux/kobject.h> |
17 | #include <linux/moduleparam.h> | 17 | #include <linux/moduleparam.h> |
18 | #include <linux/marker.h> | ||
18 | #include <asm/local.h> | 19 | #include <asm/local.h> |
19 | 20 | ||
20 | #include <asm/module.h> | 21 | #include <asm/module.h> |
@@ -354,6 +355,10 @@ struct module | |||
354 | /* The command line arguments (may be mangled). People like | 355 | /* The command line arguments (may be mangled). People like |
355 | keeping pointers to this stuff */ | 356 | keeping pointers to this stuff */ |
356 | char *args; | 357 | char *args; |
358 | #ifdef CONFIG_MARKERS | ||
359 | struct marker *markers; | ||
360 | unsigned int num_markers; | ||
361 | #endif | ||
357 | }; | 362 | }; |
358 | #ifndef MODULE_ARCH_INIT | 363 | #ifndef MODULE_ARCH_INIT |
359 | #define MODULE_ARCH_INIT {} | 364 | #define MODULE_ARCH_INIT {} |
@@ -457,6 +462,8 @@ int unregister_module_notifier(struct notifier_block * nb); | |||
457 | 462 | ||
458 | extern void print_modules(void); | 463 | extern void print_modules(void); |
459 | 464 | ||
465 | extern void module_update_markers(struct module *probe_module, int *refcount); | ||
466 | |||
460 | #else /* !CONFIG_MODULES... */ | 467 | #else /* !CONFIG_MODULES... */ |
461 | #define EXPORT_SYMBOL(sym) | 468 | #define EXPORT_SYMBOL(sym) |
462 | #define EXPORT_SYMBOL_GPL(sym) | 469 | #define EXPORT_SYMBOL_GPL(sym) |
@@ -556,6 +563,11 @@ static inline void print_modules(void) | |||
556 | { | 563 | { |
557 | } | 564 | } |
558 | 565 | ||
566 | static inline void module_update_markers(struct module *probe_module, | ||
567 | int *refcount) | ||
568 | { | ||
569 | } | ||
570 | |||
559 | #endif /* CONFIG_MODULES */ | 571 | #endif /* CONFIG_MODULES */ |
560 | 572 | ||
561 | struct device_driver; | 573 | struct device_driver; |
diff --git a/include/linux/msg.h b/include/linux/msg.h index f1b60740d641..10a3d5a1abff 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h | |||
@@ -77,7 +77,6 @@ struct msg_msg { | |||
77 | /* one msq_queue structure for each present queue on the system */ | 77 | /* one msq_queue structure for each present queue on the system */ |
78 | struct msg_queue { | 78 | struct msg_queue { |
79 | struct kern_ipc_perm q_perm; | 79 | struct kern_ipc_perm q_perm; |
80 | int q_id; | ||
81 | time_t q_stime; /* last msgsnd time */ | 80 | time_t q_stime; /* last msgsnd time */ |
82 | time_t q_rtime; /* last msgrcv time */ | 81 | time_t q_rtime; /* last msgrcv time */ |
83 | time_t q_ctime; /* last change time */ | 82 | time_t q_ctime; /* last change time */ |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index c5164c257f71..e82a6ebc725d 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -160,6 +160,12 @@ struct nfs_inode { | |||
160 | /* Open contexts for shared mmap writes */ | 160 | /* Open contexts for shared mmap writes */ |
161 | struct list_head open_files; | 161 | struct list_head open_files; |
162 | 162 | ||
163 | /* Number of in-flight sillydelete RPC calls */ | ||
164 | atomic_t silly_count; | ||
165 | /* List of deferred sillydelete requests */ | ||
166 | struct hlist_head silly_list; | ||
167 | wait_queue_head_t waitqueue; | ||
168 | |||
163 | #ifdef CONFIG_NFS_V4 | 169 | #ifdef CONFIG_NFS_V4 |
164 | struct nfs4_cached_acl *nfs4_acl; | 170 | struct nfs4_cached_acl *nfs4_acl; |
165 | /* NFSv4 state */ | 171 | /* NFSv4 state */ |
@@ -394,6 +400,8 @@ extern void nfs_release_automount_timer(void); | |||
394 | */ | 400 | */ |
395 | extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry); | 401 | extern int nfs_async_unlink(struct inode *dir, struct dentry *dentry); |
396 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); | 402 | extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); |
403 | extern void nfs_block_sillyrename(struct dentry *dentry); | ||
404 | extern void nfs_unblock_sillyrename(struct dentry *dentry); | ||
397 | 405 | ||
398 | /* | 406 | /* |
399 | * linux/fs/nfs/write.c | 407 | * linux/fs/nfs/write.c |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index fad7ff17e468..0c40cc0b4a36 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -231,5 +231,22 @@ static inline int notifier_to_errno(int ret) | |||
231 | #define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */ | 231 | #define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */ |
232 | #define PM_POST_SUSPEND 0x0004 /* Suspend finished */ | 232 | #define PM_POST_SUSPEND 0x0004 /* Suspend finished */ |
233 | 233 | ||
234 | /* Console keyboard events. | ||
235 | * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and | ||
236 | * KBD_KEYSYM. */ | ||
237 | #define KBD_KEYCODE 0x0001 /* Keyboard keycode, called before any other */ | ||
238 | #define KBD_UNBOUND_KEYCODE 0x0002 /* Keyboard keycode which is not bound to any other */ | ||
239 | #define KBD_UNICODE 0x0003 /* Keyboard unicode */ | ||
240 | #define KBD_KEYSYM 0x0004 /* Keyboard keysym */ | ||
241 | #define KBD_POST_KEYSYM 0x0005 /* Called after keyboard keysym interpretation */ | ||
242 | |||
243 | extern struct blocking_notifier_head reboot_notifier_list; | ||
244 | |||
245 | /* Virtual Terminal events. */ | ||
246 | #define VT_ALLOCATE 0x0001 /* Console got allocated */ | ||
247 | #define VT_DEALLOCATE 0x0002 /* Console will be deallocated */ | ||
248 | #define VT_WRITE 0x0003 /* A char got output */ | ||
249 | #define VT_UPDATE 0x0004 /* A bigger update occurred */ | ||
250 | |||
234 | #endif /* __KERNEL__ */ | 251 | #endif /* __KERNEL__ */ |
235 | #endif /* _LINUX_NOTIFIER_H */ | 252 | #endif /* _LINUX_NOTIFIER_H */ |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h index 033a648709b6..0e66b57631fc 100644 --- a/include/linux/nsproxy.h +++ b/include/linux/nsproxy.h | |||
@@ -32,8 +32,39 @@ struct nsproxy { | |||
32 | }; | 32 | }; |
33 | extern struct nsproxy init_nsproxy; | 33 | extern struct nsproxy init_nsproxy; |
34 | 34 | ||
35 | /* | ||
36 | * the namespaces access rules are: | ||
37 | * | ||
38 | * 1. only current task is allowed to change tsk->nsproxy pointer or | ||
39 | * any pointer on the nsproxy itself | ||
40 | * | ||
41 | * 2. when accessing (i.e. reading) current task's namespaces - no | ||
42 | * precautions should be taken - just dereference the pointers | ||
43 | * | ||
44 | * 3. the access to other task namespaces is performed like this | ||
45 | * rcu_read_lock(); | ||
46 | * nsproxy = task_nsproxy(tsk); | ||
47 | * if (nsproxy != NULL) { | ||
48 | * / * | ||
49 | * * work with the namespaces here | ||
50 | * * e.g. get the reference on one of them | ||
51 | * * / | ||
52 | * } / * | ||
53 | * * NULL task_nsproxy() means that this task is | ||
54 | * * almost dead (zombie) | ||
55 | * * / | ||
56 | * rcu_read_unlock(); | ||
57 | * | ||
58 | */ | ||
59 | |||
60 | static inline struct nsproxy *task_nsproxy(struct task_struct *tsk) | ||
61 | { | ||
62 | return rcu_dereference(tsk->nsproxy); | ||
63 | } | ||
64 | |||
35 | int copy_namespaces(unsigned long flags, struct task_struct *tsk); | 65 | int copy_namespaces(unsigned long flags, struct task_struct *tsk); |
36 | void get_task_namespaces(struct task_struct *tsk); | 66 | void exit_task_namespaces(struct task_struct *tsk); |
67 | void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new); | ||
37 | void free_nsproxy(struct nsproxy *ns); | 68 | void free_nsproxy(struct nsproxy *ns); |
38 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, | 69 | int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, |
39 | struct fs_struct *); | 70 | struct fs_struct *); |
@@ -45,14 +76,15 @@ static inline void put_nsproxy(struct nsproxy *ns) | |||
45 | } | 76 | } |
46 | } | 77 | } |
47 | 78 | ||
48 | static inline void exit_task_namespaces(struct task_struct *p) | 79 | static inline void get_nsproxy(struct nsproxy *ns) |
49 | { | 80 | { |
50 | struct nsproxy *ns = p->nsproxy; | 81 | atomic_inc(&ns->count); |
51 | if (ns) { | ||
52 | task_lock(p); | ||
53 | p->nsproxy = NULL; | ||
54 | task_unlock(p); | ||
55 | put_nsproxy(ns); | ||
56 | } | ||
57 | } | 82 | } |
83 | |||
84 | #ifdef CONFIG_CGROUP_NS | ||
85 | int ns_cgroup_clone(struct task_struct *tsk); | ||
86 | #else | ||
87 | static inline int ns_cgroup_clone(struct task_struct *tsk) { return 0; } | ||
88 | #endif | ||
89 | |||
58 | #endif | 90 | #endif |
diff --git a/include/linux/of.h b/include/linux/of.h index 6df80e985914..5c39b9270ff7 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -16,8 +16,8 @@ | |||
16 | * 2 of the License, or (at your option) any later version. | 16 | * 2 of the License, or (at your option) any later version. |
17 | */ | 17 | */ |
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/bitops.h> | ||
19 | 20 | ||
20 | #include <asm/bitops.h> | ||
21 | #include <asm/prom.h> | 21 | #include <asm/prom.h> |
22 | 22 | ||
23 | /* flag descriptions */ | 23 | /* flag descriptions */ |
diff --git a/include/linux/phantom.h b/include/linux/phantom.h index d3ebbfae6903..96f4048a6cc3 100644 --- a/include/linux/phantom.h +++ b/include/linux/phantom.h | |||
@@ -30,7 +30,11 @@ struct phm_regs { | |||
30 | #define PHN_SET_REG _IOW (PH_IOC_MAGIC, 1, struct phm_reg *) | 30 | #define PHN_SET_REG _IOW (PH_IOC_MAGIC, 1, struct phm_reg *) |
31 | #define PHN_GET_REGS _IOWR(PH_IOC_MAGIC, 2, struct phm_regs *) | 31 | #define PHN_GET_REGS _IOWR(PH_IOC_MAGIC, 2, struct phm_regs *) |
32 | #define PHN_SET_REGS _IOW (PH_IOC_MAGIC, 3, struct phm_regs *) | 32 | #define PHN_SET_REGS _IOW (PH_IOC_MAGIC, 3, struct phm_regs *) |
33 | #define PH_IOC_MAXNR 3 | 33 | /* this ioctl tells the driver, that the caller is not OpenHaptics and might |
34 | * use improved registers update (no more phantom switchoffs when using | ||
35 | * libphantom) */ | ||
36 | #define PHN_NOT_OH _IO (PH_IOC_MAGIC, 4) | ||
37 | #define PH_IOC_MAXNR 4 | ||
34 | 38 | ||
35 | #define PHN_CONTROL 0x6 /* control byte in iaddr space */ | 39 | #define PHN_CONTROL 0x6 /* control byte in iaddr space */ |
36 | #define PHN_CTL_AMP 0x1 /* switch after torques change */ | 40 | #define PHN_CTL_AMP 0x1 /* switch after torques change */ |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 1e0e4e3423a6..e29a900a8499 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -40,15 +40,28 @@ enum pid_type | |||
40 | * processes. | 40 | * processes. |
41 | */ | 41 | */ |
42 | 42 | ||
43 | struct pid | 43 | |
44 | { | 44 | /* |
45 | atomic_t count; | 45 | * struct upid is used to get the id of the struct pid, as it is |
46 | * seen in particular namespace. Later the struct pid is found with | ||
47 | * find_pid_ns() using the int nr and struct pid_namespace *ns. | ||
48 | */ | ||
49 | |||
50 | struct upid { | ||
46 | /* Try to keep pid_chain in the same cacheline as nr for find_pid */ | 51 | /* Try to keep pid_chain in the same cacheline as nr for find_pid */ |
47 | int nr; | 52 | int nr; |
53 | struct pid_namespace *ns; | ||
48 | struct hlist_node pid_chain; | 54 | struct hlist_node pid_chain; |
55 | }; | ||
56 | |||
57 | struct pid | ||
58 | { | ||
59 | atomic_t count; | ||
49 | /* lists of tasks that use this pid */ | 60 | /* lists of tasks that use this pid */ |
50 | struct hlist_head tasks[PIDTYPE_MAX]; | 61 | struct hlist_head tasks[PIDTYPE_MAX]; |
51 | struct rcu_head rcu; | 62 | struct rcu_head rcu; |
63 | int level; | ||
64 | struct upid numbers[1]; | ||
52 | }; | 65 | }; |
53 | 66 | ||
54 | extern struct pid init_struct_pid; | 67 | extern struct pid init_struct_pid; |
@@ -83,26 +96,60 @@ extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); | |||
83 | extern void FASTCALL(transfer_pid(struct task_struct *old, | 96 | extern void FASTCALL(transfer_pid(struct task_struct *old, |
84 | struct task_struct *new, enum pid_type)); | 97 | struct task_struct *new, enum pid_type)); |
85 | 98 | ||
99 | struct pid_namespace; | ||
100 | extern struct pid_namespace init_pid_ns; | ||
101 | |||
86 | /* | 102 | /* |
87 | * look up a PID in the hash table. Must be called with the tasklist_lock | 103 | * look up a PID in the hash table. Must be called with the tasklist_lock |
88 | * or rcu_read_lock() held. | 104 | * or rcu_read_lock() held. |
105 | * | ||
106 | * find_pid_ns() finds the pid in the namespace specified | ||
107 | * find_pid() find the pid by its global id, i.e. in the init namespace | ||
108 | * find_vpid() finr the pid by its virtual id, i.e. in the current namespace | ||
109 | * | ||
110 | * see also find_task_by_pid() set in include/linux/sched.h | ||
89 | */ | 111 | */ |
90 | extern struct pid *FASTCALL(find_pid(int nr)); | 112 | extern struct pid *FASTCALL(find_pid_ns(int nr, struct pid_namespace *ns)); |
113 | extern struct pid *find_vpid(int nr); | ||
114 | extern struct pid *find_pid(int nr); | ||
91 | 115 | ||
92 | /* | 116 | /* |
93 | * Lookup a PID in the hash table, and return with it's count elevated. | 117 | * Lookup a PID in the hash table, and return with it's count elevated. |
94 | */ | 118 | */ |
95 | extern struct pid *find_get_pid(int nr); | 119 | extern struct pid *find_get_pid(int nr); |
96 | extern struct pid *find_ge_pid(int nr); | 120 | extern struct pid *find_ge_pid(int nr, struct pid_namespace *); |
97 | 121 | ||
98 | extern struct pid *alloc_pid(void); | 122 | extern struct pid *alloc_pid(struct pid_namespace *ns); |
99 | extern void FASTCALL(free_pid(struct pid *pid)); | 123 | extern void FASTCALL(free_pid(struct pid *pid)); |
124 | extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); | ||
125 | |||
126 | /* | ||
127 | * the helpers to get the pid's id seen from different namespaces | ||
128 | * | ||
129 | * pid_nr() : global id, i.e. the id seen from the init namespace; | ||
130 | * pid_vnr() : virtual id, i.e. the id seen from the namespace this pid | ||
131 | * belongs to. this only makes sence when called in the | ||
132 | * context of the task that belongs to the same namespace; | ||
133 | * pid_nr_ns() : id seen from the ns specified. | ||
134 | * | ||
135 | * see also task_xid_nr() etc in include/linux/sched.h | ||
136 | */ | ||
100 | 137 | ||
101 | static inline pid_t pid_nr(struct pid *pid) | 138 | static inline pid_t pid_nr(struct pid *pid) |
102 | { | 139 | { |
103 | pid_t nr = 0; | 140 | pid_t nr = 0; |
104 | if (pid) | 141 | if (pid) |
105 | nr = pid->nr; | 142 | nr = pid->numbers[0].nr; |
143 | return nr; | ||
144 | } | ||
145 | |||
146 | pid_t pid_nr_ns(struct pid *pid, struct pid_namespace *ns); | ||
147 | |||
148 | static inline pid_t pid_vnr(struct pid *pid) | ||
149 | { | ||
150 | pid_t nr = 0; | ||
151 | if (pid) | ||
152 | nr = pid->numbers[pid->level].nr; | ||
106 | return nr; | 153 | return nr; |
107 | } | 154 | } |
108 | 155 | ||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index b9a17e08ff0f..0135c76c76c6 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -4,7 +4,6 @@ | |||
4 | #include <linux/sched.h> | 4 | #include <linux/sched.h> |
5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | #include <linux/threads.h> | 6 | #include <linux/threads.h> |
7 | #include <linux/pid.h> | ||
8 | #include <linux/nsproxy.h> | 7 | #include <linux/nsproxy.h> |
9 | #include <linux/kref.h> | 8 | #include <linux/kref.h> |
10 | 9 | ||
@@ -20,13 +19,21 @@ struct pid_namespace { | |||
20 | struct pidmap pidmap[PIDMAP_ENTRIES]; | 19 | struct pidmap pidmap[PIDMAP_ENTRIES]; |
21 | int last_pid; | 20 | int last_pid; |
22 | struct task_struct *child_reaper; | 21 | struct task_struct *child_reaper; |
22 | struct kmem_cache *pid_cachep; | ||
23 | int level; | ||
24 | struct pid_namespace *parent; | ||
25 | #ifdef CONFIG_PROC_FS | ||
26 | struct vfsmount *proc_mnt; | ||
27 | #endif | ||
23 | }; | 28 | }; |
24 | 29 | ||
25 | extern struct pid_namespace init_pid_ns; | 30 | extern struct pid_namespace init_pid_ns; |
26 | 31 | ||
27 | static inline void get_pid_ns(struct pid_namespace *ns) | 32 | static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) |
28 | { | 33 | { |
29 | kref_get(&ns->kref); | 34 | if (ns != &init_pid_ns) |
35 | kref_get(&ns->kref); | ||
36 | return ns; | ||
30 | } | 37 | } |
31 | 38 | ||
32 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); | 39 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); |
@@ -34,12 +41,19 @@ extern void free_pid_ns(struct kref *kref); | |||
34 | 41 | ||
35 | static inline void put_pid_ns(struct pid_namespace *ns) | 42 | static inline void put_pid_ns(struct pid_namespace *ns) |
36 | { | 43 | { |
37 | kref_put(&ns->kref, free_pid_ns); | 44 | if (ns != &init_pid_ns) |
45 | kref_put(&ns->kref, free_pid_ns); | ||
38 | } | 46 | } |
39 | 47 | ||
40 | static inline struct task_struct *child_reaper(struct task_struct *tsk) | 48 | static inline struct pid_namespace *task_active_pid_ns(struct task_struct *tsk) |
41 | { | 49 | { |
42 | return init_pid_ns.child_reaper; | 50 | return tsk->nsproxy->pid_ns; |
51 | } | ||
52 | |||
53 | static inline struct task_struct *task_child_reaper(struct task_struct *tsk) | ||
54 | { | ||
55 | BUG_ON(tsk != current); | ||
56 | return tsk->nsproxy->pid_ns->child_reaper; | ||
43 | } | 57 | } |
44 | 58 | ||
45 | #endif /* _LINUX_PID_NS_H */ | 59 | #endif /* _LINUX_PID_NS_H */ |
diff --git a/include/linux/prio_heap.h b/include/linux/prio_heap.h new file mode 100644 index 000000000000..08094350f26a --- /dev/null +++ b/include/linux/prio_heap.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _LINUX_PRIO_HEAP_H | ||
2 | #define _LINUX_PRIO_HEAP_H | ||
3 | |||
4 | /* | ||
5 | * Simple insertion-only static-sized priority heap containing | ||
6 | * pointers, based on CLR, chapter 7 | ||
7 | */ | ||
8 | |||
9 | #include <linux/gfp.h> | ||
10 | |||
11 | /** | ||
12 | * struct ptr_heap - simple static-sized priority heap | ||
13 | * @ptrs - pointer to data area | ||
14 | * @max - max number of elements that can be stored in @ptrs | ||
15 | * @size - current number of valid elements in @ptrs (in the range 0..@size-1 | ||
16 | * @gt: comparison operator, which should implement "greater than" | ||
17 | */ | ||
18 | struct ptr_heap { | ||
19 | void **ptrs; | ||
20 | int max; | ||
21 | int size; | ||
22 | int (*gt)(void *, void *); | ||
23 | }; | ||
24 | |||
25 | /** | ||
26 | * heap_init - initialize an empty heap with a given memory size | ||
27 | * @heap: the heap structure to be initialized | ||
28 | * @size: amount of memory to use in bytes | ||
29 | * @gfp_mask: mask to pass to kmalloc() | ||
30 | * @gt: comparison operator, which should implement "greater than" | ||
31 | */ | ||
32 | extern int heap_init(struct ptr_heap *heap, size_t size, gfp_t gfp_mask, | ||
33 | int (*gt)(void *, void *)); | ||
34 | |||
35 | /** | ||
36 | * heap_free - release a heap's storage | ||
37 | * @heap: the heap structure whose data should be released | ||
38 | */ | ||
39 | void heap_free(struct ptr_heap *heap); | ||
40 | |||
41 | /** | ||
42 | * heap_insert - insert a value into the heap and return any overflowed value | ||
43 | * @heap: the heap to be operated on | ||
44 | * @p: the pointer to be inserted | ||
45 | * | ||
46 | * Attempts to insert the given value into the priority heap. If the | ||
47 | * heap is full prior to the insertion, then the resulting heap will | ||
48 | * consist of the smallest @max elements of the original heap and the | ||
49 | * new element; the greatest element will be removed from the heap and | ||
50 | * returned. Note that the returned element will be the new element | ||
51 | * (i.e. no change to the heap) if the new element is greater than all | ||
52 | * elements currently in the heap. | ||
53 | */ | ||
54 | extern void *heap_insert(struct ptr_heap *heap, void *p); | ||
55 | |||
56 | |||
57 | |||
58 | #endif /* _LINUX_PRIO_HEAP_H */ | ||
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 20741f668f7b..1ff461672060 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -125,7 +125,8 @@ extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, | |||
125 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); | 125 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); |
126 | 126 | ||
127 | extern struct vfsmount *proc_mnt; | 127 | extern struct vfsmount *proc_mnt; |
128 | extern int proc_fill_super(struct super_block *,void *,int); | 128 | struct pid_namespace; |
129 | extern int proc_fill_super(struct super_block *); | ||
129 | extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct proc_dir_entry *); | 130 | extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct proc_dir_entry *); |
130 | 131 | ||
131 | /* | 132 | /* |
@@ -142,6 +143,9 @@ extern const struct file_operations proc_kcore_operations; | |||
142 | extern const struct file_operations proc_kmsg_operations; | 143 | extern const struct file_operations proc_kmsg_operations; |
143 | extern const struct file_operations ppc_htab_operations; | 144 | extern const struct file_operations ppc_htab_operations; |
144 | 145 | ||
146 | extern int pid_ns_prepare_proc(struct pid_namespace *ns); | ||
147 | extern void pid_ns_release_proc(struct pid_namespace *ns); | ||
148 | |||
145 | /* | 149 | /* |
146 | * proc_tty.c | 150 | * proc_tty.c |
147 | */ | 151 | */ |
@@ -207,7 +211,9 @@ extern void proc_net_remove(struct net *net, const char *name); | |||
207 | #define proc_net_create(net, name, mode, info) ({ (void)(mode), NULL; }) | 211 | #define proc_net_create(net, name, mode, info) ({ (void)(mode), NULL; }) |
208 | static inline void proc_net_remove(struct net *net, const char *name) {} | 212 | static inline void proc_net_remove(struct net *net, const char *name) {} |
209 | 213 | ||
210 | static inline void proc_flush_task(struct task_struct *task) { } | 214 | static inline void proc_flush_task(struct task_struct *task) |
215 | { | ||
216 | } | ||
211 | 217 | ||
212 | static inline struct proc_dir_entry *create_proc_entry(const char *name, | 218 | static inline struct proc_dir_entry *create_proc_entry(const char *name, |
213 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } | 219 | mode_t mode, struct proc_dir_entry *parent) { return NULL; } |
@@ -232,6 +238,15 @@ static inline void proc_tty_unregister_driver(struct tty_driver *driver) {}; | |||
232 | 238 | ||
233 | extern struct proc_dir_entry proc_root; | 239 | extern struct proc_dir_entry proc_root; |
234 | 240 | ||
241 | static inline int pid_ns_prepare_proc(struct pid_namespace *ns) | ||
242 | { | ||
243 | return 0; | ||
244 | } | ||
245 | |||
246 | static inline void pid_ns_release_proc(struct pid_namespace *ns) | ||
247 | { | ||
248 | } | ||
249 | |||
235 | #endif /* CONFIG_PROC_FS */ | 250 | #endif /* CONFIG_PROC_FS */ |
236 | 251 | ||
237 | #if !defined(CONFIG_PROC_KCORE) | 252 | #if !defined(CONFIG_PROC_KCORE) |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 8dcf237d3386..72bfccd3da22 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -85,7 +85,7 @@ void reiserfs_warning(struct super_block *s, const char *fmt, ...); | |||
85 | if( !( cond ) ) \ | 85 | if( !( cond ) ) \ |
86 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ | 86 | reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \ |
87 | __FILE__ ":%i:%s: " format "\n", \ | 87 | __FILE__ ":%i:%s: " format "\n", \ |
88 | in_interrupt() ? -1 : current -> pid, __LINE__ , __FUNCTION__ , ##args ) | 88 | in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __FUNCTION__ , ##args ) |
89 | 89 | ||
90 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) | 90 | #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args) |
91 | 91 | ||
@@ -283,6 +283,18 @@ static inline struct reiserfs_sb_info *REISERFS_SB(const struct super_block *sb) | |||
283 | return sb->s_fs_info; | 283 | return sb->s_fs_info; |
284 | } | 284 | } |
285 | 285 | ||
286 | /* Don't trust REISERFS_SB(sb)->s_bmap_nr, it's a u16 | ||
287 | * which overflows on large file systems. */ | ||
288 | static inline u32 reiserfs_bmap_count(struct super_block *sb) | ||
289 | { | ||
290 | return (SB_BLOCK_COUNT(sb) - 1) / (sb->s_blocksize * 8) + 1; | ||
291 | } | ||
292 | |||
293 | static inline int bmap_would_wrap(unsigned bmap_nr) | ||
294 | { | ||
295 | return bmap_nr > ((1LL << 16) - 1); | ||
296 | } | ||
297 | |||
286 | /** this says about version of key of all items (but stat data) the | 298 | /** this says about version of key of all items (but stat data) the |
287 | object consists of */ | 299 | object consists of */ |
288 | #define get_inode_item_key_version( inode ) \ | 300 | #define get_inode_item_key_version( inode ) \ |
@@ -1734,8 +1746,8 @@ int journal_end_sync(struct reiserfs_transaction_handle *, struct super_block *, | |||
1734 | int journal_mark_freed(struct reiserfs_transaction_handle *, | 1746 | int journal_mark_freed(struct reiserfs_transaction_handle *, |
1735 | struct super_block *, b_blocknr_t blocknr); | 1747 | struct super_block *, b_blocknr_t blocknr); |
1736 | int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); | 1748 | int journal_transaction_should_end(struct reiserfs_transaction_handle *, int); |
1737 | int reiserfs_in_journal(struct super_block *p_s_sb, int bmap_nr, int bit_nr, | 1749 | int reiserfs_in_journal(struct super_block *p_s_sb, unsigned int bmap_nr, |
1738 | int searchall, b_blocknr_t * next); | 1750 | int bit_nr, int searchall, b_blocknr_t *next); |
1739 | int journal_begin(struct reiserfs_transaction_handle *, | 1751 | int journal_begin(struct reiserfs_transaction_handle *, |
1740 | struct super_block *p_s_sb, unsigned long); | 1752 | struct super_block *p_s_sb, unsigned long); |
1741 | int journal_join_abort(struct reiserfs_transaction_handle *, | 1753 | int journal_join_abort(struct reiserfs_transaction_handle *, |
@@ -1743,7 +1755,7 @@ int journal_join_abort(struct reiserfs_transaction_handle *, | |||
1743 | void reiserfs_journal_abort(struct super_block *sb, int errno); | 1755 | void reiserfs_journal_abort(struct super_block *sb, int errno); |
1744 | void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...); | 1756 | void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...); |
1745 | int reiserfs_allocate_list_bitmaps(struct super_block *s, | 1757 | int reiserfs_allocate_list_bitmaps(struct super_block *s, |
1746 | struct reiserfs_list_bitmap *, int); | 1758 | struct reiserfs_list_bitmap *, unsigned int); |
1747 | 1759 | ||
1748 | void add_save_link(struct reiserfs_transaction_handle *th, | 1760 | void add_save_link(struct reiserfs_transaction_handle *th, |
1749 | struct inode *inode, int truncate); | 1761 | struct inode *inode, int truncate); |
@@ -2041,7 +2053,7 @@ struct buffer_head *get_FEB(struct tree_balance *); | |||
2041 | * arguments, such as node, search path, transaction_handle, etc. */ | 2053 | * arguments, such as node, search path, transaction_handle, etc. */ |
2042 | struct __reiserfs_blocknr_hint { | 2054 | struct __reiserfs_blocknr_hint { |
2043 | struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ | 2055 | struct inode *inode; /* inode passed to allocator, if we allocate unf. nodes */ |
2044 | long block; /* file offset, in blocks */ | 2056 | sector_t block; /* file offset, in blocks */ |
2045 | struct in_core_key key; | 2057 | struct in_core_key key; |
2046 | struct treepath *path; /* search path, used by allocator to deternine search_start by | 2058 | struct treepath *path; /* search path, used by allocator to deternine search_start by |
2047 | * various ways */ | 2059 | * various ways */ |
@@ -2099,7 +2111,8 @@ static inline int reiserfs_new_form_blocknrs(struct tree_balance *tb, | |||
2099 | static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle | 2111 | static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle |
2100 | *th, struct inode *inode, | 2112 | *th, struct inode *inode, |
2101 | b_blocknr_t * new_blocknrs, | 2113 | b_blocknr_t * new_blocknrs, |
2102 | struct treepath *path, long block) | 2114 | struct treepath *path, |
2115 | sector_t block) | ||
2103 | { | 2116 | { |
2104 | reiserfs_blocknr_hint_t hint = { | 2117 | reiserfs_blocknr_hint_t hint = { |
2105 | .th = th, | 2118 | .th = th, |
@@ -2116,7 +2129,8 @@ static inline int reiserfs_new_unf_blocknrs(struct reiserfs_transaction_handle | |||
2116 | static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle | 2129 | static inline int reiserfs_new_unf_blocknrs2(struct reiserfs_transaction_handle |
2117 | *th, struct inode *inode, | 2130 | *th, struct inode *inode, |
2118 | b_blocknr_t * new_blocknrs, | 2131 | b_blocknr_t * new_blocknrs, |
2119 | struct treepath *path, long block) | 2132 | struct treepath *path, |
2133 | sector_t block) | ||
2120 | { | 2134 | { |
2121 | reiserfs_blocknr_hint_t hint = { | 2135 | reiserfs_blocknr_hint_t hint = { |
2122 | .th = th, | 2136 | .th = th, |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index ff9e9234f8ba..10fa0c832018 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -265,9 +265,7 @@ enum journal_state_bits { | |||
265 | typedef __u32(*hashf_t) (const signed char *, int); | 265 | typedef __u32(*hashf_t) (const signed char *, int); |
266 | 266 | ||
267 | struct reiserfs_bitmap_info { | 267 | struct reiserfs_bitmap_info { |
268 | // FIXME: Won't work with block sizes > 8K | 268 | __u32 free_count; |
269 | __u16 first_zero_hint; | ||
270 | __u16 free_count; | ||
271 | }; | 269 | }; |
272 | 270 | ||
273 | struct proc_dir_entry; | 271 | struct proc_dir_entry; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 10a83d8d5775..13df99fb2769 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ | 25 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ |
26 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ | 26 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ |
27 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ | 27 | #define CLONE_NEWUSER 0x10000000 /* New user namespace */ |
28 | #define CLONE_NEWPID 0x20000000 /* New pid namespace */ | ||
28 | #define CLONE_NEWNET 0x40000000 /* New network namespace */ | 29 | #define CLONE_NEWNET 0x40000000 /* New network namespace */ |
29 | 30 | ||
30 | /* | 31 | /* |
@@ -428,7 +429,17 @@ struct signal_struct { | |||
428 | cputime_t it_prof_incr, it_virt_incr; | 429 | cputime_t it_prof_incr, it_virt_incr; |
429 | 430 | ||
430 | /* job control IDs */ | 431 | /* job control IDs */ |
431 | pid_t pgrp; | 432 | |
433 | /* | ||
434 | * pgrp and session fields are deprecated. | ||
435 | * use the task_session_Xnr and task_pgrp_Xnr routines below | ||
436 | */ | ||
437 | |||
438 | union { | ||
439 | pid_t pgrp __deprecated; | ||
440 | pid_t __pgrp; | ||
441 | }; | ||
442 | |||
432 | struct pid *tty_old_pgrp; | 443 | struct pid *tty_old_pgrp; |
433 | 444 | ||
434 | union { | 445 | union { |
@@ -736,6 +747,8 @@ struct sched_domain { | |||
736 | #endif | 747 | #endif |
737 | }; | 748 | }; |
738 | 749 | ||
750 | extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new); | ||
751 | |||
739 | #endif /* CONFIG_SMP */ | 752 | #endif /* CONFIG_SMP */ |
740 | 753 | ||
741 | /* | 754 | /* |
@@ -756,8 +769,6 @@ static inline int above_background_load(void) | |||
756 | } | 769 | } |
757 | 770 | ||
758 | struct io_context; /* See blkdev.h */ | 771 | struct io_context; /* See blkdev.h */ |
759 | struct cpuset; | ||
760 | |||
761 | #define NGROUPS_SMALL 32 | 772 | #define NGROUPS_SMALL 32 |
762 | #define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t))) | 773 | #define NGROUPS_PER_BLOCK ((int)(PAGE_SIZE / sizeof(gid_t))) |
763 | struct group_info { | 774 | struct group_info { |
@@ -1125,11 +1136,16 @@ struct task_struct { | |||
1125 | short il_next; | 1136 | short il_next; |
1126 | #endif | 1137 | #endif |
1127 | #ifdef CONFIG_CPUSETS | 1138 | #ifdef CONFIG_CPUSETS |
1128 | struct cpuset *cpuset; | ||
1129 | nodemask_t mems_allowed; | 1139 | nodemask_t mems_allowed; |
1130 | int cpuset_mems_generation; | 1140 | int cpuset_mems_generation; |
1131 | int cpuset_mem_spread_rotor; | 1141 | int cpuset_mem_spread_rotor; |
1132 | #endif | 1142 | #endif |
1143 | #ifdef CONFIG_CGROUPS | ||
1144 | /* Control Group info protected by css_set_lock */ | ||
1145 | struct css_set *cgroups; | ||
1146 | /* cg_list protected by css_set_lock and tsk->alloc_lock */ | ||
1147 | struct list_head cg_list; | ||
1148 | #endif | ||
1133 | #ifdef CONFIG_FUTEX | 1149 | #ifdef CONFIG_FUTEX |
1134 | struct robust_list_head __user *robust_list; | 1150 | struct robust_list_head __user *robust_list; |
1135 | #ifdef CONFIG_COMPAT | 1151 | #ifdef CONFIG_COMPAT |
@@ -1185,24 +1201,14 @@ static inline int rt_task(struct task_struct *p) | |||
1185 | return rt_prio(p->prio); | 1201 | return rt_prio(p->prio); |
1186 | } | 1202 | } |
1187 | 1203 | ||
1188 | static inline pid_t process_group(struct task_struct *tsk) | 1204 | static inline void set_task_session(struct task_struct *tsk, pid_t session) |
1189 | { | 1205 | { |
1190 | return tsk->signal->pgrp; | 1206 | tsk->signal->__session = session; |
1191 | } | 1207 | } |
1192 | 1208 | ||
1193 | static inline pid_t signal_session(struct signal_struct *sig) | 1209 | static inline void set_task_pgrp(struct task_struct *tsk, pid_t pgrp) |
1194 | { | 1210 | { |
1195 | return sig->__session; | 1211 | tsk->signal->__pgrp = pgrp; |
1196 | } | ||
1197 | |||
1198 | static inline pid_t process_session(struct task_struct *tsk) | ||
1199 | { | ||
1200 | return signal_session(tsk->signal); | ||
1201 | } | ||
1202 | |||
1203 | static inline void set_signal_session(struct signal_struct *sig, pid_t session) | ||
1204 | { | ||
1205 | sig->__session = session; | ||
1206 | } | 1212 | } |
1207 | 1213 | ||
1208 | static inline struct pid *task_pid(struct task_struct *task) | 1214 | static inline struct pid *task_pid(struct task_struct *task) |
@@ -1225,6 +1231,88 @@ static inline struct pid *task_session(struct task_struct *task) | |||
1225 | return task->group_leader->pids[PIDTYPE_SID].pid; | 1231 | return task->group_leader->pids[PIDTYPE_SID].pid; |
1226 | } | 1232 | } |
1227 | 1233 | ||
1234 | struct pid_namespace; | ||
1235 | |||
1236 | /* | ||
1237 | * the helpers to get the task's different pids as they are seen | ||
1238 | * from various namespaces | ||
1239 | * | ||
1240 | * task_xid_nr() : global id, i.e. the id seen from the init namespace; | ||
1241 | * task_xid_vnr() : virtual id, i.e. the id seen from the namespace the task | ||
1242 | * belongs to. this only makes sence when called in the | ||
1243 | * context of the task that belongs to the same namespace; | ||
1244 | * task_xid_nr_ns() : id seen from the ns specified; | ||
1245 | * | ||
1246 | * set_task_vxid() : assigns a virtual id to a task; | ||
1247 | * | ||
1248 | * task_ppid_nr_ns() : the parent's id as seen from the namespace specified. | ||
1249 | * the result depends on the namespace and whether the | ||
1250 | * task in question is the namespace's init. e.g. for the | ||
1251 | * namespace's init this will return 0 when called from | ||
1252 | * the namespace of this init, or appropriate id otherwise. | ||
1253 | * | ||
1254 | * | ||
1255 | * see also pid_nr() etc in include/linux/pid.h | ||
1256 | */ | ||
1257 | |||
1258 | static inline pid_t task_pid_nr(struct task_struct *tsk) | ||
1259 | { | ||
1260 | return tsk->pid; | ||
1261 | } | ||
1262 | |||
1263 | pid_t task_pid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | ||
1264 | |||
1265 | static inline pid_t task_pid_vnr(struct task_struct *tsk) | ||
1266 | { | ||
1267 | return pid_vnr(task_pid(tsk)); | ||
1268 | } | ||
1269 | |||
1270 | |||
1271 | static inline pid_t task_tgid_nr(struct task_struct *tsk) | ||
1272 | { | ||
1273 | return tsk->tgid; | ||
1274 | } | ||
1275 | |||
1276 | pid_t task_tgid_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | ||
1277 | |||
1278 | static inline pid_t task_tgid_vnr(struct task_struct *tsk) | ||
1279 | { | ||
1280 | return pid_vnr(task_tgid(tsk)); | ||
1281 | } | ||
1282 | |||
1283 | |||
1284 | static inline pid_t task_pgrp_nr(struct task_struct *tsk) | ||
1285 | { | ||
1286 | return tsk->signal->__pgrp; | ||
1287 | } | ||
1288 | |||
1289 | pid_t task_pgrp_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | ||
1290 | |||
1291 | static inline pid_t task_pgrp_vnr(struct task_struct *tsk) | ||
1292 | { | ||
1293 | return pid_vnr(task_pgrp(tsk)); | ||
1294 | } | ||
1295 | |||
1296 | |||
1297 | static inline pid_t task_session_nr(struct task_struct *tsk) | ||
1298 | { | ||
1299 | return tsk->signal->__session; | ||
1300 | } | ||
1301 | |||
1302 | pid_t task_session_nr_ns(struct task_struct *tsk, struct pid_namespace *ns); | ||
1303 | |||
1304 | static inline pid_t task_session_vnr(struct task_struct *tsk) | ||
1305 | { | ||
1306 | return pid_vnr(task_session(tsk)); | ||
1307 | } | ||
1308 | |||
1309 | |||
1310 | static inline pid_t task_ppid_nr_ns(struct task_struct *tsk, | ||
1311 | struct pid_namespace *ns) | ||
1312 | { | ||
1313 | return pid_nr_ns(task_pid(rcu_dereference(tsk->real_parent)), ns); | ||
1314 | } | ||
1315 | |||
1228 | /** | 1316 | /** |
1229 | * pid_alive - check that a task structure is not stale | 1317 | * pid_alive - check that a task structure is not stale |
1230 | * @p: Task structure to be checked. | 1318 | * @p: Task structure to be checked. |
@@ -1239,16 +1327,22 @@ static inline int pid_alive(struct task_struct *p) | |||
1239 | } | 1327 | } |
1240 | 1328 | ||
1241 | /** | 1329 | /** |
1242 | * is_init - check if a task structure is init | 1330 | * is_global_init - check if a task structure is init |
1243 | * @tsk: Task structure to be checked. | 1331 | * @tsk: Task structure to be checked. |
1244 | * | 1332 | * |
1245 | * Check if a task structure is the first user space task the kernel created. | 1333 | * Check if a task structure is the first user space task the kernel created. |
1246 | */ | 1334 | */ |
1247 | static inline int is_init(struct task_struct *tsk) | 1335 | static inline int is_global_init(struct task_struct *tsk) |
1248 | { | 1336 | { |
1249 | return tsk->pid == 1; | 1337 | return tsk->pid == 1; |
1250 | } | 1338 | } |
1251 | 1339 | ||
1340 | /* | ||
1341 | * is_container_init: | ||
1342 | * check whether in the task is init in its own pid namespace. | ||
1343 | */ | ||
1344 | extern int is_container_init(struct task_struct *tsk); | ||
1345 | |||
1252 | extern struct pid *cad_pid; | 1346 | extern struct pid *cad_pid; |
1253 | 1347 | ||
1254 | extern void free_task(struct task_struct *tsk); | 1348 | extern void free_task(struct task_struct *tsk); |
@@ -1420,8 +1514,32 @@ extern struct task_struct init_task; | |||
1420 | 1514 | ||
1421 | extern struct mm_struct init_mm; | 1515 | extern struct mm_struct init_mm; |
1422 | 1516 | ||
1423 | #define find_task_by_pid(nr) find_task_by_pid_type(PIDTYPE_PID, nr) | 1517 | extern struct pid_namespace init_pid_ns; |
1424 | extern struct task_struct *find_task_by_pid_type(int type, int pid); | 1518 | |
1519 | /* | ||
1520 | * find a task by one of its numerical ids | ||
1521 | * | ||
1522 | * find_task_by_pid_type_ns(): | ||
1523 | * it is the most generic call - it finds a task by all id, | ||
1524 | * type and namespace specified | ||
1525 | * find_task_by_pid_ns(): | ||
1526 | * finds a task by its pid in the specified namespace | ||
1527 | * find_task_by_vpid(): | ||
1528 | * finds a task by its virtual pid | ||
1529 | * find_task_by_pid(): | ||
1530 | * finds a task by its global pid | ||
1531 | * | ||
1532 | * see also find_pid() etc in include/linux/pid.h | ||
1533 | */ | ||
1534 | |||
1535 | extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, | ||
1536 | struct pid_namespace *ns); | ||
1537 | |||
1538 | extern struct task_struct *find_task_by_pid(pid_t nr); | ||
1539 | extern struct task_struct *find_task_by_vpid(pid_t nr); | ||
1540 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, | ||
1541 | struct pid_namespace *ns); | ||
1542 | |||
1425 | extern void __set_special_pids(pid_t session, pid_t pgrp); | 1543 | extern void __set_special_pids(pid_t session, pid_t pgrp); |
1426 | 1544 | ||
1427 | /* per-UID process charging. */ | 1545 | /* per-UID process charging. */ |
@@ -1608,6 +1726,12 @@ static inline int has_group_leader_pid(struct task_struct *p) | |||
1608 | return p->pid == p->tgid; | 1726 | return p->pid == p->tgid; |
1609 | } | 1727 | } |
1610 | 1728 | ||
1729 | static inline | ||
1730 | int same_thread_group(struct task_struct *p1, struct task_struct *p2) | ||
1731 | { | ||
1732 | return p1->tgid == p2->tgid; | ||
1733 | } | ||
1734 | |||
1611 | static inline struct task_struct *next_thread(const struct task_struct *p) | 1735 | static inline struct task_struct *next_thread(const struct task_struct *p) |
1612 | { | 1736 | { |
1613 | return list_entry(rcu_dereference(p->thread_group.next), | 1737 | return list_entry(rcu_dereference(p->thread_group.next), |
@@ -1625,7 +1749,8 @@ static inline int thread_group_empty(struct task_struct *p) | |||
1625 | /* | 1749 | /* |
1626 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring | 1750 | * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring |
1627 | * subscriptions and synchronises with wait4(). Also used in procfs. Also | 1751 | * subscriptions and synchronises with wait4(). Also used in procfs. Also |
1628 | * pins the final release of task.io_context. Also protects ->cpuset. | 1752 | * pins the final release of task.io_context. Also protects ->cpuset and |
1753 | * ->cgroup.subsys[]. | ||
1629 | * | 1754 | * |
1630 | * Nests both inside and outside of read_lock(&tasklist_lock). | 1755 | * Nests both inside and outside of read_lock(&tasklist_lock). |
1631 | * It must not be nested with write_lock_irq(&tasklist_lock), | 1756 | * It must not be nested with write_lock_irq(&tasklist_lock), |
diff --git a/include/linux/sem.h b/include/linux/sem.h index 9aaffb0b1d81..c8eaad9e4b72 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -90,7 +90,6 @@ struct sem { | |||
90 | /* One sem_array data structure for each set of semaphores in the system. */ | 90 | /* One sem_array data structure for each set of semaphores in the system. */ |
91 | struct sem_array { | 91 | struct sem_array { |
92 | struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ | 92 | struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ |
93 | int sem_id; | ||
94 | time_t sem_otime; /* last semop time */ | 93 | time_t sem_otime; /* last semop time */ |
95 | time_t sem_ctime; /* last change time */ | 94 | time_t sem_ctime; /* last change time */ |
96 | struct sem *sem_base; /* ptr to first semaphore in array */ | 95 | struct sem *sem_base; /* ptr to first semaphore in array */ |
diff --git a/include/linux/shm.h b/include/linux/shm.h index bea65d9c93ef..eeaed921a1dc 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -79,7 +79,6 @@ struct shmid_kernel /* private to the kernel */ | |||
79 | { | 79 | { |
80 | struct kern_ipc_perm shm_perm; | 80 | struct kern_ipc_perm shm_perm; |
81 | struct file * shm_file; | 81 | struct file * shm_file; |
82 | int id; | ||
83 | unsigned long shm_nattch; | 82 | unsigned long shm_nattch; |
84 | unsigned long shm_segsz; | 83 | unsigned long shm_segsz; |
85 | time_t shm_atim; | 84 | time_t shm_atim; |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 9a7252e089b9..f4a1395e05ff 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -40,6 +40,7 @@ enum tick_nohz_mode { | |||
40 | * @idle_sleeps: Number of idle calls, where the sched tick was stopped | 40 | * @idle_sleeps: Number of idle calls, where the sched tick was stopped |
41 | * @idle_entrytime: Time when the idle call was entered | 41 | * @idle_entrytime: Time when the idle call was entered |
42 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped | 42 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped |
43 | * @sleep_length: Duration of the current idle sleep | ||
43 | */ | 44 | */ |
44 | struct tick_sched { | 45 | struct tick_sched { |
45 | struct hrtimer sched_timer; | 46 | struct hrtimer sched_timer; |
@@ -52,6 +53,7 @@ struct tick_sched { | |||
52 | unsigned long idle_sleeps; | 53 | unsigned long idle_sleeps; |
53 | ktime_t idle_entrytime; | 54 | ktime_t idle_entrytime; |
54 | ktime_t idle_sleeptime; | 55 | ktime_t idle_sleeptime; |
56 | ktime_t sleep_length; | ||
55 | unsigned long last_jiffies; | 57 | unsigned long last_jiffies; |
56 | unsigned long next_jiffies; | 58 | unsigned long next_jiffies; |
57 | ktime_t idle_expires; | 59 | ktime_t idle_expires; |
@@ -100,10 +102,17 @@ static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | |||
100 | extern void tick_nohz_stop_sched_tick(void); | 102 | extern void tick_nohz_stop_sched_tick(void); |
101 | extern void tick_nohz_restart_sched_tick(void); | 103 | extern void tick_nohz_restart_sched_tick(void); |
102 | extern void tick_nohz_update_jiffies(void); | 104 | extern void tick_nohz_update_jiffies(void); |
105 | extern ktime_t tick_nohz_get_sleep_length(void); | ||
103 | # else | 106 | # else |
104 | static inline void tick_nohz_stop_sched_tick(void) { } | 107 | static inline void tick_nohz_stop_sched_tick(void) { } |
105 | static inline void tick_nohz_restart_sched_tick(void) { } | 108 | static inline void tick_nohz_restart_sched_tick(void) { } |
106 | static inline void tick_nohz_update_jiffies(void) { } | 109 | static inline void tick_nohz_update_jiffies(void) { } |
110 | static inline ktime_t tick_nohz_get_sleep_length(void) | ||
111 | { | ||
112 | ktime_t len = { .tv64 = NSEC_PER_SEC/HZ }; | ||
113 | |||
114 | return len; | ||
115 | } | ||
107 | # endif /* !NO_HZ */ | 116 | # endif /* !NO_HZ */ |
108 | 117 | ||
109 | #endif | 118 | #endif |
diff --git a/include/linux/types.h b/include/linux/types.h index 0351bf2fac85..4f0dad21c917 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -3,12 +3,9 @@ | |||
3 | 3 | ||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #define BITS_TO_LONGS(bits) \ | ||
7 | (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG) | ||
8 | #define DECLARE_BITMAP(name,bits) \ | 6 | #define DECLARE_BITMAP(name,bits) \ |
9 | unsigned long name[BITS_TO_LONGS(bits)] | 7 | unsigned long name[BITS_TO_LONGS(bits)] |
10 | 8 | ||
11 | #define BITS_PER_BYTE 8 | ||
12 | #endif | 9 | #endif |
13 | 10 | ||
14 | #include <linux/posix_types.h> | 11 | #include <linux/posix_types.h> |
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index a6c1e8eed226..15ddd4483b09 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -162,10 +162,6 @@ struct uinput_ff_erase { | |||
162 | #define UI_FF_UPLOAD 1 | 162 | #define UI_FF_UPLOAD 1 |
163 | #define UI_FF_ERASE 2 | 163 | #define UI_FF_ERASE 2 |
164 | 164 | ||
165 | #ifndef NBITS | ||
166 | #define NBITS(x) ((((x)-1)/(sizeof(long)*8))+1) | ||
167 | #endif /* NBITS */ | ||
168 | |||
169 | #define UINPUT_MAX_NAME_SIZE 80 | 165 | #define UINPUT_MAX_NAME_SIZE 80 |
170 | struct uinput_user_dev { | 166 | struct uinput_user_dev { |
171 | char name[UINPUT_MAX_NAME_SIZE]; | 167 | char name[UINPUT_MAX_NAME_SIZE]; |
diff --git a/include/linux/vt.h b/include/linux/vt.h index ba806e8711be..02c1c0288770 100644 --- a/include/linux/vt.h +++ b/include/linux/vt.h | |||
@@ -1,6 +1,18 @@ | |||
1 | #ifndef _LINUX_VT_H | 1 | #ifndef _LINUX_VT_H |
2 | #define _LINUX_VT_H | 2 | #define _LINUX_VT_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | struct notifier_block; | ||
6 | |||
7 | struct vt_notifier_param { | ||
8 | struct vc_data *vc; /* VC on which the update happened */ | ||
9 | unsigned int c; /* Printed char */ | ||
10 | }; | ||
11 | |||
12 | extern int register_vt_notifier(struct notifier_block *nb); | ||
13 | extern int unregister_vt_notifier(struct notifier_block *nb); | ||
14 | #endif | ||
15 | |||
4 | /* | 16 | /* |
5 | * These constants are also useful for user-level apps (e.g., VC | 17 | * These constants are also useful for user-level apps (e.g., VC |
6 | * resizing). | 18 | * resizing). |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index ce6badc98f6d..7daafdc2514b 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/timer.h> | 8 | #include <linux/timer.h> |
9 | #include <linux/linkage.h> | 9 | #include <linux/linkage.h> |
10 | #include <linux/bitops.h> | 10 | #include <linux/bitops.h> |
11 | #include <linux/lockdep.h> | ||
11 | #include <asm/atomic.h> | 12 | #include <asm/atomic.h> |
12 | 13 | ||
13 | struct workqueue_struct; | 14 | struct workqueue_struct; |
@@ -28,6 +29,9 @@ struct work_struct { | |||
28 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) | 29 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) |
29 | struct list_head entry; | 30 | struct list_head entry; |
30 | work_func_t func; | 31 | work_func_t func; |
32 | #ifdef CONFIG_LOCKDEP | ||
33 | struct lockdep_map lockdep_map; | ||
34 | #endif | ||
31 | }; | 35 | }; |
32 | 36 | ||
33 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) | 37 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) |
@@ -41,10 +45,23 @@ struct execute_work { | |||
41 | struct work_struct work; | 45 | struct work_struct work; |
42 | }; | 46 | }; |
43 | 47 | ||
48 | #ifdef CONFIG_LOCKDEP | ||
49 | /* | ||
50 | * NB: because we have to copy the lockdep_map, setting _key | ||
51 | * here is required, otherwise it could get initialised to the | ||
52 | * copy of the lockdep_map! | ||
53 | */ | ||
54 | #define __WORK_INIT_LOCKDEP_MAP(n, k) \ | ||
55 | .lockdep_map = STATIC_LOCKDEP_MAP_INIT(n, k), | ||
56 | #else | ||
57 | #define __WORK_INIT_LOCKDEP_MAP(n, k) | ||
58 | #endif | ||
59 | |||
44 | #define __WORK_INITIALIZER(n, f) { \ | 60 | #define __WORK_INITIALIZER(n, f) { \ |
45 | .data = WORK_DATA_INIT(), \ | 61 | .data = WORK_DATA_INIT(), \ |
46 | .entry = { &(n).entry, &(n).entry }, \ | 62 | .entry = { &(n).entry, &(n).entry }, \ |
47 | .func = (f), \ | 63 | .func = (f), \ |
64 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ | ||
48 | } | 65 | } |
49 | 66 | ||
50 | #define __DELAYED_WORK_INITIALIZER(n, f) { \ | 67 | #define __DELAYED_WORK_INITIALIZER(n, f) { \ |
@@ -76,12 +93,24 @@ struct execute_work { | |||
76 | * assignment of the work data initializer allows the compiler | 93 | * assignment of the work data initializer allows the compiler |
77 | * to generate better code. | 94 | * to generate better code. |
78 | */ | 95 | */ |
96 | #ifdef CONFIG_LOCKDEP | ||
97 | #define INIT_WORK(_work, _func) \ | ||
98 | do { \ | ||
99 | static struct lock_class_key __key; \ | ||
100 | \ | ||
101 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | ||
102 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ | ||
103 | INIT_LIST_HEAD(&(_work)->entry); \ | ||
104 | PREPARE_WORK((_work), (_func)); \ | ||
105 | } while (0) | ||
106 | #else | ||
79 | #define INIT_WORK(_work, _func) \ | 107 | #define INIT_WORK(_work, _func) \ |
80 | do { \ | 108 | do { \ |
81 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 109 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
82 | INIT_LIST_HEAD(&(_work)->entry); \ | 110 | INIT_LIST_HEAD(&(_work)->entry); \ |
83 | PREPARE_WORK((_work), (_func)); \ | 111 | PREPARE_WORK((_work), (_func)); \ |
84 | } while (0) | 112 | } while (0) |
113 | #endif | ||
85 | 114 | ||
86 | #define INIT_DELAYED_WORK(_work, _func) \ | 115 | #define INIT_DELAYED_WORK(_work, _func) \ |
87 | do { \ | 116 | do { \ |
@@ -118,9 +147,23 @@ struct execute_work { | |||
118 | clear_bit(WORK_STRUCT_PENDING, work_data_bits(work)) | 147 | clear_bit(WORK_STRUCT_PENDING, work_data_bits(work)) |
119 | 148 | ||
120 | 149 | ||
121 | extern struct workqueue_struct *__create_workqueue(const char *name, | 150 | extern struct workqueue_struct * |
122 | int singlethread, | 151 | __create_workqueue_key(const char *name, int singlethread, |
123 | int freezeable); | 152 | int freezeable, struct lock_class_key *key); |
153 | |||
154 | #ifdef CONFIG_LOCKDEP | ||
155 | #define __create_workqueue(name, singlethread, freezeable) \ | ||
156 | ({ \ | ||
157 | static struct lock_class_key __key; \ | ||
158 | \ | ||
159 | __create_workqueue_key((name), (singlethread), \ | ||
160 | (freezeable), &__key); \ | ||
161 | }) | ||
162 | #else | ||
163 | #define __create_workqueue(name, singlethread, freezeable) \ | ||
164 | __create_workqueue_key((name), (singlethread), (freezeable), NULL) | ||
165 | #endif | ||
166 | |||
124 | #define create_workqueue(name) __create_workqueue((name), 0, 0) | 167 | #define create_workqueue(name) __create_workqueue((name), 0, 0) |
125 | #define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1) | 168 | #define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1) |
126 | #define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0) | 169 | #define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0) |