diff options
Diffstat (limited to 'include/linux')
34 files changed, 424 insertions, 165 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index ce104e33cd22..e654fa239916 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -474,7 +474,8 @@ struct cgroup_subsys { | |||
474 | struct cgroup *old_cgrp, struct task_struct *tsk, | 474 | struct cgroup *old_cgrp, struct task_struct *tsk, |
475 | bool threadgroup); | 475 | bool threadgroup); |
476 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); | 476 | void (*fork)(struct cgroup_subsys *ss, struct task_struct *task); |
477 | void (*exit)(struct cgroup_subsys *ss, struct task_struct *task); | 477 | void (*exit)(struct cgroup_subsys *ss, struct cgroup *cgrp, |
478 | struct cgroup *old_cgrp, struct task_struct *task); | ||
478 | int (*populate)(struct cgroup_subsys *ss, | 479 | int (*populate)(struct cgroup_subsys *ss, |
479 | struct cgroup *cgrp); | 480 | struct cgroup *cgrp); |
480 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); | 481 | void (*post_clone)(struct cgroup_subsys *ss, struct cgroup *cgrp); |
@@ -626,6 +627,7 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg, | |||
626 | /* Get id and depth of css */ | 627 | /* Get id and depth of css */ |
627 | unsigned short css_id(struct cgroup_subsys_state *css); | 628 | unsigned short css_id(struct cgroup_subsys_state *css); |
628 | unsigned short css_depth(struct cgroup_subsys_state *css); | 629 | unsigned short css_depth(struct cgroup_subsys_state *css); |
630 | struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); | ||
629 | 631 | ||
630 | #else /* !CONFIG_CGROUPS */ | 632 | #else /* !CONFIG_CGROUPS */ |
631 | 633 | ||
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index ccefff02b6cb..cdbfcb8780ec 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -65,4 +65,8 @@ SUBSYS(net_cls) | |||
65 | SUBSYS(blkio) | 65 | SUBSYS(blkio) |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | #ifdef CONFIG_CGROUP_PERF | ||
69 | SUBSYS(perf) | ||
70 | #endif | ||
71 | |||
68 | /* */ | 72 | /* */ |
diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h index 597692f1fc8d..65970b811e22 100644 --- a/include/linux/debugobjects.h +++ b/include/linux/debugobjects.h | |||
@@ -34,7 +34,10 @@ struct debug_obj { | |||
34 | 34 | ||
35 | /** | 35 | /** |
36 | * struct debug_obj_descr - object type specific debug description structure | 36 | * struct debug_obj_descr - object type specific debug description structure |
37 | * | ||
37 | * @name: name of the object typee | 38 | * @name: name of the object typee |
39 | * @debug_hint: function returning address, which have associated | ||
40 | * kernel symbol, to allow identify the object | ||
38 | * @fixup_init: fixup function, which is called when the init check | 41 | * @fixup_init: fixup function, which is called when the init check |
39 | * fails | 42 | * fails |
40 | * @fixup_activate: fixup function, which is called when the activate check | 43 | * @fixup_activate: fixup function, which is called when the activate check |
@@ -46,7 +49,7 @@ struct debug_obj { | |||
46 | */ | 49 | */ |
47 | struct debug_obj_descr { | 50 | struct debug_obj_descr { |
48 | const char *name; | 51 | const char *name; |
49 | 52 | void *(*debug_hint) (void *addr); | |
50 | int (*fixup_init) (void *addr, enum debug_obj_state state); | 53 | int (*fixup_init) (void *addr, enum debug_obj_state state); |
51 | int (*fixup_activate) (void *addr, enum debug_obj_state state); | 54 | int (*fixup_activate) (void *addr, enum debug_obj_state state); |
52 | int (*fixup_destroy) (void *addr, enum debug_obj_state state); | 55 | int (*fixup_destroy) (void *addr, enum debug_obj_state state); |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 28028988c862..33a42f24b275 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -8,6 +8,9 @@ struct inode; | |||
8 | struct super_block; | 8 | struct super_block; |
9 | struct vfsmount; | 9 | struct vfsmount; |
10 | 10 | ||
11 | /* limit the handle size to NFSv4 handle size now */ | ||
12 | #define MAX_HANDLE_SZ 128 | ||
13 | |||
11 | /* | 14 | /* |
12 | * The fileid_type identifies how the file within the filesystem is encoded. | 15 | * The fileid_type identifies how the file within the filesystem is encoded. |
13 | * In theory this is freely set and parsed by the filesystem, but we try to | 16 | * In theory this is freely set and parsed by the filesystem, but we try to |
@@ -121,8 +124,10 @@ struct fid { | |||
121 | * set, the encode_fh() should store sufficient information so that a good | 124 | * set, the encode_fh() should store sufficient information so that a good |
122 | * attempt can be made to find not only the file but also it's place in the | 125 | * attempt can be made to find not only the file but also it's place in the |
123 | * filesystem. This typically means storing a reference to de->d_parent in | 126 | * filesystem. This typically means storing a reference to de->d_parent in |
124 | * the filehandle fragment. encode_fh() should return the number of bytes | 127 | * the filehandle fragment. encode_fh() should return the fileid_type on |
125 | * stored or a negative error code such as %-ENOSPC | 128 | * success and on error returns 255 (if the space needed to encode fh is |
129 | * greater than @max_len*4 bytes). On error @max_len contains the minimum | ||
130 | * size(in 4 byte unit) needed to encode the file handle. | ||
126 | * | 131 | * |
127 | * fh_to_dentry: | 132 | * fh_to_dentry: |
128 | * @fh_to_dentry is given a &struct super_block (@sb) and a file handle | 133 | * @fh_to_dentry is given a &struct super_block (@sb) and a file handle |
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h index a562fa5fb4e3..f550f894ba15 100644 --- a/include/linux/fcntl.h +++ b/include/linux/fcntl.h | |||
@@ -46,6 +46,7 @@ | |||
46 | unlinking file. */ | 46 | unlinking file. */ |
47 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ | 47 | #define AT_SYMLINK_FOLLOW 0x400 /* Follow symbolic links. */ |
48 | #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */ | 48 | #define AT_NO_AUTOMOUNT 0x800 /* Suppress terminal automount traversal */ |
49 | #define AT_EMPTY_PATH 0x1000 /* Allow empty relative pathname */ | ||
49 | 50 | ||
50 | #ifdef __KERNEL__ | 51 | #ifdef __KERNEL__ |
51 | 52 | ||
diff --git a/include/linux/file.h b/include/linux/file.h index e85baebf6279..21a79958541c 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -29,6 +29,8 @@ static inline void fput_light(struct file *file, int fput_needed) | |||
29 | 29 | ||
30 | extern struct file *fget(unsigned int fd); | 30 | extern struct file *fget(unsigned int fd); |
31 | extern struct file *fget_light(unsigned int fd, int *fput_needed); | 31 | extern struct file *fget_light(unsigned int fd, int *fput_needed); |
32 | extern struct file *fget_raw(unsigned int fd); | ||
33 | extern struct file *fget_raw_light(unsigned int fd, int *fput_needed); | ||
32 | extern void set_close_on_exec(unsigned int fd, int flag); | 34 | extern void set_close_on_exec(unsigned int fd, int flag); |
33 | extern void put_filp(struct file *); | 35 | extern void put_filp(struct file *); |
34 | extern int alloc_fd(unsigned start, unsigned flags); | 36 | extern int alloc_fd(unsigned start, unsigned flags); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index e38b50a4b9d2..13df14e2c42e 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -102,6 +102,9 @@ struct inodes_stat_t { | |||
102 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ | 102 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ |
103 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) | 103 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) |
104 | 104 | ||
105 | /* File is opened with O_PATH; almost nothing can be done with it */ | ||
106 | #define FMODE_PATH ((__force fmode_t)0x4000) | ||
107 | |||
105 | /* File was opened by fanotify and shouldn't generate fanotify events */ | 108 | /* File was opened by fanotify and shouldn't generate fanotify events */ |
106 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | 109 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) |
107 | 110 | ||
@@ -978,6 +981,13 @@ struct file { | |||
978 | #endif | 981 | #endif |
979 | }; | 982 | }; |
980 | 983 | ||
984 | struct file_handle { | ||
985 | __u32 handle_bytes; | ||
986 | int handle_type; | ||
987 | /* file identifier */ | ||
988 | unsigned char f_handle[0]; | ||
989 | }; | ||
990 | |||
981 | #define get_file(x) atomic_long_inc(&(x)->f_count) | 991 | #define get_file(x) atomic_long_inc(&(x)->f_count) |
982 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) | 992 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) |
983 | #define file_count(x) atomic_long_read(&(x)->f_count) | 993 | #define file_count(x) atomic_long_read(&(x)->f_count) |
@@ -1401,6 +1411,7 @@ struct super_block { | |||
1401 | wait_queue_head_t s_wait_unfrozen; | 1411 | wait_queue_head_t s_wait_unfrozen; |
1402 | 1412 | ||
1403 | char s_id[32]; /* Informational name */ | 1413 | char s_id[32]; /* Informational name */ |
1414 | u8 s_uuid[16]; /* UUID */ | ||
1404 | 1415 | ||
1405 | void *s_fs_info; /* Filesystem private info */ | 1416 | void *s_fs_info; /* Filesystem private info */ |
1406 | fmode_t s_mode; | 1417 | fmode_t s_mode; |
@@ -1874,6 +1885,8 @@ extern void drop_collected_mounts(struct vfsmount *); | |||
1874 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, | 1885 | extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, |
1875 | struct vfsmount *); | 1886 | struct vfsmount *); |
1876 | extern int vfs_statfs(struct path *, struct kstatfs *); | 1887 | extern int vfs_statfs(struct path *, struct kstatfs *); |
1888 | extern int user_statfs(const char __user *, struct kstatfs *); | ||
1889 | extern int fd_statfs(int, struct kstatfs *); | ||
1877 | extern int statfs_by_dentry(struct dentry *, struct kstatfs *); | 1890 | extern int statfs_by_dentry(struct dentry *, struct kstatfs *); |
1878 | extern int freeze_super(struct super_block *super); | 1891 | extern int freeze_super(struct super_block *super); |
1879 | extern int thaw_super(struct super_block *super); | 1892 | extern int thaw_super(struct super_block *super); |
@@ -1990,6 +2003,8 @@ extern int do_fallocate(struct file *file, int mode, loff_t offset, | |||
1990 | extern long do_sys_open(int dfd, const char __user *filename, int flags, | 2003 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
1991 | int mode); | 2004 | int mode); |
1992 | extern struct file *filp_open(const char *, int, int); | 2005 | extern struct file *filp_open(const char *, int, int); |
2006 | extern struct file *file_open_root(struct dentry *, struct vfsmount *, | ||
2007 | const char *, int); | ||
1993 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | 2008 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, |
1994 | const struct cred *); | 2009 | const struct cred *); |
1995 | extern int filp_close(struct file *, fl_owner_t id); | 2010 | extern int filp_close(struct file *, fl_owner_t id); |
@@ -2205,10 +2220,6 @@ extern struct file *create_read_pipe(struct file *f, int flags); | |||
2205 | extern struct file *create_write_pipe(int flags); | 2220 | extern struct file *create_write_pipe(int flags); |
2206 | extern void free_write_pipe(struct file *); | 2221 | extern void free_write_pipe(struct file *); |
2207 | 2222 | ||
2208 | extern struct file *do_filp_open(int dfd, const char *pathname, | ||
2209 | int open_flag, int mode, int acc_mode); | ||
2210 | extern int may_open(struct path *, int, int); | ||
2211 | |||
2212 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); | 2223 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
2213 | extern struct file * open_exec(const char *); | 2224 | extern struct file * open_exec(const char *); |
2214 | 2225 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index dcd6a7c3a435..ca29e03c1fac 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -428,6 +428,7 @@ extern void unregister_ftrace_graph(void); | |||
428 | 428 | ||
429 | extern void ftrace_graph_init_task(struct task_struct *t); | 429 | extern void ftrace_graph_init_task(struct task_struct *t); |
430 | extern void ftrace_graph_exit_task(struct task_struct *t); | 430 | extern void ftrace_graph_exit_task(struct task_struct *t); |
431 | extern void ftrace_graph_init_idle_task(struct task_struct *t, int cpu); | ||
431 | 432 | ||
432 | static inline int task_curr_ret_stack(struct task_struct *t) | 433 | static inline int task_curr_ret_stack(struct task_struct *t) |
433 | { | 434 | { |
@@ -451,6 +452,7 @@ static inline void unpause_graph_tracing(void) | |||
451 | 452 | ||
452 | static inline void ftrace_graph_init_task(struct task_struct *t) { } | 453 | static inline void ftrace_graph_init_task(struct task_struct *t) { } |
453 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } | 454 | static inline void ftrace_graph_exit_task(struct task_struct *t) { } |
455 | static inline void ftrace_graph_init_idle_task(struct task_struct *t, int cpu) { } | ||
454 | 456 | ||
455 | static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc, | 457 | static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc, |
456 | trace_func_graph_ent_t entryfunc) | 458 | trace_func_graph_ent_t entryfunc) |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 47e3997f7b5c..22b32af1b5ec 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -37,7 +37,6 @@ struct trace_entry { | |||
37 | unsigned char flags; | 37 | unsigned char flags; |
38 | unsigned char preempt_count; | 38 | unsigned char preempt_count; |
39 | int pid; | 39 | int pid; |
40 | int lock_depth; | ||
41 | }; | 40 | }; |
42 | 41 | ||
43 | #define FTRACE_MAX_EVENT \ | 42 | #define FTRACE_MAX_EVENT \ |
@@ -208,7 +207,6 @@ struct ftrace_event_call { | |||
208 | 207 | ||
209 | #define PERF_MAX_TRACE_SIZE 2048 | 208 | #define PERF_MAX_TRACE_SIZE 2048 |
210 | 209 | ||
211 | #define MAX_FILTER_PRED 32 | ||
212 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 210 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
213 | 211 | ||
214 | extern void destroy_preds(struct ftrace_event_call *call); | 212 | extern void destroy_preds(struct ftrace_event_call *call); |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index f376ddc64c4d..62f500c724f9 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -54,11 +54,13 @@ enum hrtimer_restart { | |||
54 | * 0x00 inactive | 54 | * 0x00 inactive |
55 | * 0x01 enqueued into rbtree | 55 | * 0x01 enqueued into rbtree |
56 | * 0x02 callback function running | 56 | * 0x02 callback function running |
57 | * 0x04 timer is migrated to another cpu | ||
57 | * | 58 | * |
58 | * Special cases: | 59 | * Special cases: |
59 | * 0x03 callback function running and enqueued | 60 | * 0x03 callback function running and enqueued |
60 | * (was requeued on another CPU) | 61 | * (was requeued on another CPU) |
61 | * 0x09 timer was migrated on CPU hotunplug | 62 | * 0x05 timer was migrated on CPU hotunplug |
63 | * | ||
62 | * The "callback function running and enqueued" status is only possible on | 64 | * The "callback function running and enqueued" status is only possible on |
63 | * SMP. It happens for example when a posix timer expired and the callback | 65 | * SMP. It happens for example when a posix timer expired and the callback |
64 | * queued a signal. Between dropping the lock which protects the posix timer | 66 | * queued a signal. Between dropping the lock which protects the posix timer |
@@ -67,8 +69,11 @@ enum hrtimer_restart { | |||
67 | * as otherwise the timer could be removed before the softirq code finishes the | 69 | * as otherwise the timer could be removed before the softirq code finishes the |
68 | * the handling of the timer. | 70 | * the handling of the timer. |
69 | * | 71 | * |
70 | * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state to | 72 | * The HRTIMER_STATE_ENQUEUED bit is always or'ed to the current state |
71 | * preserve the HRTIMER_STATE_CALLBACK bit in the above scenario. | 73 | * to preserve the HRTIMER_STATE_CALLBACK in the above scenario. This |
74 | * also affects HRTIMER_STATE_MIGRATE where the preservation is not | ||
75 | * necessary. HRTIMER_STATE_MIGRATE is cleared after the timer is | ||
76 | * enqueued on the new cpu. | ||
72 | * | 77 | * |
73 | * All state transitions are protected by cpu_base->lock. | 78 | * All state transitions are protected by cpu_base->lock. |
74 | */ | 79 | */ |
@@ -148,7 +153,12 @@ struct hrtimer_clock_base { | |||
148 | #endif | 153 | #endif |
149 | }; | 154 | }; |
150 | 155 | ||
151 | #define HRTIMER_MAX_CLOCK_BASES 2 | 156 | enum hrtimer_base_type { |
157 | HRTIMER_BASE_REALTIME, | ||
158 | HRTIMER_BASE_MONOTONIC, | ||
159 | HRTIMER_BASE_BOOTTIME, | ||
160 | HRTIMER_MAX_CLOCK_BASES, | ||
161 | }; | ||
152 | 162 | ||
153 | /* | 163 | /* |
154 | * struct hrtimer_cpu_base - the per cpu clock bases | 164 | * struct hrtimer_cpu_base - the per cpu clock bases |
@@ -308,6 +318,7 @@ static inline int hrtimer_is_hres_active(struct hrtimer *timer) | |||
308 | 318 | ||
309 | extern ktime_t ktime_get(void); | 319 | extern ktime_t ktime_get(void); |
310 | extern ktime_t ktime_get_real(void); | 320 | extern ktime_t ktime_get_real(void); |
321 | extern ktime_t ktime_get_boottime(void); | ||
311 | 322 | ||
312 | 323 | ||
313 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); | 324 | DECLARE_PER_CPU(struct tick_device, tick_cpu_device); |
@@ -370,8 +381,9 @@ extern int hrtimer_get_res(const clockid_t which_clock, struct timespec *tp); | |||
370 | extern ktime_t hrtimer_get_next_event(void); | 381 | extern ktime_t hrtimer_get_next_event(void); |
371 | 382 | ||
372 | /* | 383 | /* |
373 | * A timer is active, when it is enqueued into the rbtree or the callback | 384 | * A timer is active, when it is enqueued into the rbtree or the |
374 | * function is running. | 385 | * callback function is running or it's in the state of being migrated |
386 | * to another cpu. | ||
375 | */ | 387 | */ |
376 | static inline int hrtimer_active(const struct hrtimer *timer) | 388 | static inline int hrtimer_active(const struct hrtimer *timer) |
377 | { | 389 | { |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 55e0d4253e49..2eb16e03422f 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -55,7 +55,7 @@ | |||
55 | * Used by threaded interrupts which need to keep the | 55 | * Used by threaded interrupts which need to keep the |
56 | * irq line disabled until the threaded handler has been run. | 56 | * irq line disabled until the threaded handler has been run. |
57 | * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend | 57 | * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend |
58 | * | 58 | * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set |
59 | */ | 59 | */ |
60 | #define IRQF_DISABLED 0x00000020 | 60 | #define IRQF_DISABLED 0x00000020 |
61 | #define IRQF_SAMPLE_RANDOM 0x00000040 | 61 | #define IRQF_SAMPLE_RANDOM 0x00000040 |
@@ -67,6 +67,7 @@ | |||
67 | #define IRQF_IRQPOLL 0x00001000 | 67 | #define IRQF_IRQPOLL 0x00001000 |
68 | #define IRQF_ONESHOT 0x00002000 | 68 | #define IRQF_ONESHOT 0x00002000 |
69 | #define IRQF_NO_SUSPEND 0x00004000 | 69 | #define IRQF_NO_SUSPEND 0x00004000 |
70 | #define IRQF_FORCE_RESUME 0x00008000 | ||
70 | 71 | ||
71 | #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND) | 72 | #define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND) |
72 | 73 | ||
@@ -426,6 +427,13 @@ extern void raise_softirq(unsigned int nr); | |||
426 | */ | 427 | */ |
427 | DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); | 428 | DECLARE_PER_CPU(struct list_head [NR_SOFTIRQS], softirq_work_list); |
428 | 429 | ||
430 | DECLARE_PER_CPU(struct task_struct *, ksoftirqd); | ||
431 | |||
432 | static inline struct task_struct *this_cpu_ksoftirqd(void) | ||
433 | { | ||
434 | return this_cpu_read(ksoftirqd); | ||
435 | } | ||
436 | |||
429 | /* Try to send a softirq to a remote cpu. If this cannot be done, the | 437 | /* Try to send a softirq to a remote cpu. If this cannot be done, the |
430 | * work will be queued to the local cpu. | 438 | * work will be queued to the local cpu. |
431 | */ | 439 | */ |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 6811f4bfc6e7..922aa313c9f9 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -307,6 +307,7 @@ extern clock_t jiffies_to_clock_t(long x); | |||
307 | extern unsigned long clock_t_to_jiffies(unsigned long x); | 307 | extern unsigned long clock_t_to_jiffies(unsigned long x); |
308 | extern u64 jiffies_64_to_clock_t(u64 x); | 308 | extern u64 jiffies_64_to_clock_t(u64 x); |
309 | extern u64 nsec_to_clock_t(u64 x); | 309 | extern u64 nsec_to_clock_t(u64 x); |
310 | extern u64 nsecs_to_jiffies64(u64 n); | ||
310 | extern unsigned long nsecs_to_jiffies(u64 n); | 311 | extern unsigned long nsecs_to_jiffies(u64 n); |
311 | 312 | ||
312 | #define TIMESTAMP_SIZE 30 | 313 | #define TIMESTAMP_SIZE 30 |
diff --git a/include/linux/kthread.h b/include/linux/kthread.h index ce0775aa64c3..7ff16f7d3ed4 100644 --- a/include/linux/kthread.h +++ b/include/linux/kthread.h | |||
@@ -64,7 +64,7 @@ struct kthread_work { | |||
64 | }; | 64 | }; |
65 | 65 | ||
66 | #define KTHREAD_WORKER_INIT(worker) { \ | 66 | #define KTHREAD_WORKER_INIT(worker) { \ |
67 | .lock = SPIN_LOCK_UNLOCKED, \ | 67 | .lock = __SPIN_LOCK_UNLOCKED((worker).lock), \ |
68 | .work_list = LIST_HEAD_INIT((worker).work_list), \ | 68 | .work_list = LIST_HEAD_INIT((worker).work_list), \ |
69 | } | 69 | } |
70 | 70 | ||
diff --git a/include/linux/namei.h b/include/linux/namei.h index f276d4fa01fc..9c8603872c36 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -19,7 +19,6 @@ struct nameidata { | |||
19 | struct path path; | 19 | struct path path; |
20 | struct qstr last; | 20 | struct qstr last; |
21 | struct path root; | 21 | struct path root; |
22 | struct file *file; | ||
23 | struct inode *inode; /* path.dentry.d_inode */ | 22 | struct inode *inode; /* path.dentry.d_inode */ |
24 | unsigned int flags; | 23 | unsigned int flags; |
25 | unsigned seq; | 24 | unsigned seq; |
@@ -63,6 +62,10 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
63 | #define LOOKUP_EXCL 0x0400 | 62 | #define LOOKUP_EXCL 0x0400 |
64 | #define LOOKUP_RENAME_TARGET 0x0800 | 63 | #define LOOKUP_RENAME_TARGET 0x0800 |
65 | 64 | ||
65 | #define LOOKUP_JUMPED 0x1000 | ||
66 | #define LOOKUP_ROOT 0x2000 | ||
67 | #define LOOKUP_EMPTY 0x4000 | ||
68 | |||
66 | extern int user_path_at(int, const char __user *, unsigned, struct path *); | 69 | extern int user_path_at(int, const char __user *, unsigned, struct path *); |
67 | 70 | ||
68 | #define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) | 71 | #define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) |
@@ -72,7 +75,7 @@ extern int user_path_at(int, const char __user *, unsigned, struct path *); | |||
72 | 75 | ||
73 | extern int kern_path(const char *, unsigned, struct path *); | 76 | extern int kern_path(const char *, unsigned, struct path *); |
74 | 77 | ||
75 | extern int path_lookup(const char *, unsigned, struct nameidata *); | 78 | extern int kern_path_parent(const char *, struct nameidata *); |
76 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, | 79 | extern int vfs_path_lookup(struct dentry *, struct vfsmount *, |
77 | const char *, unsigned int, struct nameidata *); | 80 | const char *, unsigned int, struct nameidata *); |
78 | 81 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d971346b0340..71caf7a5e6c6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2392,6 +2392,9 @@ extern int netdev_notice(const struct net_device *dev, const char *format, ...) | |||
2392 | extern int netdev_info(const struct net_device *dev, const char *format, ...) | 2392 | extern int netdev_info(const struct net_device *dev, const char *format, ...) |
2393 | __attribute__ ((format (printf, 2, 3))); | 2393 | __attribute__ ((format (printf, 2, 3))); |
2394 | 2394 | ||
2395 | #define MODULE_ALIAS_NETDEV(device) \ | ||
2396 | MODULE_ALIAS("netdev-" device) | ||
2397 | |||
2395 | #if defined(DEBUG) | 2398 | #if defined(DEBUG) |
2396 | #define netdev_dbg(__dev, format, args...) \ | 2399 | #define netdev_dbg(__dev, format, args...) \ |
2397 | netdev_printk(KERN_DEBUG, __dev, format, ##args) | 2400 | netdev_printk(KERN_DEBUG, __dev, format, ##args) |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index b197563913bf..3e112de12d8d 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -68,11 +68,7 @@ struct nfs_client { | |||
68 | unsigned char cl_id_uniquifier; | 68 | unsigned char cl_id_uniquifier; |
69 | u32 cl_cb_ident; /* v4.0 callback identifier */ | 69 | u32 cl_cb_ident; /* v4.0 callback identifier */ |
70 | const struct nfs4_minor_version_ops *cl_mvops; | 70 | const struct nfs4_minor_version_ops *cl_mvops; |
71 | #endif /* CONFIG_NFS_V4 */ | ||
72 | 71 | ||
73 | #ifdef CONFIG_NFS_V4_1 | ||
74 | /* clientid returned from EXCHANGE_ID, used by session operations */ | ||
75 | u64 cl_ex_clid; | ||
76 | /* The sequence id to use for the next CREATE_SESSION */ | 72 | /* The sequence id to use for the next CREATE_SESSION */ |
77 | u32 cl_seqid; | 73 | u32 cl_seqid; |
78 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ | 74 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ |
@@ -80,7 +76,7 @@ struct nfs_client { | |||
80 | struct nfs4_session *cl_session; /* sharred session */ | 76 | struct nfs4_session *cl_session; /* sharred session */ |
81 | struct list_head cl_layouts; | 77 | struct list_head cl_layouts; |
82 | struct pnfs_deviceid_cache *cl_devid_cache; /* pNFS deviceid cache */ | 78 | struct pnfs_deviceid_cache *cl_devid_cache; /* pNFS deviceid cache */ |
83 | #endif /* CONFIG_NFS_V4_1 */ | 79 | #endif /* CONFIG_NFS_V4 */ |
84 | 80 | ||
85 | #ifdef CONFIG_NFS_FSCACHE | 81 | #ifdef CONFIG_NFS_FSCACHE |
86 | struct fscache_cookie *fscache; /* client index cache cookie */ | 82 | struct fscache_cookie *fscache; /* client index cache cookie */ |
@@ -185,7 +181,7 @@ struct nfs_server { | |||
185 | /* maximum number of slots to use */ | 181 | /* maximum number of slots to use */ |
186 | #define NFS4_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE | 182 | #define NFS4_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE |
187 | 183 | ||
188 | #if defined(CONFIG_NFS_V4_1) | 184 | #if defined(CONFIG_NFS_V4) |
189 | 185 | ||
190 | /* Sessions */ | 186 | /* Sessions */ |
191 | #define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long))) | 187 | #define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long))) |
@@ -225,5 +221,5 @@ struct nfs4_session { | |||
225 | struct nfs_client *clp; | 221 | struct nfs_client *clp; |
226 | }; | 222 | }; |
227 | 223 | ||
228 | #endif /* CONFIG_NFS_V4_1 */ | 224 | #endif /* CONFIG_NFS_V4 */ |
229 | #endif | 225 | #endif |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index dda5b0a3ff60..614615b8d42b 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -225,8 +225,14 @@ struct perf_event_attr { | |||
225 | }; | 225 | }; |
226 | 226 | ||
227 | __u32 bp_type; | 227 | __u32 bp_type; |
228 | __u64 bp_addr; | 228 | union { |
229 | __u64 bp_len; | 229 | __u64 bp_addr; |
230 | __u64 config1; /* extension of config */ | ||
231 | }; | ||
232 | union { | ||
233 | __u64 bp_len; | ||
234 | __u64 config2; /* extension of config1 */ | ||
235 | }; | ||
230 | }; | 236 | }; |
231 | 237 | ||
232 | /* | 238 | /* |
@@ -464,6 +470,7 @@ enum perf_callchain_context { | |||
464 | 470 | ||
465 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | 471 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) |
466 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | 472 | #define PERF_FLAG_FD_OUTPUT (1U << 1) |
473 | #define PERF_FLAG_PID_CGROUP (1U << 2) /* pid=cgroup id, per-cpu mode only */ | ||
467 | 474 | ||
468 | #ifdef __KERNEL__ | 475 | #ifdef __KERNEL__ |
469 | /* | 476 | /* |
@@ -471,6 +478,7 @@ enum perf_callchain_context { | |||
471 | */ | 478 | */ |
472 | 479 | ||
473 | #ifdef CONFIG_PERF_EVENTS | 480 | #ifdef CONFIG_PERF_EVENTS |
481 | # include <linux/cgroup.h> | ||
474 | # include <asm/perf_event.h> | 482 | # include <asm/perf_event.h> |
475 | # include <asm/local64.h> | 483 | # include <asm/local64.h> |
476 | #endif | 484 | #endif |
@@ -539,6 +547,9 @@ struct hw_perf_event { | |||
539 | unsigned long event_base; | 547 | unsigned long event_base; |
540 | int idx; | 548 | int idx; |
541 | int last_cpu; | 549 | int last_cpu; |
550 | unsigned int extra_reg; | ||
551 | u64 extra_config; | ||
552 | int extra_alloc; | ||
542 | }; | 553 | }; |
543 | struct { /* software */ | 554 | struct { /* software */ |
544 | struct hrtimer hrtimer; | 555 | struct hrtimer hrtimer; |
@@ -716,6 +727,22 @@ struct swevent_hlist { | |||
716 | #define PERF_ATTACH_GROUP 0x02 | 727 | #define PERF_ATTACH_GROUP 0x02 |
717 | #define PERF_ATTACH_TASK 0x04 | 728 | #define PERF_ATTACH_TASK 0x04 |
718 | 729 | ||
730 | #ifdef CONFIG_CGROUP_PERF | ||
731 | /* | ||
732 | * perf_cgroup_info keeps track of time_enabled for a cgroup. | ||
733 | * This is a per-cpu dynamically allocated data structure. | ||
734 | */ | ||
735 | struct perf_cgroup_info { | ||
736 | u64 time; | ||
737 | u64 timestamp; | ||
738 | }; | ||
739 | |||
740 | struct perf_cgroup { | ||
741 | struct cgroup_subsys_state css; | ||
742 | struct perf_cgroup_info *info; /* timing info, one per cpu */ | ||
743 | }; | ||
744 | #endif | ||
745 | |||
719 | /** | 746 | /** |
720 | * struct perf_event - performance event kernel representation: | 747 | * struct perf_event - performance event kernel representation: |
721 | */ | 748 | */ |
@@ -832,6 +859,11 @@ struct perf_event { | |||
832 | struct event_filter *filter; | 859 | struct event_filter *filter; |
833 | #endif | 860 | #endif |
834 | 861 | ||
862 | #ifdef CONFIG_CGROUP_PERF | ||
863 | struct perf_cgroup *cgrp; /* cgroup event is attach to */ | ||
864 | int cgrp_defer_enabled; | ||
865 | #endif | ||
866 | |||
835 | #endif /* CONFIG_PERF_EVENTS */ | 867 | #endif /* CONFIG_PERF_EVENTS */ |
836 | }; | 868 | }; |
837 | 869 | ||
@@ -886,6 +918,7 @@ struct perf_event_context { | |||
886 | u64 generation; | 918 | u64 generation; |
887 | int pin_count; | 919 | int pin_count; |
888 | struct rcu_head rcu_head; | 920 | struct rcu_head rcu_head; |
921 | int nr_cgroups; /* cgroup events present */ | ||
889 | }; | 922 | }; |
890 | 923 | ||
891 | /* | 924 | /* |
@@ -905,6 +938,9 @@ struct perf_cpu_context { | |||
905 | struct list_head rotation_list; | 938 | struct list_head rotation_list; |
906 | int jiffies_interval; | 939 | int jiffies_interval; |
907 | struct pmu *active_pmu; | 940 | struct pmu *active_pmu; |
941 | #ifdef CONFIG_CGROUP_PERF | ||
942 | struct perf_cgroup *cgrp; | ||
943 | #endif | ||
908 | }; | 944 | }; |
909 | 945 | ||
910 | struct perf_output_handle { | 946 | struct perf_output_handle { |
@@ -1040,11 +1076,11 @@ have_event: | |||
1040 | __perf_sw_event(event_id, nr, nmi, regs, addr); | 1076 | __perf_sw_event(event_id, nr, nmi, regs, addr); |
1041 | } | 1077 | } |
1042 | 1078 | ||
1043 | extern atomic_t perf_task_events; | 1079 | extern atomic_t perf_sched_events; |
1044 | 1080 | ||
1045 | static inline void perf_event_task_sched_in(struct task_struct *task) | 1081 | static inline void perf_event_task_sched_in(struct task_struct *task) |
1046 | { | 1082 | { |
1047 | COND_STMT(&perf_task_events, __perf_event_task_sched_in(task)); | 1083 | COND_STMT(&perf_sched_events, __perf_event_task_sched_in(task)); |
1048 | } | 1084 | } |
1049 | 1085 | ||
1050 | static inline | 1086 | static inline |
@@ -1052,7 +1088,7 @@ void perf_event_task_sched_out(struct task_struct *task, struct task_struct *nex | |||
1052 | { | 1088 | { |
1053 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); | 1089 | perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); |
1054 | 1090 | ||
1055 | COND_STMT(&perf_task_events, __perf_event_task_sched_out(task, next)); | 1091 | COND_STMT(&perf_sched_events, __perf_event_task_sched_out(task, next)); |
1056 | } | 1092 | } |
1057 | 1093 | ||
1058 | extern void perf_event_mmap(struct vm_area_struct *vma); | 1094 | extern void perf_event_mmap(struct vm_area_struct *vma); |
@@ -1083,6 +1119,10 @@ extern int sysctl_perf_event_paranoid; | |||
1083 | extern int sysctl_perf_event_mlock; | 1119 | extern int sysctl_perf_event_mlock; |
1084 | extern int sysctl_perf_event_sample_rate; | 1120 | extern int sysctl_perf_event_sample_rate; |
1085 | 1121 | ||
1122 | extern int perf_proc_update_handler(struct ctl_table *table, int write, | ||
1123 | void __user *buffer, size_t *lenp, | ||
1124 | loff_t *ppos); | ||
1125 | |||
1086 | static inline bool perf_paranoid_tracepoint_raw(void) | 1126 | static inline bool perf_paranoid_tracepoint_raw(void) |
1087 | { | 1127 | { |
1088 | return sysctl_perf_event_paranoid > -1; | 1128 | return sysctl_perf_event_paranoid > -1; |
diff --git a/include/linux/plist.h b/include/linux/plist.h index 7254eda078e5..c9b9f322c8d8 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
@@ -31,15 +31,17 @@ | |||
31 | * | 31 | * |
32 | * Simple ASCII art explanation: | 32 | * Simple ASCII art explanation: |
33 | * | 33 | * |
34 | * |HEAD | | 34 | * pl:prio_list (only for plist_node) |
35 | * | | | 35 | * nl:node_list |
36 | * |prio_list.prev|<------------------------------------| | 36 | * HEAD| NODE(S) |
37 | * |prio_list.next|<->|pl|<->|pl|<--------------->|pl|<-| | 37 | * | |
38 | * |10 | |10| |21| |21| |21| |40| (prio) | 38 | * ||------------------------------------| |
39 | * | | | | | | | | | | | | | 39 | * ||->|pl|<->|pl|<--------------->|pl|<-| |
40 | * | | | | | | | | | | | | | 40 | * | |10| |21| |21| |21| |40| (prio) |
41 | * |node_list.next|<->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<-| | 41 | * | | | | | | | | | | | |
42 | * |node_list.prev|<------------------------------------| | 42 | * | | | | | | | | | | | |
43 | * |->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<->|nl|<-| | ||
44 | * |-------------------------------------------| | ||
43 | * | 45 | * |
44 | * The nodes on the prio_list list are sorted by priority to simplify | 46 | * The nodes on the prio_list list are sorted by priority to simplify |
45 | * the insertion of new nodes. There are no nodes with duplicate | 47 | * the insertion of new nodes. There are no nodes with duplicate |
@@ -78,7 +80,6 @@ | |||
78 | #include <linux/spinlock_types.h> | 80 | #include <linux/spinlock_types.h> |
79 | 81 | ||
80 | struct plist_head { | 82 | struct plist_head { |
81 | struct list_head prio_list; | ||
82 | struct list_head node_list; | 83 | struct list_head node_list; |
83 | #ifdef CONFIG_DEBUG_PI_LIST | 84 | #ifdef CONFIG_DEBUG_PI_LIST |
84 | raw_spinlock_t *rawlock; | 85 | raw_spinlock_t *rawlock; |
@@ -88,7 +89,8 @@ struct plist_head { | |||
88 | 89 | ||
89 | struct plist_node { | 90 | struct plist_node { |
90 | int prio; | 91 | int prio; |
91 | struct plist_head plist; | 92 | struct list_head prio_list; |
93 | struct list_head node_list; | ||
92 | }; | 94 | }; |
93 | 95 | ||
94 | #ifdef CONFIG_DEBUG_PI_LIST | 96 | #ifdef CONFIG_DEBUG_PI_LIST |
@@ -100,7 +102,6 @@ struct plist_node { | |||
100 | #endif | 102 | #endif |
101 | 103 | ||
102 | #define _PLIST_HEAD_INIT(head) \ | 104 | #define _PLIST_HEAD_INIT(head) \ |
103 | .prio_list = LIST_HEAD_INIT((head).prio_list), \ | ||
104 | .node_list = LIST_HEAD_INIT((head).node_list) | 105 | .node_list = LIST_HEAD_INIT((head).node_list) |
105 | 106 | ||
106 | /** | 107 | /** |
@@ -133,7 +134,8 @@ struct plist_node { | |||
133 | #define PLIST_NODE_INIT(node, __prio) \ | 134 | #define PLIST_NODE_INIT(node, __prio) \ |
134 | { \ | 135 | { \ |
135 | .prio = (__prio), \ | 136 | .prio = (__prio), \ |
136 | .plist = { _PLIST_HEAD_INIT((node).plist) }, \ | 137 | .prio_list = LIST_HEAD_INIT((node).prio_list), \ |
138 | .node_list = LIST_HEAD_INIT((node).node_list), \ | ||
137 | } | 139 | } |
138 | 140 | ||
139 | /** | 141 | /** |
@@ -144,7 +146,6 @@ struct plist_node { | |||
144 | static inline void | 146 | static inline void |
145 | plist_head_init(struct plist_head *head, spinlock_t *lock) | 147 | plist_head_init(struct plist_head *head, spinlock_t *lock) |
146 | { | 148 | { |
147 | INIT_LIST_HEAD(&head->prio_list); | ||
148 | INIT_LIST_HEAD(&head->node_list); | 149 | INIT_LIST_HEAD(&head->node_list); |
149 | #ifdef CONFIG_DEBUG_PI_LIST | 150 | #ifdef CONFIG_DEBUG_PI_LIST |
150 | head->spinlock = lock; | 151 | head->spinlock = lock; |
@@ -160,7 +161,6 @@ plist_head_init(struct plist_head *head, spinlock_t *lock) | |||
160 | static inline void | 161 | static inline void |
161 | plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock) | 162 | plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock) |
162 | { | 163 | { |
163 | INIT_LIST_HEAD(&head->prio_list); | ||
164 | INIT_LIST_HEAD(&head->node_list); | 164 | INIT_LIST_HEAD(&head->node_list); |
165 | #ifdef CONFIG_DEBUG_PI_LIST | 165 | #ifdef CONFIG_DEBUG_PI_LIST |
166 | head->rawlock = lock; | 166 | head->rawlock = lock; |
@@ -176,7 +176,8 @@ plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock) | |||
176 | static inline void plist_node_init(struct plist_node *node, int prio) | 176 | static inline void plist_node_init(struct plist_node *node, int prio) |
177 | { | 177 | { |
178 | node->prio = prio; | 178 | node->prio = prio; |
179 | plist_head_init(&node->plist, NULL); | 179 | INIT_LIST_HEAD(&node->prio_list); |
180 | INIT_LIST_HEAD(&node->node_list); | ||
180 | } | 181 | } |
181 | 182 | ||
182 | extern void plist_add(struct plist_node *node, struct plist_head *head); | 183 | extern void plist_add(struct plist_node *node, struct plist_head *head); |
@@ -188,7 +189,7 @@ extern void plist_del(struct plist_node *node, struct plist_head *head); | |||
188 | * @head: the head for your list | 189 | * @head: the head for your list |
189 | */ | 190 | */ |
190 | #define plist_for_each(pos, head) \ | 191 | #define plist_for_each(pos, head) \ |
191 | list_for_each_entry(pos, &(head)->node_list, plist.node_list) | 192 | list_for_each_entry(pos, &(head)->node_list, node_list) |
192 | 193 | ||
193 | /** | 194 | /** |
194 | * plist_for_each_safe - iterate safely over a plist of given type | 195 | * plist_for_each_safe - iterate safely over a plist of given type |
@@ -199,7 +200,7 @@ extern void plist_del(struct plist_node *node, struct plist_head *head); | |||
199 | * Iterate over a plist of given type, safe against removal of list entry. | 200 | * Iterate over a plist of given type, safe against removal of list entry. |
200 | */ | 201 | */ |
201 | #define plist_for_each_safe(pos, n, head) \ | 202 | #define plist_for_each_safe(pos, n, head) \ |
202 | list_for_each_entry_safe(pos, n, &(head)->node_list, plist.node_list) | 203 | list_for_each_entry_safe(pos, n, &(head)->node_list, node_list) |
203 | 204 | ||
204 | /** | 205 | /** |
205 | * plist_for_each_entry - iterate over list of given type | 206 | * plist_for_each_entry - iterate over list of given type |
@@ -208,7 +209,7 @@ extern void plist_del(struct plist_node *node, struct plist_head *head); | |||
208 | * @mem: the name of the list_struct within the struct | 209 | * @mem: the name of the list_struct within the struct |
209 | */ | 210 | */ |
210 | #define plist_for_each_entry(pos, head, mem) \ | 211 | #define plist_for_each_entry(pos, head, mem) \ |
211 | list_for_each_entry(pos, &(head)->node_list, mem.plist.node_list) | 212 | list_for_each_entry(pos, &(head)->node_list, mem.node_list) |
212 | 213 | ||
213 | /** | 214 | /** |
214 | * plist_for_each_entry_safe - iterate safely over list of given type | 215 | * plist_for_each_entry_safe - iterate safely over list of given type |
@@ -220,7 +221,7 @@ extern void plist_del(struct plist_node *node, struct plist_head *head); | |||
220 | * Iterate over list of given type, safe against removal of list entry. | 221 | * Iterate over list of given type, safe against removal of list entry. |
221 | */ | 222 | */ |
222 | #define plist_for_each_entry_safe(pos, n, head, m) \ | 223 | #define plist_for_each_entry_safe(pos, n, head, m) \ |
223 | list_for_each_entry_safe(pos, n, &(head)->node_list, m.plist.node_list) | 224 | list_for_each_entry_safe(pos, n, &(head)->node_list, m.node_list) |
224 | 225 | ||
225 | /** | 226 | /** |
226 | * plist_head_empty - return !0 if a plist_head is empty | 227 | * plist_head_empty - return !0 if a plist_head is empty |
@@ -237,7 +238,7 @@ static inline int plist_head_empty(const struct plist_head *head) | |||
237 | */ | 238 | */ |
238 | static inline int plist_node_empty(const struct plist_node *node) | 239 | static inline int plist_node_empty(const struct plist_node *node) |
239 | { | 240 | { |
240 | return plist_head_empty(&node->plist); | 241 | return list_empty(&node->node_list); |
241 | } | 242 | } |
242 | 243 | ||
243 | /* All functions below assume the plist_head is not empty. */ | 244 | /* All functions below assume the plist_head is not empty. */ |
@@ -285,7 +286,7 @@ static inline int plist_node_empty(const struct plist_node *node) | |||
285 | static inline struct plist_node *plist_first(const struct plist_head *head) | 286 | static inline struct plist_node *plist_first(const struct plist_head *head) |
286 | { | 287 | { |
287 | return list_entry(head->node_list.next, | 288 | return list_entry(head->node_list.next, |
288 | struct plist_node, plist.node_list); | 289 | struct plist_node, node_list); |
289 | } | 290 | } |
290 | 291 | ||
291 | /** | 292 | /** |
@@ -297,7 +298,7 @@ static inline struct plist_node *plist_first(const struct plist_head *head) | |||
297 | static inline struct plist_node *plist_last(const struct plist_head *head) | 298 | static inline struct plist_node *plist_last(const struct plist_head *head) |
298 | { | 299 | { |
299 | return list_entry(head->node_list.prev, | 300 | return list_entry(head->node_list.prev, |
300 | struct plist_node, plist.node_list); | 301 | struct plist_node, node_list); |
301 | } | 302 | } |
302 | 303 | ||
303 | #endif | 304 | #endif |
diff --git a/include/linux/posix-clock.h b/include/linux/posix-clock.h new file mode 100644 index 000000000000..369e19d3750b --- /dev/null +++ b/include/linux/posix-clock.h | |||
@@ -0,0 +1,150 @@ | |||
1 | /* | ||
2 | * posix-clock.h - support for dynamic clock devices | ||
3 | * | ||
4 | * Copyright (C) 2010 OMICRON electronics GmbH | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | #ifndef _LINUX_POSIX_CLOCK_H_ | ||
21 | #define _LINUX_POSIX_CLOCK_H_ | ||
22 | |||
23 | #include <linux/cdev.h> | ||
24 | #include <linux/fs.h> | ||
25 | #include <linux/poll.h> | ||
26 | #include <linux/posix-timers.h> | ||
27 | |||
28 | struct posix_clock; | ||
29 | |||
30 | /** | ||
31 | * struct posix_clock_operations - functional interface to the clock | ||
32 | * | ||
33 | * Every posix clock is represented by a character device. Drivers may | ||
34 | * optionally offer extended capabilities by implementing the | ||
35 | * character device methods. The character device file operations are | ||
36 | * first handled by the clock device layer, then passed on to the | ||
37 | * driver by calling these functions. | ||
38 | * | ||
39 | * @owner: The clock driver should set to THIS_MODULE | ||
40 | * @clock_adjtime: Adjust the clock | ||
41 | * @clock_gettime: Read the current time | ||
42 | * @clock_getres: Get the clock resolution | ||
43 | * @clock_settime: Set the current time value | ||
44 | * @timer_create: Create a new timer | ||
45 | * @timer_delete: Remove a previously created timer | ||
46 | * @timer_gettime: Get remaining time and interval of a timer | ||
47 | * @timer_setttime: Set a timer's initial expiration and interval | ||
48 | * @fasync: Optional character device fasync method | ||
49 | * @mmap: Optional character device mmap method | ||
50 | * @open: Optional character device open method | ||
51 | * @release: Optional character device release method | ||
52 | * @ioctl: Optional character device ioctl method | ||
53 | * @read: Optional character device read method | ||
54 | * @poll: Optional character device poll method | ||
55 | */ | ||
56 | struct posix_clock_operations { | ||
57 | struct module *owner; | ||
58 | |||
59 | int (*clock_adjtime)(struct posix_clock *pc, struct timex *tx); | ||
60 | |||
61 | int (*clock_gettime)(struct posix_clock *pc, struct timespec *ts); | ||
62 | |||
63 | int (*clock_getres) (struct posix_clock *pc, struct timespec *ts); | ||
64 | |||
65 | int (*clock_settime)(struct posix_clock *pc, | ||
66 | const struct timespec *ts); | ||
67 | |||
68 | int (*timer_create) (struct posix_clock *pc, struct k_itimer *kit); | ||
69 | |||
70 | int (*timer_delete) (struct posix_clock *pc, struct k_itimer *kit); | ||
71 | |||
72 | void (*timer_gettime)(struct posix_clock *pc, | ||
73 | struct k_itimer *kit, struct itimerspec *tsp); | ||
74 | |||
75 | int (*timer_settime)(struct posix_clock *pc, | ||
76 | struct k_itimer *kit, int flags, | ||
77 | struct itimerspec *tsp, struct itimerspec *old); | ||
78 | /* | ||
79 | * Optional character device methods: | ||
80 | */ | ||
81 | int (*fasync) (struct posix_clock *pc, | ||
82 | int fd, struct file *file, int on); | ||
83 | |||
84 | long (*ioctl) (struct posix_clock *pc, | ||
85 | unsigned int cmd, unsigned long arg); | ||
86 | |||
87 | int (*mmap) (struct posix_clock *pc, | ||
88 | struct vm_area_struct *vma); | ||
89 | |||
90 | int (*open) (struct posix_clock *pc, fmode_t f_mode); | ||
91 | |||
92 | uint (*poll) (struct posix_clock *pc, | ||
93 | struct file *file, poll_table *wait); | ||
94 | |||
95 | int (*release) (struct posix_clock *pc); | ||
96 | |||
97 | ssize_t (*read) (struct posix_clock *pc, | ||
98 | uint flags, char __user *buf, size_t cnt); | ||
99 | }; | ||
100 | |||
101 | /** | ||
102 | * struct posix_clock - represents a dynamic posix clock | ||
103 | * | ||
104 | * @ops: Functional interface to the clock | ||
105 | * @cdev: Character device instance for this clock | ||
106 | * @kref: Reference count. | ||
107 | * @mutex: Protects the 'zombie' field from concurrent access. | ||
108 | * @zombie: If 'zombie' is true, then the hardware has disappeared. | ||
109 | * @release: A function to free the structure when the reference count reaches | ||
110 | * zero. May be NULL if structure is statically allocated. | ||
111 | * | ||
112 | * Drivers should embed their struct posix_clock within a private | ||
113 | * structure, obtaining a reference to it during callbacks using | ||
114 | * container_of(). | ||
115 | */ | ||
116 | struct posix_clock { | ||
117 | struct posix_clock_operations ops; | ||
118 | struct cdev cdev; | ||
119 | struct kref kref; | ||
120 | struct mutex mutex; | ||
121 | bool zombie; | ||
122 | void (*release)(struct posix_clock *clk); | ||
123 | }; | ||
124 | |||
125 | /** | ||
126 | * posix_clock_register() - register a new clock | ||
127 | * @clk: Pointer to the clock. Caller must provide 'ops' and 'release' | ||
128 | * @devid: Allocated device id | ||
129 | * | ||
130 | * A clock driver calls this function to register itself with the | ||
131 | * clock device subsystem. If 'clk' points to dynamically allocated | ||
132 | * memory, then the caller must provide a 'release' function to free | ||
133 | * that memory. | ||
134 | * | ||
135 | * Returns zero on success, non-zero otherwise. | ||
136 | */ | ||
137 | int posix_clock_register(struct posix_clock *clk, dev_t devid); | ||
138 | |||
139 | /** | ||
140 | * posix_clock_unregister() - unregister a clock | ||
141 | * @clk: Clock instance previously registered via posix_clock_register() | ||
142 | * | ||
143 | * A clock driver calls this function to remove itself from the clock | ||
144 | * device subsystem. The posix_clock itself will remain (in an | ||
145 | * inactive state) until its reference count drops to zero, at which | ||
146 | * point it will be deallocated with its 'release' method. | ||
147 | */ | ||
148 | void posix_clock_unregister(struct posix_clock *clk); | ||
149 | |||
150 | #endif | ||
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 3e23844a6990..d51243ae0726 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/timex.h> | ||
7 | 8 | ||
8 | union cpu_time_count { | 9 | union cpu_time_count { |
9 | cputime_t cpu; | 10 | cputime_t cpu; |
@@ -17,10 +18,21 @@ struct cpu_timer_list { | |||
17 | int firing; | 18 | int firing; |
18 | }; | 19 | }; |
19 | 20 | ||
21 | /* | ||
22 | * Bit fields within a clockid: | ||
23 | * | ||
24 | * The most significant 29 bits hold either a pid or a file descriptor. | ||
25 | * | ||
26 | * Bit 2 indicates whether a cpu clock refers to a thread or a process. | ||
27 | * | ||
28 | * Bits 1 and 0 give the type: PROF=0, VIRT=1, SCHED=2, or FD=3. | ||
29 | * | ||
30 | * A clockid is invalid if bits 2, 1, and 0 are all set. | ||
31 | */ | ||
20 | #define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3)) | 32 | #define CPUCLOCK_PID(clock) ((pid_t) ~((clock) >> 3)) |
21 | #define CPUCLOCK_PERTHREAD(clock) \ | 33 | #define CPUCLOCK_PERTHREAD(clock) \ |
22 | (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0) | 34 | (((clock) & (clockid_t) CPUCLOCK_PERTHREAD_MASK) != 0) |
23 | #define CPUCLOCK_PID_MASK 7 | 35 | |
24 | #define CPUCLOCK_PERTHREAD_MASK 4 | 36 | #define CPUCLOCK_PERTHREAD_MASK 4 |
25 | #define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK) | 37 | #define CPUCLOCK_WHICH(clock) ((clock) & (clockid_t) CPUCLOCK_CLOCK_MASK) |
26 | #define CPUCLOCK_CLOCK_MASK 3 | 38 | #define CPUCLOCK_CLOCK_MASK 3 |
@@ -28,12 +40,17 @@ struct cpu_timer_list { | |||
28 | #define CPUCLOCK_VIRT 1 | 40 | #define CPUCLOCK_VIRT 1 |
29 | #define CPUCLOCK_SCHED 2 | 41 | #define CPUCLOCK_SCHED 2 |
30 | #define CPUCLOCK_MAX 3 | 42 | #define CPUCLOCK_MAX 3 |
43 | #define CLOCKFD CPUCLOCK_MAX | ||
44 | #define CLOCKFD_MASK (CPUCLOCK_PERTHREAD_MASK|CPUCLOCK_CLOCK_MASK) | ||
31 | 45 | ||
32 | #define MAKE_PROCESS_CPUCLOCK(pid, clock) \ | 46 | #define MAKE_PROCESS_CPUCLOCK(pid, clock) \ |
33 | ((~(clockid_t) (pid) << 3) | (clockid_t) (clock)) | 47 | ((~(clockid_t) (pid) << 3) | (clockid_t) (clock)) |
34 | #define MAKE_THREAD_CPUCLOCK(tid, clock) \ | 48 | #define MAKE_THREAD_CPUCLOCK(tid, clock) \ |
35 | MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK) | 49 | MAKE_PROCESS_CPUCLOCK((tid), (clock) | CPUCLOCK_PERTHREAD_MASK) |
36 | 50 | ||
51 | #define FD_TO_CLOCKID(fd) ((~(clockid_t) (fd) << 3) | CLOCKFD) | ||
52 | #define CLOCKID_TO_FD(clk) ((unsigned int) ~((clk) >> 3)) | ||
53 | |||
37 | /* POSIX.1b interval timer structure. */ | 54 | /* POSIX.1b interval timer structure. */ |
38 | struct k_itimer { | 55 | struct k_itimer { |
39 | struct list_head list; /* free/ allocate list */ | 56 | struct list_head list; /* free/ allocate list */ |
@@ -67,10 +84,11 @@ struct k_itimer { | |||
67 | }; | 84 | }; |
68 | 85 | ||
69 | struct k_clock { | 86 | struct k_clock { |
70 | int res; /* in nanoseconds */ | ||
71 | int (*clock_getres) (const clockid_t which_clock, struct timespec *tp); | 87 | int (*clock_getres) (const clockid_t which_clock, struct timespec *tp); |
72 | int (*clock_set) (const clockid_t which_clock, struct timespec * tp); | 88 | int (*clock_set) (const clockid_t which_clock, |
89 | const struct timespec *tp); | ||
73 | int (*clock_get) (const clockid_t which_clock, struct timespec * tp); | 90 | int (*clock_get) (const clockid_t which_clock, struct timespec * tp); |
91 | int (*clock_adj) (const clockid_t which_clock, struct timex *tx); | ||
74 | int (*timer_create) (struct k_itimer *timer); | 92 | int (*timer_create) (struct k_itimer *timer); |
75 | int (*nsleep) (const clockid_t which_clock, int flags, | 93 | int (*nsleep) (const clockid_t which_clock, int flags, |
76 | struct timespec *, struct timespec __user *); | 94 | struct timespec *, struct timespec __user *); |
@@ -84,28 +102,14 @@ struct k_clock { | |||
84 | struct itimerspec * cur_setting); | 102 | struct itimerspec * cur_setting); |
85 | }; | 103 | }; |
86 | 104 | ||
87 | void register_posix_clock(const clockid_t clock_id, struct k_clock *new_clock); | 105 | extern struct k_clock clock_posix_cpu; |
106 | extern struct k_clock clock_posix_dynamic; | ||
88 | 107 | ||
89 | /* error handlers for timer_create, nanosleep and settime */ | 108 | void posix_timers_register_clock(const clockid_t clock_id, struct k_clock *new_clock); |
90 | int do_posix_clock_nonanosleep(const clockid_t, int flags, struct timespec *, | ||
91 | struct timespec __user *); | ||
92 | int do_posix_clock_nosettime(const clockid_t, struct timespec *tp); | ||
93 | 109 | ||
94 | /* function to call to trigger timer event */ | 110 | /* function to call to trigger timer event */ |
95 | int posix_timer_event(struct k_itimer *timr, int si_private); | 111 | int posix_timer_event(struct k_itimer *timr, int si_private); |
96 | 112 | ||
97 | int posix_cpu_clock_getres(const clockid_t which_clock, struct timespec *ts); | ||
98 | int posix_cpu_clock_get(const clockid_t which_clock, struct timespec *ts); | ||
99 | int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts); | ||
100 | int posix_cpu_timer_create(struct k_itimer *timer); | ||
101 | int posix_cpu_nsleep(const clockid_t which_clock, int flags, | ||
102 | struct timespec *rqtp, struct timespec __user *rmtp); | ||
103 | long posix_cpu_nsleep_restart(struct restart_block *restart_block); | ||
104 | int posix_cpu_timer_set(struct k_itimer *timer, int flags, | ||
105 | struct itimerspec *new, struct itimerspec *old); | ||
106 | int posix_cpu_timer_del(struct k_itimer *timer); | ||
107 | void posix_cpu_timer_get(struct k_itimer *timer, struct itimerspec *itp); | ||
108 | |||
109 | void posix_cpu_timer_schedule(struct k_itimer *timer); | 113 | void posix_cpu_timer_schedule(struct k_itimer *timer); |
110 | 114 | ||
111 | void run_posix_cpu_timers(struct task_struct *task); | 115 | void run_posix_cpu_timers(struct task_struct *task); |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 8d3a2486544d..ab38ac80b0f9 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -100,6 +100,8 @@ void ring_buffer_free(struct ring_buffer *buffer); | |||
100 | 100 | ||
101 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); | 101 | int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size); |
102 | 102 | ||
103 | void ring_buffer_change_overwrite(struct ring_buffer *buffer, int val); | ||
104 | |||
103 | struct ring_buffer_event *ring_buffer_lock_reserve(struct ring_buffer *buffer, | 105 | struct ring_buffer_event *ring_buffer_lock_reserve(struct ring_buffer *buffer, |
104 | unsigned long length); | 106 | unsigned long length); |
105 | int ring_buffer_unlock_commit(struct ring_buffer *buffer, | 107 | int ring_buffer_unlock_commit(struct ring_buffer *buffer, |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 89c3e5182991..2ca7e8a78060 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -133,7 +133,6 @@ extern struct class *rtc_class; | |||
133 | * The (current) exceptions are mostly filesystem hooks: | 133 | * The (current) exceptions are mostly filesystem hooks: |
134 | * - the proc() hook for procfs | 134 | * - the proc() hook for procfs |
135 | * - non-ioctl() chardev hooks: open(), release(), read_callback() | 135 | * - non-ioctl() chardev hooks: open(), release(), read_callback() |
136 | * - periodic irq calls: irq_set_state(), irq_set_freq() | ||
137 | * | 136 | * |
138 | * REVISIT those periodic irq calls *do* have ops_lock when they're | 137 | * REVISIT those periodic irq calls *do* have ops_lock when they're |
139 | * issued through ioctl() ... | 138 | * issued through ioctl() ... |
@@ -148,11 +147,8 @@ struct rtc_class_ops { | |||
148 | int (*set_alarm)(struct device *, struct rtc_wkalrm *); | 147 | int (*set_alarm)(struct device *, struct rtc_wkalrm *); |
149 | int (*proc)(struct device *, struct seq_file *); | 148 | int (*proc)(struct device *, struct seq_file *); |
150 | int (*set_mmss)(struct device *, unsigned long secs); | 149 | int (*set_mmss)(struct device *, unsigned long secs); |
151 | int (*irq_set_state)(struct device *, int enabled); | ||
152 | int (*irq_set_freq)(struct device *, int freq); | ||
153 | int (*read_callback)(struct device *, int data); | 150 | int (*read_callback)(struct device *, int data); |
154 | int (*alarm_irq_enable)(struct device *, unsigned int enabled); | 151 | int (*alarm_irq_enable)(struct device *, unsigned int enabled); |
155 | int (*update_irq_enable)(struct device *, unsigned int enabled); | ||
156 | }; | 152 | }; |
157 | 153 | ||
158 | #define RTC_DEVICE_NAME_SIZE 20 | 154 | #define RTC_DEVICE_NAME_SIZE 20 |
@@ -227,6 +223,7 @@ extern void rtc_device_unregister(struct rtc_device *rtc); | |||
227 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); | 223 | extern int rtc_read_time(struct rtc_device *rtc, struct rtc_time *tm); |
228 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); | 224 | extern int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm); |
229 | extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs); | 225 | extern int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs); |
226 | int __rtc_read_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm); | ||
230 | extern int rtc_read_alarm(struct rtc_device *rtc, | 227 | extern int rtc_read_alarm(struct rtc_device *rtc, |
231 | struct rtc_wkalrm *alrm); | 228 | struct rtc_wkalrm *alrm); |
232 | extern int rtc_set_alarm(struct rtc_device *rtc, | 229 | extern int rtc_set_alarm(struct rtc_device *rtc, |
diff --git a/include/linux/rwlock_types.h b/include/linux/rwlock_types.h index bd31808c7d8e..cc0072e93e36 100644 --- a/include/linux/rwlock_types.h +++ b/include/linux/rwlock_types.h | |||
@@ -43,14 +43,6 @@ typedef struct { | |||
43 | RW_DEP_MAP_INIT(lockname) } | 43 | RW_DEP_MAP_INIT(lockname) } |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | /* | ||
47 | * RW_LOCK_UNLOCKED defeat lockdep state tracking and is hence | ||
48 | * deprecated. | ||
49 | * | ||
50 | * Please use DEFINE_RWLOCK() or __RW_LOCK_UNLOCKED() as appropriate. | ||
51 | */ | ||
52 | #define RW_LOCK_UNLOCKED __RW_LOCK_UNLOCKED(old_style_rw_init) | ||
53 | |||
54 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) | 46 | #define DEFINE_RWLOCK(x) rwlock_t x = __RW_LOCK_UNLOCKED(x) |
55 | 47 | ||
56 | #endif /* __LINUX_RWLOCK_TYPES_H */ | 48 | #endif /* __LINUX_RWLOCK_TYPES_H */ |
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h index bdfcc2527970..34701241b673 100644 --- a/include/linux/rwsem-spinlock.h +++ b/include/linux/rwsem-spinlock.h | |||
@@ -12,15 +12,7 @@ | |||
12 | #error "please don't include linux/rwsem-spinlock.h directly, use linux/rwsem.h instead" | 12 | #error "please don't include linux/rwsem-spinlock.h directly, use linux/rwsem.h instead" |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #include <linux/spinlock.h> | ||
16 | #include <linux/list.h> | ||
17 | |||
18 | #ifdef __KERNEL__ | 15 | #ifdef __KERNEL__ |
19 | |||
20 | #include <linux/types.h> | ||
21 | |||
22 | struct rwsem_waiter; | ||
23 | |||
24 | /* | 16 | /* |
25 | * the rw-semaphore definition | 17 | * the rw-semaphore definition |
26 | * - if activity is 0 then there are no active readers or writers | 18 | * - if activity is 0 then there are no active readers or writers |
@@ -37,28 +29,7 @@ struct rw_semaphore { | |||
37 | #endif | 29 | #endif |
38 | }; | 30 | }; |
39 | 31 | ||
40 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 32 | #define RWSEM_UNLOCKED_VALUE 0x00000000 |
41 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } | ||
42 | #else | ||
43 | # define __RWSEM_DEP_MAP_INIT(lockname) | ||
44 | #endif | ||
45 | |||
46 | #define __RWSEM_INITIALIZER(name) \ | ||
47 | { 0, __SPIN_LOCK_UNLOCKED(name.wait_lock), LIST_HEAD_INIT((name).wait_list) \ | ||
48 | __RWSEM_DEP_MAP_INIT(name) } | ||
49 | |||
50 | #define DECLARE_RWSEM(name) \ | ||
51 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | ||
52 | |||
53 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, | ||
54 | struct lock_class_key *key); | ||
55 | |||
56 | #define init_rwsem(sem) \ | ||
57 | do { \ | ||
58 | static struct lock_class_key __key; \ | ||
59 | \ | ||
60 | __init_rwsem((sem), #sem, &__key); \ | ||
61 | } while (0) | ||
62 | 33 | ||
63 | extern void __down_read(struct rw_semaphore *sem); | 34 | extern void __down_read(struct rw_semaphore *sem); |
64 | extern int __down_read_trylock(struct rw_semaphore *sem); | 35 | extern int __down_read_trylock(struct rw_semaphore *sem); |
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index efd348fe8ca7..a8afe9cd000c 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
@@ -11,6 +11,9 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/list.h> | ||
15 | #include <linux/spinlock.h> | ||
16 | |||
14 | #include <asm/system.h> | 17 | #include <asm/system.h> |
15 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
16 | 19 | ||
@@ -19,9 +22,57 @@ struct rw_semaphore; | |||
19 | #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK | 22 | #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK |
20 | #include <linux/rwsem-spinlock.h> /* use a generic implementation */ | 23 | #include <linux/rwsem-spinlock.h> /* use a generic implementation */ |
21 | #else | 24 | #else |
22 | #include <asm/rwsem.h> /* use an arch-specific implementation */ | 25 | /* All arch specific implementations share the same struct */ |
26 | struct rw_semaphore { | ||
27 | long count; | ||
28 | spinlock_t wait_lock; | ||
29 | struct list_head wait_list; | ||
30 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
31 | struct lockdep_map dep_map; | ||
32 | #endif | ||
33 | }; | ||
34 | |||
35 | extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem); | ||
36 | extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem); | ||
37 | extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *); | ||
38 | extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem); | ||
39 | |||
40 | /* Include the arch specific part */ | ||
41 | #include <asm/rwsem.h> | ||
42 | |||
43 | /* In all implementations count != 0 means locked */ | ||
44 | static inline int rwsem_is_locked(struct rw_semaphore *sem) | ||
45 | { | ||
46 | return sem->count != 0; | ||
47 | } | ||
48 | |||
49 | #endif | ||
50 | |||
51 | /* Common initializer macros and functions */ | ||
52 | |||
53 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
54 | # define __RWSEM_DEP_MAP_INIT(lockname) , .dep_map = { .name = #lockname } | ||
55 | #else | ||
56 | # define __RWSEM_DEP_MAP_INIT(lockname) | ||
23 | #endif | 57 | #endif |
24 | 58 | ||
59 | #define __RWSEM_INITIALIZER(name) \ | ||
60 | { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED(name.wait_lock), \ | ||
61 | LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } | ||
62 | |||
63 | #define DECLARE_RWSEM(name) \ | ||
64 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | ||
65 | |||
66 | extern void __init_rwsem(struct rw_semaphore *sem, const char *name, | ||
67 | struct lock_class_key *key); | ||
68 | |||
69 | #define init_rwsem(sem) \ | ||
70 | do { \ | ||
71 | static struct lock_class_key __key; \ | ||
72 | \ | ||
73 | __init_rwsem((sem), #sem, &__key); \ | ||
74 | } while (0) | ||
75 | |||
25 | /* | 76 | /* |
26 | * lock for reading | 77 | * lock for reading |
27 | */ | 78 | */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 777d8a5ed06b..c15936fe998b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1058,6 +1058,7 @@ struct sched_class { | |||
1058 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); | 1058 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags); |
1059 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); | 1059 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags); |
1060 | void (*yield_task) (struct rq *rq); | 1060 | void (*yield_task) (struct rq *rq); |
1061 | bool (*yield_to_task) (struct rq *rq, struct task_struct *p, bool preempt); | ||
1061 | 1062 | ||
1062 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); | 1063 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); |
1063 | 1064 | ||
@@ -1084,12 +1085,10 @@ struct sched_class { | |||
1084 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | 1085 | void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); |
1085 | void (*task_fork) (struct task_struct *p); | 1086 | void (*task_fork) (struct task_struct *p); |
1086 | 1087 | ||
1087 | void (*switched_from) (struct rq *this_rq, struct task_struct *task, | 1088 | void (*switched_from) (struct rq *this_rq, struct task_struct *task); |
1088 | int running); | 1089 | void (*switched_to) (struct rq *this_rq, struct task_struct *task); |
1089 | void (*switched_to) (struct rq *this_rq, struct task_struct *task, | ||
1090 | int running); | ||
1091 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, | 1090 | void (*prio_changed) (struct rq *this_rq, struct task_struct *task, |
1092 | int oldprio, int running); | 1091 | int oldprio); |
1093 | 1092 | ||
1094 | unsigned int (*get_rr_interval) (struct rq *rq, | 1093 | unsigned int (*get_rr_interval) (struct rq *rq, |
1095 | struct task_struct *task); | 1094 | struct task_struct *task); |
@@ -1715,7 +1714,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t * | |||
1715 | /* | 1714 | /* |
1716 | * Per process flags | 1715 | * Per process flags |
1717 | */ | 1716 | */ |
1718 | #define PF_KSOFTIRQD 0x00000001 /* I am ksoftirqd */ | ||
1719 | #define PF_STARTING 0x00000002 /* being created */ | 1717 | #define PF_STARTING 0x00000002 /* being created */ |
1720 | #define PF_EXITING 0x00000004 /* getting shut down */ | 1718 | #define PF_EXITING 0x00000004 /* getting shut down */ |
1721 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ | 1719 | #define PF_EXITPIDONE 0x00000008 /* pi exit done on shut down */ |
@@ -1945,8 +1943,6 @@ int sched_rt_handler(struct ctl_table *table, int write, | |||
1945 | void __user *buffer, size_t *lenp, | 1943 | void __user *buffer, size_t *lenp, |
1946 | loff_t *ppos); | 1944 | loff_t *ppos); |
1947 | 1945 | ||
1948 | extern unsigned int sysctl_sched_compat_yield; | ||
1949 | |||
1950 | #ifdef CONFIG_SCHED_AUTOGROUP | 1946 | #ifdef CONFIG_SCHED_AUTOGROUP |
1951 | extern unsigned int sysctl_sched_autogroup_enabled; | 1947 | extern unsigned int sysctl_sched_autogroup_enabled; |
1952 | 1948 | ||
@@ -1977,6 +1973,7 @@ static inline int rt_mutex_getprio(struct task_struct *p) | |||
1977 | # define rt_mutex_adjust_pi(p) do { } while (0) | 1973 | # define rt_mutex_adjust_pi(p) do { } while (0) |
1978 | #endif | 1974 | #endif |
1979 | 1975 | ||
1976 | extern bool yield_to(struct task_struct *p, bool preempt); | ||
1980 | extern void set_user_nice(struct task_struct *p, long nice); | 1977 | extern void set_user_nice(struct task_struct *p, long nice); |
1981 | extern int task_prio(const struct task_struct *p); | 1978 | extern int task_prio(const struct task_struct *p); |
1982 | extern int task_nice(const struct task_struct *p); | 1979 | extern int task_nice(const struct task_struct *p); |
@@ -2049,7 +2046,7 @@ extern void release_uids(struct user_namespace *ns); | |||
2049 | 2046 | ||
2050 | #include <asm/current.h> | 2047 | #include <asm/current.h> |
2051 | 2048 | ||
2052 | extern void do_timer(unsigned long ticks); | 2049 | extern void xtime_update(unsigned long ticks); |
2053 | 2050 | ||
2054 | extern int wake_up_state(struct task_struct *tsk, unsigned int state); | 2051 | extern int wake_up_state(struct task_struct *tsk, unsigned int state); |
2055 | extern int wake_up_process(struct task_struct *tsk); | 2052 | extern int wake_up_process(struct task_struct *tsk); |
@@ -2578,13 +2575,6 @@ static inline void inc_syscw(struct task_struct *tsk) | |||
2578 | #define TASK_SIZE_OF(tsk) TASK_SIZE | 2575 | #define TASK_SIZE_OF(tsk) TASK_SIZE |
2579 | #endif | 2576 | #endif |
2580 | 2577 | ||
2581 | /* | ||
2582 | * Call the function if the target task is executing on a CPU right now: | ||
2583 | */ | ||
2584 | extern void task_oncpu_function_call(struct task_struct *p, | ||
2585 | void (*func) (void *info), void *info); | ||
2586 | |||
2587 | |||
2588 | #ifdef CONFIG_MM_OWNER | 2578 | #ifdef CONFIG_MM_OWNER |
2589 | extern void mm_update_next_owner(struct mm_struct *mm); | 2579 | extern void mm_update_next_owner(struct mm_struct *mm); |
2590 | extern void mm_init_owner(struct mm_struct *mm, struct task_struct *p); | 2580 | extern void mm_init_owner(struct mm_struct *mm, struct task_struct *p); |
diff --git a/include/linux/security.h b/include/linux/security.h index b2b7f9749f5e..debbd97db7ab 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -53,7 +53,7 @@ struct audit_krule; | |||
53 | */ | 53 | */ |
54 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, | 54 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, |
55 | int cap, int audit); | 55 | int cap, int audit); |
56 | extern int cap_settime(struct timespec *ts, struct timezone *tz); | 56 | extern int cap_settime(const struct timespec *ts, const struct timezone *tz); |
57 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); | 57 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); |
58 | extern int cap_ptrace_traceme(struct task_struct *parent); | 58 | extern int cap_ptrace_traceme(struct task_struct *parent); |
59 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 59 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
@@ -1387,7 +1387,7 @@ struct security_operations { | |||
1387 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); | 1387 | int (*quotactl) (int cmds, int type, int id, struct super_block *sb); |
1388 | int (*quota_on) (struct dentry *dentry); | 1388 | int (*quota_on) (struct dentry *dentry); |
1389 | int (*syslog) (int type); | 1389 | int (*syslog) (int type); |
1390 | int (*settime) (struct timespec *ts, struct timezone *tz); | 1390 | int (*settime) (const struct timespec *ts, const struct timezone *tz); |
1391 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); | 1391 | int (*vm_enough_memory) (struct mm_struct *mm, long pages); |
1392 | 1392 | ||
1393 | int (*bprm_set_creds) (struct linux_binprm *bprm); | 1393 | int (*bprm_set_creds) (struct linux_binprm *bprm); |
@@ -1669,7 +1669,7 @@ int security_sysctl(struct ctl_table *table, int op); | |||
1669 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); | 1669 | int security_quotactl(int cmds, int type, int id, struct super_block *sb); |
1670 | int security_quota_on(struct dentry *dentry); | 1670 | int security_quota_on(struct dentry *dentry); |
1671 | int security_syslog(int type); | 1671 | int security_syslog(int type); |
1672 | int security_settime(struct timespec *ts, struct timezone *tz); | 1672 | int security_settime(const struct timespec *ts, const struct timezone *tz); |
1673 | int security_vm_enough_memory(long pages); | 1673 | int security_vm_enough_memory(long pages); |
1674 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); | 1674 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
1675 | int security_vm_enough_memory_kern(long pages); | 1675 | int security_vm_enough_memory_kern(long pages); |
@@ -1904,7 +1904,8 @@ static inline int security_syslog(int type) | |||
1904 | return 0; | 1904 | return 0; |
1905 | } | 1905 | } |
1906 | 1906 | ||
1907 | static inline int security_settime(struct timespec *ts, struct timezone *tz) | 1907 | static inline int security_settime(const struct timespec *ts, |
1908 | const struct timezone *tz) | ||
1908 | { | 1909 | { |
1909 | return cap_settime(ts, tz); | 1910 | return cap_settime(ts, tz); |
1910 | } | 1911 | } |
diff --git a/include/linux/spinlock_types.h b/include/linux/spinlock_types.h index 851b7783720d..73548eb13a5d 100644 --- a/include/linux/spinlock_types.h +++ b/include/linux/spinlock_types.h | |||
@@ -81,14 +81,6 @@ typedef struct spinlock { | |||
81 | #define __SPIN_LOCK_UNLOCKED(lockname) \ | 81 | #define __SPIN_LOCK_UNLOCKED(lockname) \ |
82 | (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname) | 82 | (spinlock_t ) __SPIN_LOCK_INITIALIZER(lockname) |
83 | 83 | ||
84 | /* | ||
85 | * SPIN_LOCK_UNLOCKED defeats lockdep state tracking and is hence | ||
86 | * deprecated. | ||
87 | * Please use DEFINE_SPINLOCK() or __SPIN_LOCK_UNLOCKED() as | ||
88 | * appropriate. | ||
89 | */ | ||
90 | #define SPIN_LOCK_UNLOCKED __SPIN_LOCK_UNLOCKED(old_style_spin_init) | ||
91 | |||
92 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) | 84 | #define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x) |
93 | 85 | ||
94 | #include <linux/rwlock_types.h> | 86 | #include <linux/rwlock_types.h> |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 88513fd8e208..d81db8012c63 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -212,6 +212,7 @@ struct rpc_task *rpc_run_task(const struct rpc_task_setup *); | |||
212 | struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | 212 | struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, |
213 | const struct rpc_call_ops *ops); | 213 | const struct rpc_call_ops *ops); |
214 | void rpc_put_task(struct rpc_task *); | 214 | void rpc_put_task(struct rpc_task *); |
215 | void rpc_put_task_async(struct rpc_task *); | ||
215 | void rpc_exit_task(struct rpc_task *); | 216 | void rpc_exit_task(struct rpc_task *); |
216 | void rpc_exit(struct rpc_task *, int); | 217 | void rpc_exit(struct rpc_task *, int); |
217 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 218 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 98664db1be47..1f5c18e6f4f1 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -62,6 +62,7 @@ struct robust_list_head; | |||
62 | struct getcpu_cache; | 62 | struct getcpu_cache; |
63 | struct old_linux_dirent; | 63 | struct old_linux_dirent; |
64 | struct perf_event_attr; | 64 | struct perf_event_attr; |
65 | struct file_handle; | ||
65 | 66 | ||
66 | #include <linux/types.h> | 67 | #include <linux/types.h> |
67 | #include <linux/aio_abi.h> | 68 | #include <linux/aio_abi.h> |
@@ -132,11 +133,11 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
132 | .class = &event_class_syscall_enter, \ | 133 | .class = &event_class_syscall_enter, \ |
133 | .event.funcs = &enter_syscall_print_funcs, \ | 134 | .event.funcs = &enter_syscall_print_funcs, \ |
134 | .data = (void *)&__syscall_meta_##sname,\ | 135 | .data = (void *)&__syscall_meta_##sname,\ |
136 | .flags = TRACE_EVENT_FL_CAP_ANY, \ | ||
135 | }; \ | 137 | }; \ |
136 | static struct ftrace_event_call __used \ | 138 | static struct ftrace_event_call __used \ |
137 | __attribute__((section("_ftrace_events"))) \ | 139 | __attribute__((section("_ftrace_events"))) \ |
138 | *__event_enter_##sname = &event_enter_##sname; \ | 140 | *__event_enter_##sname = &event_enter_##sname; |
139 | __TRACE_EVENT_FLAGS(enter_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
140 | 141 | ||
141 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 142 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
142 | static struct syscall_metadata __syscall_meta_##sname; \ | 143 | static struct syscall_metadata __syscall_meta_##sname; \ |
@@ -146,11 +147,11 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
146 | .class = &event_class_syscall_exit, \ | 147 | .class = &event_class_syscall_exit, \ |
147 | .event.funcs = &exit_syscall_print_funcs, \ | 148 | .event.funcs = &exit_syscall_print_funcs, \ |
148 | .data = (void *)&__syscall_meta_##sname,\ | 149 | .data = (void *)&__syscall_meta_##sname,\ |
150 | .flags = TRACE_EVENT_FL_CAP_ANY, \ | ||
149 | }; \ | 151 | }; \ |
150 | static struct ftrace_event_call __used \ | 152 | static struct ftrace_event_call __used \ |
151 | __attribute__((section("_ftrace_events"))) \ | 153 | __attribute__((section("_ftrace_events"))) \ |
152 | *__event_exit_##sname = &event_exit_##sname; \ | 154 | *__event_exit_##sname = &event_exit_##sname; |
153 | __TRACE_EVENT_FLAGS(exit_##sname, TRACE_EVENT_FL_CAP_ANY) | ||
154 | 155 | ||
155 | #define SYSCALL_METADATA(sname, nb) \ | 156 | #define SYSCALL_METADATA(sname, nb) \ |
156 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | 157 | SYSCALL_TRACE_ENTER_EVENT(sname); \ |
@@ -158,6 +159,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
158 | static struct syscall_metadata __used \ | 159 | static struct syscall_metadata __used \ |
159 | __syscall_meta_##sname = { \ | 160 | __syscall_meta_##sname = { \ |
160 | .name = "sys"#sname, \ | 161 | .name = "sys"#sname, \ |
162 | .syscall_nr = -1, /* Filled in at boot */ \ | ||
161 | .nb_args = nb, \ | 163 | .nb_args = nb, \ |
162 | .types = types_##sname, \ | 164 | .types = types_##sname, \ |
163 | .args = args_##sname, \ | 165 | .args = args_##sname, \ |
@@ -175,6 +177,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; | |||
175 | static struct syscall_metadata __used \ | 177 | static struct syscall_metadata __used \ |
176 | __syscall_meta__##sname = { \ | 178 | __syscall_meta__##sname = { \ |
177 | .name = "sys_"#sname, \ | 179 | .name = "sys_"#sname, \ |
180 | .syscall_nr = -1, /* Filled in at boot */ \ | ||
178 | .nb_args = 0, \ | 181 | .nb_args = 0, \ |
179 | .enter_event = &event_enter__##sname, \ | 182 | .enter_event = &event_enter__##sname, \ |
180 | .exit_event = &event_exit__##sname, \ | 183 | .exit_event = &event_exit__##sname, \ |
@@ -313,6 +316,8 @@ asmlinkage long sys_clock_settime(clockid_t which_clock, | |||
313 | const struct timespec __user *tp); | 316 | const struct timespec __user *tp); |
314 | asmlinkage long sys_clock_gettime(clockid_t which_clock, | 317 | asmlinkage long sys_clock_gettime(clockid_t which_clock, |
315 | struct timespec __user *tp); | 318 | struct timespec __user *tp); |
319 | asmlinkage long sys_clock_adjtime(clockid_t which_clock, | ||
320 | struct timex __user *tx); | ||
316 | asmlinkage long sys_clock_getres(clockid_t which_clock, | 321 | asmlinkage long sys_clock_getres(clockid_t which_clock, |
317 | struct timespec __user *tp); | 322 | struct timespec __user *tp); |
318 | asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags, | 323 | asmlinkage long sys_clock_nanosleep(clockid_t which_clock, int flags, |
@@ -832,5 +837,10 @@ asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, | |||
832 | unsigned long prot, unsigned long flags, | 837 | unsigned long prot, unsigned long flags, |
833 | unsigned long fd, unsigned long pgoff); | 838 | unsigned long fd, unsigned long pgoff); |
834 | asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg); | 839 | asmlinkage long sys_old_mmap(struct mmap_arg_struct __user *arg); |
835 | 840 | asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name, | |
841 | struct file_handle __user *handle, | ||
842 | int __user *mnt_id, int flag); | ||
843 | asmlinkage long sys_open_by_handle_at(int mountdirfd, | ||
844 | struct file_handle __user *handle, | ||
845 | int flags); | ||
836 | #endif | 846 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 7bb5cb64f3b8..11684d9e6bd2 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -930,6 +930,7 @@ enum | |||
930 | 930 | ||
931 | #ifdef __KERNEL__ | 931 | #ifdef __KERNEL__ |
932 | #include <linux/list.h> | 932 | #include <linux/list.h> |
933 | #include <linux/rcupdate.h> | ||
933 | 934 | ||
934 | /* For the /proc/sys support */ | 935 | /* For the /proc/sys support */ |
935 | struct ctl_table; | 936 | struct ctl_table; |
@@ -1037,10 +1038,15 @@ struct ctl_table_root { | |||
1037 | struct ctl_table trees. */ | 1038 | struct ctl_table trees. */ |
1038 | struct ctl_table_header | 1039 | struct ctl_table_header |
1039 | { | 1040 | { |
1040 | struct ctl_table *ctl_table; | 1041 | union { |
1041 | struct list_head ctl_entry; | 1042 | struct { |
1042 | int used; | 1043 | struct ctl_table *ctl_table; |
1043 | int count; | 1044 | struct list_head ctl_entry; |
1045 | int used; | ||
1046 | int count; | ||
1047 | }; | ||
1048 | struct rcu_head rcu; | ||
1049 | }; | ||
1044 | struct completion *unregistering; | 1050 | struct completion *unregistering; |
1045 | struct ctl_table *ctl_table_arg; | 1051 | struct ctl_table *ctl_table_arg; |
1046 | struct ctl_table_root *root; | 1052 | struct ctl_table_root *root; |
diff --git a/include/linux/thread_info.h b/include/linux/thread_info.h index c90696544176..20fc303947d3 100644 --- a/include/linux/thread_info.h +++ b/include/linux/thread_info.h | |||
@@ -18,9 +18,6 @@ struct compat_timespec; | |||
18 | struct restart_block { | 18 | struct restart_block { |
19 | long (*fn)(struct restart_block *); | 19 | long (*fn)(struct restart_block *); |
20 | union { | 20 | union { |
21 | struct { | ||
22 | unsigned long arg0, arg1, arg2, arg3; | ||
23 | }; | ||
24 | /* For futex_wait and futex_wait_requeue_pi */ | 21 | /* For futex_wait and futex_wait_requeue_pi */ |
25 | struct { | 22 | struct { |
26 | u32 __user *uaddr; | 23 | u32 __user *uaddr; |
diff --git a/include/linux/time.h b/include/linux/time.h index 1e6d3b59238d..454a26205787 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -113,8 +113,6 @@ static inline struct timespec timespec_sub(struct timespec lhs, | |||
113 | #define timespec_valid(ts) \ | 113 | #define timespec_valid(ts) \ |
114 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) | 114 | (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) |
115 | 115 | ||
116 | extern seqlock_t xtime_lock; | ||
117 | |||
118 | extern void read_persistent_clock(struct timespec *ts); | 116 | extern void read_persistent_clock(struct timespec *ts); |
119 | extern void read_boot_clock(struct timespec *ts); | 117 | extern void read_boot_clock(struct timespec *ts); |
120 | extern int update_persistent_clock(struct timespec now); | 118 | extern int update_persistent_clock(struct timespec now); |
@@ -125,8 +123,9 @@ extern int timekeeping_suspended; | |||
125 | unsigned long get_seconds(void); | 123 | unsigned long get_seconds(void); |
126 | struct timespec current_kernel_time(void); | 124 | struct timespec current_kernel_time(void); |
127 | struct timespec __current_kernel_time(void); /* does not take xtime_lock */ | 125 | struct timespec __current_kernel_time(void); /* does not take xtime_lock */ |
128 | struct timespec __get_wall_to_monotonic(void); /* does not take xtime_lock */ | ||
129 | struct timespec get_monotonic_coarse(void); | 126 | struct timespec get_monotonic_coarse(void); |
127 | void get_xtime_and_monotonic_and_sleep_offset(struct timespec *xtim, | ||
128 | struct timespec *wtom, struct timespec *sleep); | ||
130 | 129 | ||
131 | #define CURRENT_TIME (current_kernel_time()) | 130 | #define CURRENT_TIME (current_kernel_time()) |
132 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) | 131 | #define CURRENT_TIME_SEC ((struct timespec) { get_seconds(), 0 }) |
@@ -147,8 +146,9 @@ static inline u32 arch_gettimeoffset(void) { return 0; } | |||
147 | #endif | 146 | #endif |
148 | 147 | ||
149 | extern void do_gettimeofday(struct timeval *tv); | 148 | extern void do_gettimeofday(struct timeval *tv); |
150 | extern int do_settimeofday(struct timespec *tv); | 149 | extern int do_settimeofday(const struct timespec *tv); |
151 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | 150 | extern int do_sys_settimeofday(const struct timespec *tv, |
151 | const struct timezone *tz); | ||
152 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) | 152 | #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts) |
153 | extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); | 153 | extern long do_utimes(int dfd, const char __user *filename, struct timespec *times, int flags); |
154 | struct itimerval; | 154 | struct itimerval; |
@@ -162,12 +162,13 @@ extern void getnstime_raw_and_real(struct timespec *ts_raw, | |||
162 | struct timespec *ts_real); | 162 | struct timespec *ts_real); |
163 | extern void getboottime(struct timespec *ts); | 163 | extern void getboottime(struct timespec *ts); |
164 | extern void monotonic_to_bootbased(struct timespec *ts); | 164 | extern void monotonic_to_bootbased(struct timespec *ts); |
165 | extern void get_monotonic_boottime(struct timespec *ts); | ||
165 | 166 | ||
166 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 167 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
167 | extern int timekeeping_valid_for_hres(void); | 168 | extern int timekeeping_valid_for_hres(void); |
168 | extern u64 timekeeping_max_deferment(void); | 169 | extern u64 timekeeping_max_deferment(void); |
169 | extern void update_wall_time(void); | ||
170 | extern void timekeeping_leap_insert(int leapsecond); | 170 | extern void timekeeping_leap_insert(int leapsecond); |
171 | extern int timekeeping_inject_offset(struct timespec *ts); | ||
171 | 172 | ||
172 | struct tms; | 173 | struct tms; |
173 | extern void do_sys_times(struct tms *); | 174 | extern void do_sys_times(struct tms *); |
@@ -292,6 +293,7 @@ struct itimerval { | |||
292 | #define CLOCK_MONOTONIC_RAW 4 | 293 | #define CLOCK_MONOTONIC_RAW 4 |
293 | #define CLOCK_REALTIME_COARSE 5 | 294 | #define CLOCK_REALTIME_COARSE 5 |
294 | #define CLOCK_MONOTONIC_COARSE 6 | 295 | #define CLOCK_MONOTONIC_COARSE 6 |
296 | #define CLOCK_BOOTTIME 7 | ||
295 | 297 | ||
296 | /* | 298 | /* |
297 | * The IDs of various hardware clocks: | 299 | * The IDs of various hardware clocks: |
diff --git a/include/linux/timex.h b/include/linux/timex.h index d23999f9499d..aa60fe7b6ed6 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -73,7 +73,7 @@ struct timex { | |||
73 | long tolerance; /* clock frequency tolerance (ppm) | 73 | long tolerance; /* clock frequency tolerance (ppm) |
74 | * (read only) | 74 | * (read only) |
75 | */ | 75 | */ |
76 | struct timeval time; /* (read only) */ | 76 | struct timeval time; /* (read only, except for ADJ_SETOFFSET) */ |
77 | long tick; /* (modified) usecs between clock ticks */ | 77 | long tick; /* (modified) usecs between clock ticks */ |
78 | 78 | ||
79 | long ppsfreq; /* pps frequency (scaled ppm) (ro) */ | 79 | long ppsfreq; /* pps frequency (scaled ppm) (ro) */ |
@@ -102,6 +102,7 @@ struct timex { | |||
102 | #define ADJ_STATUS 0x0010 /* clock status */ | 102 | #define ADJ_STATUS 0x0010 /* clock status */ |
103 | #define ADJ_TIMECONST 0x0020 /* pll time constant */ | 103 | #define ADJ_TIMECONST 0x0020 /* pll time constant */ |
104 | #define ADJ_TAI 0x0080 /* set TAI offset */ | 104 | #define ADJ_TAI 0x0080 /* set TAI offset */ |
105 | #define ADJ_SETOFFSET 0x0100 /* add 'time' to current time */ | ||
105 | #define ADJ_MICRO 0x1000 /* select microsecond resolution */ | 106 | #define ADJ_MICRO 0x1000 /* select microsecond resolution */ |
106 | #define ADJ_NANO 0x2000 /* select nanosecond resolution */ | 107 | #define ADJ_NANO 0x2000 /* select nanosecond resolution */ |
107 | #define ADJ_TICK 0x4000 /* tick value */ | 108 | #define ADJ_TICK 0x4000 /* tick value */ |