diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 23:58:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-17 23:58:12 -0500 |
commit | 848b81415c42ff3dc9a4204749087b015c37ef66 (patch) | |
tree | 391da3a73aea48632248220d2d6b8d45a88f7eae /include | |
parent | 992956189de58cae9f2be40585bc25105cd7c5ad (diff) | |
parent | 6fd59a83b9261fa53eaf98fb5514abba504a3ea3 (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge misc patches from Andrew Morton:
"Incoming:
- lots of misc stuff
- backlight tree updates
- lib/ updates
- Oleg's percpu-rwsem changes
- checkpatch
- rtc
- aoe
- more checkpoint/restart support
I still have a pile of MM stuff pending - Pekka should be merging
later today after which that is good to go. A number of other things
are twiddling thumbs awaiting maintainer merges."
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (180 commits)
scatterlist: don't BUG when we can trivially return a proper error.
docs: update documentation about /proc/<pid>/fdinfo/<fd> fanotify output
fs, fanotify: add @mflags field to fanotify output
docs: add documentation about /proc/<pid>/fdinfo/<fd> output
fs, notify: add procfs fdinfo helper
fs, exportfs: add exportfs_encode_inode_fh() helper
fs, exportfs: escape nil dereference if no s_export_op present
fs, epoll: add procfs fdinfo helper
fs, eventfd: add procfs fdinfo helper
procfs: add ability to plug in auxiliary fdinfo providers
tools/testing/selftests/kcmp/kcmp_test.c: print reason for failure in kcmp_test
breakpoint selftests: print failure status instead of cause make error
kcmp selftests: print fail status instead of cause make error
kcmp selftests: make run_tests fix
mem-hotplug selftests: print failure status instead of cause make error
cpu-hotplug selftests: print failure status instead of cause make error
mqueue selftests: print failure status instead of cause make error
vm selftests: print failure status instead of cause make error
ubifs: use prandom_bytes
mtd: nandsim: use prandom_bytes
...
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/io.h | 12 | ||||
-rw-r--r-- | include/linux/backlight.h | 10 | ||||
-rw-r--r-- | include/linux/binfmts.h | 2 | ||||
-rw-r--r-- | include/linux/compat.h | 3 | ||||
-rw-r--r-- | include/linux/compiler.h | 2 | ||||
-rw-r--r-- | include/linux/exportfs.h | 2 | ||||
-rw-r--r-- | include/linux/fs.h | 16 | ||||
-rw-r--r-- | include/linux/ftrace.h | 4 | ||||
-rw-r--r-- | include/linux/init.h | 40 | ||||
-rw-r--r-- | include/linux/kernel.h | 33 | ||||
-rw-r--r-- | include/linux/percpu-rwsem.h | 91 | ||||
-rw-r--r-- | include/linux/platform_data/lp855x.h | 9 | ||||
-rw-r--r-- | include/linux/proc_fs.h | 3 | ||||
-rw-r--r-- | include/linux/ptrace.h | 2 | ||||
-rw-r--r-- | include/linux/random.h | 19 | ||||
-rw-r--r-- | include/linux/sched.h | 6 | ||||
-rw-r--r-- | include/linux/string.h | 11 | ||||
-rw-r--r-- | include/linux/syscalls.h | 4 | ||||
-rw-r--r-- | include/uapi/linux/ptrace.h | 5 |
19 files changed, 145 insertions, 129 deletions
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h index 9e0ebe051243..d1e93284d72a 100644 --- a/include/asm-generic/io.h +++ b/include/asm-generic/io.h | |||
@@ -154,7 +154,7 @@ static inline void insb(unsigned long addr, void *buffer, int count) | |||
154 | if (count) { | 154 | if (count) { |
155 | u8 *buf = buffer; | 155 | u8 *buf = buffer; |
156 | do { | 156 | do { |
157 | u8 x = inb(addr); | 157 | u8 x = __raw_readb(addr + PCI_IOBASE); |
158 | *buf++ = x; | 158 | *buf++ = x; |
159 | } while (--count); | 159 | } while (--count); |
160 | } | 160 | } |
@@ -167,7 +167,7 @@ static inline void insw(unsigned long addr, void *buffer, int count) | |||
167 | if (count) { | 167 | if (count) { |
168 | u16 *buf = buffer; | 168 | u16 *buf = buffer; |
169 | do { | 169 | do { |
170 | u16 x = inw(addr); | 170 | u16 x = __raw_readw(addr + PCI_IOBASE); |
171 | *buf++ = x; | 171 | *buf++ = x; |
172 | } while (--count); | 172 | } while (--count); |
173 | } | 173 | } |
@@ -180,7 +180,7 @@ static inline void insl(unsigned long addr, void *buffer, int count) | |||
180 | if (count) { | 180 | if (count) { |
181 | u32 *buf = buffer; | 181 | u32 *buf = buffer; |
182 | do { | 182 | do { |
183 | u32 x = inl(addr); | 183 | u32 x = __raw_readl(addr + PCI_IOBASE); |
184 | *buf++ = x; | 184 | *buf++ = x; |
185 | } while (--count); | 185 | } while (--count); |
186 | } | 186 | } |
@@ -193,7 +193,7 @@ static inline void outsb(unsigned long addr, const void *buffer, int count) | |||
193 | if (count) { | 193 | if (count) { |
194 | const u8 *buf = buffer; | 194 | const u8 *buf = buffer; |
195 | do { | 195 | do { |
196 | outb(*buf++, addr); | 196 | __raw_writeb(*buf++, addr + PCI_IOBASE); |
197 | } while (--count); | 197 | } while (--count); |
198 | } | 198 | } |
199 | } | 199 | } |
@@ -205,7 +205,7 @@ static inline void outsw(unsigned long addr, const void *buffer, int count) | |||
205 | if (count) { | 205 | if (count) { |
206 | const u16 *buf = buffer; | 206 | const u16 *buf = buffer; |
207 | do { | 207 | do { |
208 | outw(*buf++, addr); | 208 | __raw_writew(*buf++, addr + PCI_IOBASE); |
209 | } while (--count); | 209 | } while (--count); |
210 | } | 210 | } |
211 | } | 211 | } |
@@ -217,7 +217,7 @@ static inline void outsl(unsigned long addr, const void *buffer, int count) | |||
217 | if (count) { | 217 | if (count) { |
218 | const u32 *buf = buffer; | 218 | const u32 *buf = buffer; |
219 | do { | 219 | do { |
220 | outl(*buf++, addr); | 220 | __raw_writel(*buf++, addr + PCI_IOBASE); |
221 | } while (--count); | 221 | } while (--count); |
222 | } | 222 | } |
223 | } | 223 | } |
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 5ffc6dda4675..da9a0825e007 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
@@ -134,4 +134,14 @@ struct generic_bl_info { | |||
134 | void (*kick_battery)(void); | 134 | void (*kick_battery)(void); |
135 | }; | 135 | }; |
136 | 136 | ||
137 | #ifdef CONFIG_OF | ||
138 | struct backlight_device *of_find_backlight_by_node(struct device_node *node); | ||
139 | #else | ||
140 | static inline struct backlight_device * | ||
141 | of_find_backlight_by_node(struct device_node *node) | ||
142 | { | ||
143 | return NULL; | ||
144 | } | ||
145 | #endif | ||
146 | |||
137 | #endif | 147 | #endif |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 2630c9b41a86..a4c2b565c835 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
@@ -54,8 +54,6 @@ struct linux_binprm { | |||
54 | #define BINPRM_FLAGS_EXECFD_BIT 1 | 54 | #define BINPRM_FLAGS_EXECFD_BIT 1 |
55 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) | 55 | #define BINPRM_FLAGS_EXECFD (1 << BINPRM_FLAGS_EXECFD_BIT) |
56 | 56 | ||
57 | #define BINPRM_MAX_RECURSION 4 | ||
58 | |||
59 | /* Function parameter for binfmt->coredump */ | 57 | /* Function parameter for binfmt->coredump */ |
60 | struct coredump_params { | 58 | struct coredump_params { |
61 | siginfo_t *siginfo; | 59 | siginfo_t *siginfo; |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 784ebfe63c48..e4920bd58a47 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -588,6 +588,9 @@ asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid, | |||
588 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, | 588 | asmlinkage long compat_sys_sendfile(int out_fd, int in_fd, |
589 | compat_off_t __user *offset, compat_size_t count); | 589 | compat_off_t __user *offset, compat_size_t count); |
590 | 590 | ||
591 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, | ||
592 | struct compat_timespec __user *interval); | ||
593 | |||
591 | #else | 594 | #else |
592 | 595 | ||
593 | #define is_compat_task() (0) | 596 | #define is_compat_task() (0) |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index f430e4162f41..b121554f1fe2 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -10,6 +10,7 @@ | |||
10 | # define __force __attribute__((force)) | 10 | # define __force __attribute__((force)) |
11 | # define __nocast __attribute__((nocast)) | 11 | # define __nocast __attribute__((nocast)) |
12 | # define __iomem __attribute__((noderef, address_space(2))) | 12 | # define __iomem __attribute__((noderef, address_space(2))) |
13 | # define __must_hold(x) __attribute__((context(x,1,1))) | ||
13 | # define __acquires(x) __attribute__((context(x,0,1))) | 14 | # define __acquires(x) __attribute__((context(x,0,1))) |
14 | # define __releases(x) __attribute__((context(x,1,0))) | 15 | # define __releases(x) __attribute__((context(x,1,0))) |
15 | # define __acquire(x) __context__(x,1) | 16 | # define __acquire(x) __context__(x,1) |
@@ -33,6 +34,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
33 | # define __chk_user_ptr(x) (void)0 | 34 | # define __chk_user_ptr(x) (void)0 |
34 | # define __chk_io_ptr(x) (void)0 | 35 | # define __chk_io_ptr(x) (void)0 |
35 | # define __builtin_warning(x, y...) (1) | 36 | # define __builtin_warning(x, y...) (1) |
37 | # define __must_hold(x) | ||
36 | # define __acquires(x) | 38 | # define __acquires(x) |
37 | # define __releases(x) | 39 | # define __releases(x) |
38 | # define __acquire(x) (void)0 | 40 | # define __acquire(x) (void)0 |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index 12291a7ee275..c7e6b6392ab8 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -177,6 +177,8 @@ struct export_operations { | |||
177 | int (*commit_metadata)(struct inode *inode); | 177 | int (*commit_metadata)(struct inode *inode); |
178 | }; | 178 | }; |
179 | 179 | ||
180 | extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid, | ||
181 | int *max_len, struct inode *parent); | ||
180 | extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, | 182 | extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, |
181 | int *max_len, int connectable); | 183 | int *max_len, int connectable); |
182 | extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, | 184 | extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 035521b46528..a823d4be38e7 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -44,6 +44,7 @@ struct vm_area_struct; | |||
44 | struct vfsmount; | 44 | struct vfsmount; |
45 | struct cred; | 45 | struct cred; |
46 | struct swap_info_struct; | 46 | struct swap_info_struct; |
47 | struct seq_file; | ||
47 | 48 | ||
48 | extern void __init inode_init(void); | 49 | extern void __init inode_init(void); |
49 | extern void __init inode_init_early(void); | 50 | extern void __init inode_init_early(void); |
@@ -1543,6 +1544,7 @@ struct file_operations { | |||
1543 | int (*setlease)(struct file *, long, struct file_lock **); | 1544 | int (*setlease)(struct file *, long, struct file_lock **); |
1544 | long (*fallocate)(struct file *file, int mode, loff_t offset, | 1545 | long (*fallocate)(struct file *file, int mode, loff_t offset, |
1545 | loff_t len); | 1546 | loff_t len); |
1547 | int (*show_fdinfo)(struct seq_file *m, struct file *f); | ||
1546 | }; | 1548 | }; |
1547 | 1549 | ||
1548 | struct inode_operations { | 1550 | struct inode_operations { |
@@ -1578,8 +1580,6 @@ struct inode_operations { | |||
1578 | umode_t create_mode, int *opened); | 1580 | umode_t create_mode, int *opened); |
1579 | } ____cacheline_aligned; | 1581 | } ____cacheline_aligned; |
1580 | 1582 | ||
1581 | struct seq_file; | ||
1582 | |||
1583 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | 1583 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, |
1584 | unsigned long nr_segs, unsigned long fast_segs, | 1584 | unsigned long nr_segs, unsigned long fast_segs, |
1585 | struct iovec *fast_pointer, | 1585 | struct iovec *fast_pointer, |
@@ -2288,9 +2288,9 @@ extern ino_t find_inode_number(struct dentry *, struct qstr *); | |||
2288 | #include <linux/err.h> | 2288 | #include <linux/err.h> |
2289 | 2289 | ||
2290 | /* needed for stackable file system support */ | 2290 | /* needed for stackable file system support */ |
2291 | extern loff_t default_llseek(struct file *file, loff_t offset, int origin); | 2291 | extern loff_t default_llseek(struct file *file, loff_t offset, int whence); |
2292 | 2292 | ||
2293 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | 2293 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int whence); |
2294 | 2294 | ||
2295 | extern int inode_init_always(struct super_block *, struct inode *); | 2295 | extern int inode_init_always(struct super_block *, struct inode *); |
2296 | extern void inode_init_once(struct inode *); | 2296 | extern void inode_init_once(struct inode *); |
@@ -2398,11 +2398,11 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | |||
2398 | 2398 | ||
2399 | extern void | 2399 | extern void |
2400 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 2400 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
2401 | extern loff_t noop_llseek(struct file *file, loff_t offset, int origin); | 2401 | extern loff_t noop_llseek(struct file *file, loff_t offset, int whence); |
2402 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 2402 | extern loff_t no_llseek(struct file *file, loff_t offset, int whence); |
2403 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 2403 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence); |
2404 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, | 2404 | extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, |
2405 | int origin, loff_t maxsize, loff_t eof); | 2405 | int whence, loff_t maxsize, loff_t eof); |
2406 | extern int generic_file_open(struct inode * inode, struct file * filp); | 2406 | extern int generic_file_open(struct inode * inode, struct file * filp); |
2407 | extern int nonseekable_open(struct inode * inode, struct file * filp); | 2407 | extern int nonseekable_open(struct inode * inode, struct file * filp); |
2408 | 2408 | ||
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index a52f2f4fe030..92691d85c320 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -394,7 +394,7 @@ ssize_t ftrace_filter_write(struct file *file, const char __user *ubuf, | |||
394 | size_t cnt, loff_t *ppos); | 394 | size_t cnt, loff_t *ppos); |
395 | ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | 395 | ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, |
396 | size_t cnt, loff_t *ppos); | 396 | size_t cnt, loff_t *ppos); |
397 | loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin); | 397 | loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence); |
398 | int ftrace_regex_release(struct inode *inode, struct file *file); | 398 | int ftrace_regex_release(struct inode *inode, struct file *file); |
399 | 399 | ||
400 | void __init | 400 | void __init |
@@ -559,7 +559,7 @@ static inline ssize_t ftrace_filter_write(struct file *file, const char __user * | |||
559 | size_t cnt, loff_t *ppos) { return -ENODEV; } | 559 | size_t cnt, loff_t *ppos) { return -ENODEV; } |
560 | static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, | 560 | static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, |
561 | size_t cnt, loff_t *ppos) { return -ENODEV; } | 561 | size_t cnt, loff_t *ppos) { return -ENODEV; } |
562 | static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int origin) | 562 | static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence) |
563 | { | 563 | { |
564 | return -ENODEV; | 564 | return -ENODEV; |
565 | } | 565 | } |
diff --git a/include/linux/init.h b/include/linux/init.h index f63692d6902e..a799273714ac 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -182,16 +182,16 @@ extern bool initcall_debug; | |||
182 | * can point at the same handler without causing duplicate-symbol build errors. | 182 | * can point at the same handler without causing duplicate-symbol build errors. |
183 | */ | 183 | */ |
184 | 184 | ||
185 | #define __define_initcall(level,fn,id) \ | 185 | #define __define_initcall(fn, id) \ |
186 | static initcall_t __initcall_##fn##id __used \ | 186 | static initcall_t __initcall_##fn##id __used \ |
187 | __attribute__((__section__(".initcall" level ".init"))) = fn | 187 | __attribute__((__section__(".initcall" #id ".init"))) = fn |
188 | 188 | ||
189 | /* | 189 | /* |
190 | * Early initcalls run before initializing SMP. | 190 | * Early initcalls run before initializing SMP. |
191 | * | 191 | * |
192 | * Only for built-in code, not modules. | 192 | * Only for built-in code, not modules. |
193 | */ | 193 | */ |
194 | #define early_initcall(fn) __define_initcall("early",fn,early) | 194 | #define early_initcall(fn) __define_initcall(fn, early) |
195 | 195 | ||
196 | /* | 196 | /* |
197 | * A "pure" initcall has no dependencies on anything else, and purely | 197 | * A "pure" initcall has no dependencies on anything else, and purely |
@@ -200,23 +200,23 @@ extern bool initcall_debug; | |||
200 | * This only exists for built-in code, not for modules. | 200 | * This only exists for built-in code, not for modules. |
201 | * Keep main.c:initcall_level_names[] in sync. | 201 | * Keep main.c:initcall_level_names[] in sync. |
202 | */ | 202 | */ |
203 | #define pure_initcall(fn) __define_initcall("0",fn,0) | 203 | #define pure_initcall(fn) __define_initcall(fn, 0) |
204 | 204 | ||
205 | #define core_initcall(fn) __define_initcall("1",fn,1) | 205 | #define core_initcall(fn) __define_initcall(fn, 1) |
206 | #define core_initcall_sync(fn) __define_initcall("1s",fn,1s) | 206 | #define core_initcall_sync(fn) __define_initcall(fn, 1s) |
207 | #define postcore_initcall(fn) __define_initcall("2",fn,2) | 207 | #define postcore_initcall(fn) __define_initcall(fn, 2) |
208 | #define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) | 208 | #define postcore_initcall_sync(fn) __define_initcall(fn, 2s) |
209 | #define arch_initcall(fn) __define_initcall("3",fn,3) | 209 | #define arch_initcall(fn) __define_initcall(fn, 3) |
210 | #define arch_initcall_sync(fn) __define_initcall("3s",fn,3s) | 210 | #define arch_initcall_sync(fn) __define_initcall(fn, 3s) |
211 | #define subsys_initcall(fn) __define_initcall("4",fn,4) | 211 | #define subsys_initcall(fn) __define_initcall(fn, 4) |
212 | #define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) | 212 | #define subsys_initcall_sync(fn) __define_initcall(fn, 4s) |
213 | #define fs_initcall(fn) __define_initcall("5",fn,5) | 213 | #define fs_initcall(fn) __define_initcall(fn, 5) |
214 | #define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) | 214 | #define fs_initcall_sync(fn) __define_initcall(fn, 5s) |
215 | #define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs) | 215 | #define rootfs_initcall(fn) __define_initcall(fn, rootfs) |
216 | #define device_initcall(fn) __define_initcall("6",fn,6) | 216 | #define device_initcall(fn) __define_initcall(fn, 6) |
217 | #define device_initcall_sync(fn) __define_initcall("6s",fn,6s) | 217 | #define device_initcall_sync(fn) __define_initcall(fn, 6s) |
218 | #define late_initcall(fn) __define_initcall("7",fn,7) | 218 | #define late_initcall(fn) __define_initcall(fn, 7) |
219 | #define late_initcall_sync(fn) __define_initcall("7s",fn,7s) | 219 | #define late_initcall_sync(fn) __define_initcall(fn, 7s) |
220 | 220 | ||
221 | #define __initcall(fn) device_initcall(fn) | 221 | #define __initcall(fn) device_initcall(fn) |
222 | 222 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d97ed5897447..d140e8fb075f 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -220,6 +220,23 @@ int __must_check _kstrtol(const char *s, unsigned int base, long *res); | |||
220 | 220 | ||
221 | int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res); | 221 | int __must_check kstrtoull(const char *s, unsigned int base, unsigned long long *res); |
222 | int __must_check kstrtoll(const char *s, unsigned int base, long long *res); | 222 | int __must_check kstrtoll(const char *s, unsigned int base, long long *res); |
223 | |||
224 | /** | ||
225 | * kstrtoul - convert a string to an unsigned long | ||
226 | * @s: The start of the string. The string must be null-terminated, and may also | ||
227 | * include a single newline before its terminating null. The first character | ||
228 | * may also be a plus sign, but not a minus sign. | ||
229 | * @base: The number base to use. The maximum supported base is 16. If base is | ||
230 | * given as 0, then the base of the string is automatically detected with the | ||
231 | * conventional semantics - If it begins with 0x the number will be parsed as a | ||
232 | * hexadecimal (case insensitive), if it otherwise begins with 0, it will be | ||
233 | * parsed as an octal number. Otherwise it will be parsed as a decimal. | ||
234 | * @res: Where to write the result of the conversion on success. | ||
235 | * | ||
236 | * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error. | ||
237 | * Used as a replacement for the obsolete simple_strtoull. Return code must | ||
238 | * be checked. | ||
239 | */ | ||
223 | static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res) | 240 | static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res) |
224 | { | 241 | { |
225 | /* | 242 | /* |
@@ -233,6 +250,22 @@ static inline int __must_check kstrtoul(const char *s, unsigned int base, unsign | |||
233 | return _kstrtoul(s, base, res); | 250 | return _kstrtoul(s, base, res); |
234 | } | 251 | } |
235 | 252 | ||
253 | /** | ||
254 | * kstrtol - convert a string to a long | ||
255 | * @s: The start of the string. The string must be null-terminated, and may also | ||
256 | * include a single newline before its terminating null. The first character | ||
257 | * may also be a plus sign or a minus sign. | ||
258 | * @base: The number base to use. The maximum supported base is 16. If base is | ||
259 | * given as 0, then the base of the string is automatically detected with the | ||
260 | * conventional semantics - If it begins with 0x the number will be parsed as a | ||
261 | * hexadecimal (case insensitive), if it otherwise begins with 0, it will be | ||
262 | * parsed as an octal number. Otherwise it will be parsed as a decimal. | ||
263 | * @res: Where to write the result of the conversion on success. | ||
264 | * | ||
265 | * Returns 0 on success, -ERANGE on overflow and -EINVAL on parsing error. | ||
266 | * Used as a replacement for the obsolete simple_strtoull. Return code must | ||
267 | * be checked. | ||
268 | */ | ||
236 | static inline int __must_check kstrtol(const char *s, unsigned int base, long *res) | 269 | static inline int __must_check kstrtol(const char *s, unsigned int base, long *res) |
237 | { | 270 | { |
238 | /* | 271 | /* |
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index bd1e86071e57..3e88c9a7d57f 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h | |||
@@ -1,83 +1,34 @@ | |||
1 | #ifndef _LINUX_PERCPU_RWSEM_H | 1 | #ifndef _LINUX_PERCPU_RWSEM_H |
2 | #define _LINUX_PERCPU_RWSEM_H | 2 | #define _LINUX_PERCPU_RWSEM_H |
3 | 3 | ||
4 | #include <linux/mutex.h> | 4 | #include <linux/atomic.h> |
5 | #include <linux/rwsem.h> | ||
5 | #include <linux/percpu.h> | 6 | #include <linux/percpu.h> |
6 | #include <linux/rcupdate.h> | 7 | #include <linux/wait.h> |
7 | #include <linux/delay.h> | 8 | #include <linux/lockdep.h> |
8 | 9 | ||
9 | struct percpu_rw_semaphore { | 10 | struct percpu_rw_semaphore { |
10 | unsigned __percpu *counters; | 11 | unsigned int __percpu *fast_read_ctr; |
11 | bool locked; | 12 | atomic_t write_ctr; |
12 | struct mutex mtx; | 13 | struct rw_semaphore rw_sem; |
14 | atomic_t slow_read_ctr; | ||
15 | wait_queue_head_t write_waitq; | ||
13 | }; | 16 | }; |
14 | 17 | ||
15 | #define light_mb() barrier() | 18 | extern void percpu_down_read(struct percpu_rw_semaphore *); |
16 | #define heavy_mb() synchronize_sched_expedited() | 19 | extern void percpu_up_read(struct percpu_rw_semaphore *); |
17 | 20 | ||
18 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) | 21 | extern void percpu_down_write(struct percpu_rw_semaphore *); |
19 | { | 22 | extern void percpu_up_write(struct percpu_rw_semaphore *); |
20 | rcu_read_lock_sched(); | ||
21 | if (unlikely(p->locked)) { | ||
22 | rcu_read_unlock_sched(); | ||
23 | mutex_lock(&p->mtx); | ||
24 | this_cpu_inc(*p->counters); | ||
25 | mutex_unlock(&p->mtx); | ||
26 | return; | ||
27 | } | ||
28 | this_cpu_inc(*p->counters); | ||
29 | rcu_read_unlock_sched(); | ||
30 | light_mb(); /* A, between read of p->locked and read of data, paired with D */ | ||
31 | } | ||
32 | 23 | ||
33 | static inline void percpu_up_read(struct percpu_rw_semaphore *p) | 24 | extern int __percpu_init_rwsem(struct percpu_rw_semaphore *, |
34 | { | 25 | const char *, struct lock_class_key *); |
35 | light_mb(); /* B, between read of the data and write to p->counter, paired with C */ | 26 | extern void percpu_free_rwsem(struct percpu_rw_semaphore *); |
36 | this_cpu_dec(*p->counters); | ||
37 | } | ||
38 | 27 | ||
39 | static inline unsigned __percpu_count(unsigned __percpu *counters) | 28 | #define percpu_init_rwsem(brw) \ |
40 | { | 29 | ({ \ |
41 | unsigned total = 0; | 30 | static struct lock_class_key rwsem_key; \ |
42 | int cpu; | 31 | __percpu_init_rwsem(brw, #brw, &rwsem_key); \ |
43 | 32 | }) | |
44 | for_each_possible_cpu(cpu) | ||
45 | total += ACCESS_ONCE(*per_cpu_ptr(counters, cpu)); | ||
46 | |||
47 | return total; | ||
48 | } | ||
49 | |||
50 | static inline void percpu_down_write(struct percpu_rw_semaphore *p) | ||
51 | { | ||
52 | mutex_lock(&p->mtx); | ||
53 | p->locked = true; | ||
54 | synchronize_sched_expedited(); /* make sure that all readers exit the rcu_read_lock_sched region */ | ||
55 | while (__percpu_count(p->counters)) | ||
56 | msleep(1); | ||
57 | heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ | ||
58 | } | ||
59 | |||
60 | static inline void percpu_up_write(struct percpu_rw_semaphore *p) | ||
61 | { | ||
62 | heavy_mb(); /* D, between write to data and write to p->locked, paired with A */ | ||
63 | p->locked = false; | ||
64 | mutex_unlock(&p->mtx); | ||
65 | } | ||
66 | |||
67 | static inline int percpu_init_rwsem(struct percpu_rw_semaphore *p) | ||
68 | { | ||
69 | p->counters = alloc_percpu(unsigned); | ||
70 | if (unlikely(!p->counters)) | ||
71 | return -ENOMEM; | ||
72 | p->locked = false; | ||
73 | mutex_init(&p->mtx); | ||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | static inline void percpu_free_rwsem(struct percpu_rw_semaphore *p) | ||
78 | { | ||
79 | free_percpu(p->counters); | ||
80 | p->counters = NULL; /* catch use after free bugs */ | ||
81 | } | ||
82 | 33 | ||
83 | #endif | 34 | #endif |
diff --git a/include/linux/platform_data/lp855x.h b/include/linux/platform_data/lp855x.h index 761f31752367..e81f62d24ee2 100644 --- a/include/linux/platform_data/lp855x.h +++ b/include/linux/platform_data/lp855x.h | |||
@@ -89,11 +89,6 @@ enum lp8556_brightness_source { | |||
89 | LP8556_COMBINED2, /* pwm + i2c after the shaper block */ | 89 | LP8556_COMBINED2, /* pwm + i2c after the shaper block */ |
90 | }; | 90 | }; |
91 | 91 | ||
92 | struct lp855x_pwm_data { | ||
93 | void (*pwm_set_intensity) (int brightness, int max_brightness); | ||
94 | int (*pwm_get_intensity) (int max_brightness); | ||
95 | }; | ||
96 | |||
97 | struct lp855x_rom_data { | 92 | struct lp855x_rom_data { |
98 | u8 addr; | 93 | u8 addr; |
99 | u8 val; | 94 | u8 val; |
@@ -105,7 +100,7 @@ struct lp855x_rom_data { | |||
105 | * @mode : brightness control by pwm or lp855x register | 100 | * @mode : brightness control by pwm or lp855x register |
106 | * @device_control : value of DEVICE CONTROL register | 101 | * @device_control : value of DEVICE CONTROL register |
107 | * @initial_brightness : initial value of backlight brightness | 102 | * @initial_brightness : initial value of backlight brightness |
108 | * @pwm_data : platform specific pwm generation functions. | 103 | * @period_ns : platform specific pwm period value. unit is nano. |
109 | Only valid when mode is PWM_BASED. | 104 | Only valid when mode is PWM_BASED. |
110 | * @load_new_rom_data : | 105 | * @load_new_rom_data : |
111 | 0 : use default configuration data | 106 | 0 : use default configuration data |
@@ -118,7 +113,7 @@ struct lp855x_platform_data { | |||
118 | enum lp855x_brightness_ctrl_mode mode; | 113 | enum lp855x_brightness_ctrl_mode mode; |
119 | u8 device_control; | 114 | u8 device_control; |
120 | int initial_brightness; | 115 | int initial_brightness; |
121 | struct lp855x_pwm_data pwm_data; | 116 | unsigned int period_ns; |
122 | u8 load_new_rom_data; | 117 | u8 load_new_rom_data; |
123 | int size_program; | 118 | int size_program; |
124 | struct lp855x_rom_data *rom_data; | 119 | struct lp855x_rom_data *rom_data; |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 2e24018b7cec..32676b35d2f5 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -314,4 +314,7 @@ static inline struct net *PDE_NET(struct proc_dir_entry *pde) | |||
314 | return pde->parent->data; | 314 | return pde->parent->data; |
315 | } | 315 | } |
316 | 316 | ||
317 | #include <linux/signal.h> | ||
318 | |||
319 | void render_sigset_t(struct seq_file *m, const char *header, sigset_t *set); | ||
317 | #endif /* _LINUX_PROC_FS_H */ | 320 | #endif /* _LINUX_PROC_FS_H */ |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index a89ff04bddd9..addfbe7c180e 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -32,6 +32,8 @@ | |||
32 | #define PT_TRACE_EXIT PT_EVENT_FLAG(PTRACE_EVENT_EXIT) | 32 | #define PT_TRACE_EXIT PT_EVENT_FLAG(PTRACE_EVENT_EXIT) |
33 | #define PT_TRACE_SECCOMP PT_EVENT_FLAG(PTRACE_EVENT_SECCOMP) | 33 | #define PT_TRACE_SECCOMP PT_EVENT_FLAG(PTRACE_EVENT_SECCOMP) |
34 | 34 | ||
35 | #define PT_EXITKILL (PTRACE_O_EXITKILL << PT_OPT_FLAG_SHIFT) | ||
36 | |||
35 | /* single stepping state bits (used on ARM and PA-RISC) */ | 37 | /* single stepping state bits (used on ARM and PA-RISC) */ |
36 | #define PT_SINGLESTEP_BIT 31 | 38 | #define PT_SINGLESTEP_BIT 31 |
37 | #define PT_SINGLESTEP (1<<PT_SINGLESTEP_BIT) | 39 | #define PT_SINGLESTEP (1<<PT_SINGLESTEP_BIT) |
diff --git a/include/linux/random.h b/include/linux/random.h index 6330ed47b38b..d9846088c2c5 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -25,10 +25,19 @@ extern const struct file_operations random_fops, urandom_fops; | |||
25 | unsigned int get_random_int(void); | 25 | unsigned int get_random_int(void); |
26 | unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); | 26 | unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); |
27 | 27 | ||
28 | u32 random32(void); | 28 | u32 prandom_u32(void); |
29 | void srandom32(u32 seed); | 29 | void prandom_bytes(void *buf, int nbytes); |
30 | void prandom_seed(u32 seed); | ||
30 | 31 | ||
31 | u32 prandom32(struct rnd_state *); | 32 | /* |
33 | * These macros are preserved for backward compatibility and should be | ||
34 | * removed as soon as a transition is finished. | ||
35 | */ | ||
36 | #define random32() prandom_u32() | ||
37 | #define srandom32(seed) prandom_seed(seed) | ||
38 | |||
39 | u32 prandom_u32_state(struct rnd_state *); | ||
40 | void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); | ||
32 | 41 | ||
33 | /* | 42 | /* |
34 | * Handle minimum values for seeds | 43 | * Handle minimum values for seeds |
@@ -39,11 +48,11 @@ static inline u32 __seed(u32 x, u32 m) | |||
39 | } | 48 | } |
40 | 49 | ||
41 | /** | 50 | /** |
42 | * prandom32_seed - set seed for prandom32(). | 51 | * prandom_seed_state - set seed for prandom_u32_state(). |
43 | * @state: pointer to state structure to receive the seed. | 52 | * @state: pointer to state structure to receive the seed. |
44 | * @seed: arbitrary 64-bit value to use as a seed. | 53 | * @seed: arbitrary 64-bit value to use as a seed. |
45 | */ | 54 | */ |
46 | static inline void prandom32_seed(struct rnd_state *state, u64 seed) | 55 | static inline void prandom_seed_state(struct rnd_state *state, u64 seed) |
47 | { | 56 | { |
48 | u32 i = (seed >> 32) ^ (seed << 10) ^ seed; | 57 | u32 i = (seed >> 32) ^ (seed << 10) ^ seed; |
49 | 58 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index b089c92c609b..9914c662ed7b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1778,12 +1778,6 @@ static inline int is_global_init(struct task_struct *tsk) | |||
1778 | return tsk->pid == 1; | 1778 | return tsk->pid == 1; |
1779 | } | 1779 | } |
1780 | 1780 | ||
1781 | /* | ||
1782 | * is_container_init: | ||
1783 | * check whether in the task is init in its own pid namespace. | ||
1784 | */ | ||
1785 | extern int is_container_init(struct task_struct *tsk); | ||
1786 | |||
1787 | extern struct pid *cad_pid; | 1781 | extern struct pid *cad_pid; |
1788 | 1782 | ||
1789 | extern void free_task(struct task_struct *tsk); | 1783 | extern void free_task(struct task_struct *tsk); |
diff --git a/include/linux/string.h b/include/linux/string.h index 630125818ca8..ac889c5ea11b 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -143,4 +143,15 @@ static inline bool strstarts(const char *str, const char *prefix) | |||
143 | 143 | ||
144 | extern size_t memweight(const void *ptr, size_t bytes); | 144 | extern size_t memweight(const void *ptr, size_t bytes); |
145 | 145 | ||
146 | /** | ||
147 | * kbasename - return the last part of a pathname. | ||
148 | * | ||
149 | * @path: path to extract the filename from. | ||
150 | */ | ||
151 | static inline const char *kbasename(const char *path) | ||
152 | { | ||
153 | const char *tail = strrchr(path, '/'); | ||
154 | return tail ? tail + 1 : path; | ||
155 | } | ||
156 | |||
146 | #endif /* _LINUX_STRING_H_ */ | 157 | #endif /* _LINUX_STRING_H_ */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 91835e7f364d..36c3b07c5119 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -560,10 +560,10 @@ asmlinkage long sys_utime(char __user *filename, | |||
560 | asmlinkage long sys_utimes(char __user *filename, | 560 | asmlinkage long sys_utimes(char __user *filename, |
561 | struct timeval __user *utimes); | 561 | struct timeval __user *utimes); |
562 | asmlinkage long sys_lseek(unsigned int fd, off_t offset, | 562 | asmlinkage long sys_lseek(unsigned int fd, off_t offset, |
563 | unsigned int origin); | 563 | unsigned int whence); |
564 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, | 564 | asmlinkage long sys_llseek(unsigned int fd, unsigned long offset_high, |
565 | unsigned long offset_low, loff_t __user *result, | 565 | unsigned long offset_low, loff_t __user *result, |
566 | unsigned int origin); | 566 | unsigned int whence); |
567 | asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); | 567 | asmlinkage long sys_read(unsigned int fd, char __user *buf, size_t count); |
568 | asmlinkage long sys_readahead(int fd, loff_t offset, size_t count); | 568 | asmlinkage long sys_readahead(int fd, loff_t offset, size_t count); |
569 | asmlinkage long sys_readv(unsigned long fd, | 569 | asmlinkage long sys_readv(unsigned long fd, |
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h index 1ef6c056a9e4..022ab186a812 100644 --- a/include/uapi/linux/ptrace.h +++ b/include/uapi/linux/ptrace.h | |||
@@ -73,7 +73,10 @@ | |||
73 | #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) | 73 | #define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) |
74 | #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) | 74 | #define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) |
75 | 75 | ||
76 | #define PTRACE_O_MASK 0x000000ff | 76 | /* eventless options */ |
77 | #define PTRACE_O_EXITKILL (1 << 20) | ||
78 | |||
79 | #define PTRACE_O_MASK (0x000000ff | PTRACE_O_EXITKILL) | ||
77 | 80 | ||
78 | #include <asm/ptrace.h> | 81 | #include <asm/ptrace.h> |
79 | 82 | ||