diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 09:04:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-17 09:04:38 -0400 |
commit | 54e514b91b95d6441c12a7955addfb9f9d2afc65 (patch) | |
tree | 8b73d901bd2a6ec5a31f34a8954e5ea92216dd6c /include | |
parent | 4fc8adcfec3da639da76e8314c9ccefe5bf9a045 (diff) | |
parent | 6c8c90319c0bb1c9e0b68e721359b89ae4f28465 (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge third patchbomb from Andrew Morton:
- various misc things
- a couple of lib/ optimisations
- provide DIV_ROUND_CLOSEST_ULL()
- checkpatch updates
- rtc tree
- befs, nilfs2, hfs, hfsplus, fatfs, adfs, affs, bfs
- ptrace fixes
- fork() fixes
- seccomp cleanups
- more mmap_sem hold time reductions from Davidlohr
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (138 commits)
proc: show locks in /proc/pid/fdinfo/X
docs: add missing and new /proc/PID/status file entries, fix typos
drivers/rtc/rtc-at91rm9200.c: make IO endian agnostic
Documentation/spi/spidev_test.c: fix warning
drivers/rtc/rtc-s5m.c: allow usage on device type different than main MFD type
.gitignore: ignore *.tar
MAINTAINERS: add Mediatek SoC mailing list
tomoyo: reduce mmap_sem hold for mm->exe_file
powerpc/oprofile: reduce mmap_sem hold for exe_file
oprofile: reduce mmap_sem hold for mm->exe_file
mips: ip32: add platform data hooks to use DS1685 driver
lib/Kconfig: fix up HAVE_ARCH_BITREVERSE help text
x86: switch to using asm-generic for seccomp.h
sparc: switch to using asm-generic for seccomp.h
powerpc: switch to using asm-generic for seccomp.h
parisc: switch to using asm-generic for seccomp.h
mips: switch to using asm-generic for seccomp.h
microblaze: use asm-generic for seccomp.h
arm: use asm-generic for seccomp.h
seccomp: allow COMPAT sigreturn overrides
...
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-generic/seccomp.h | 2 | ||||
-rw-r--r-- | include/linux/bitmap.h | 8 | ||||
-rw-r--r-- | include/linux/bitops.h | 4 | ||||
-rw-r--r-- | include/linux/fs.h | 8 | ||||
-rw-r--r-- | include/linux/kconfig.h | 15 | ||||
-rw-r--r-- | include/linux/kernel.h | 12 | ||||
-rw-r--r-- | include/linux/mfd/samsung/rtc.h | 2 | ||||
-rw-r--r-- | include/linux/mm_types.h | 2 | ||||
-rw-r--r-- | include/linux/sysctl.h | 3 | ||||
-rw-r--r-- | include/linux/util_macros.h | 40 | ||||
-rw-r--r-- | include/uapi/asm-generic/errno.h | 11 |
11 files changed, 91 insertions, 16 deletions
diff --git a/include/asm-generic/seccomp.h b/include/asm-generic/seccomp.h index 9fa1f653ed3b..c9ccafa0d99a 100644 --- a/include/asm-generic/seccomp.h +++ b/include/asm-generic/seccomp.h | |||
@@ -17,7 +17,9 @@ | |||
17 | #define __NR_seccomp_read_32 __NR_read | 17 | #define __NR_seccomp_read_32 __NR_read |
18 | #define __NR_seccomp_write_32 __NR_write | 18 | #define __NR_seccomp_write_32 __NR_write |
19 | #define __NR_seccomp_exit_32 __NR_exit | 19 | #define __NR_seccomp_exit_32 __NR_exit |
20 | #ifndef __NR_seccomp_sigreturn_32 | ||
20 | #define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn | 21 | #define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn |
22 | #endif | ||
21 | #endif /* CONFIG_COMPAT && ! already defined */ | 23 | #endif /* CONFIG_COMPAT && ! already defined */ |
22 | 24 | ||
23 | #define __NR_seccomp_read __NR_read | 25 | #define __NR_seccomp_read __NR_read |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index be4fa5ddf36c..ea17cca9e685 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
@@ -283,16 +283,16 @@ static inline int bitmap_empty(const unsigned long *src, unsigned nbits) | |||
283 | { | 283 | { |
284 | if (small_const_nbits(nbits)) | 284 | if (small_const_nbits(nbits)) |
285 | return ! (*src & BITMAP_LAST_WORD_MASK(nbits)); | 285 | return ! (*src & BITMAP_LAST_WORD_MASK(nbits)); |
286 | else | 286 | |
287 | return __bitmap_empty(src, nbits); | 287 | return find_first_bit(src, nbits) == nbits; |
288 | } | 288 | } |
289 | 289 | ||
290 | static inline int bitmap_full(const unsigned long *src, unsigned int nbits) | 290 | static inline int bitmap_full(const unsigned long *src, unsigned int nbits) |
291 | { | 291 | { |
292 | if (small_const_nbits(nbits)) | 292 | if (small_const_nbits(nbits)) |
293 | return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits)); | 293 | return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits)); |
294 | else | 294 | |
295 | return __bitmap_full(src, nbits); | 295 | return find_first_zero_bit(src, nbits) == nbits; |
296 | } | 296 | } |
297 | 297 | ||
298 | static inline int bitmap_weight(const unsigned long *src, unsigned int nbits) | 298 | static inline int bitmap_weight(const unsigned long *src, unsigned int nbits) |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index 5d858e02997f..297f5bda4fdf 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
@@ -218,9 +218,9 @@ static inline unsigned long __ffs64(u64 word) | |||
218 | /** | 218 | /** |
219 | * find_last_bit - find the last set bit in a memory region | 219 | * find_last_bit - find the last set bit in a memory region |
220 | * @addr: The address to start the search at | 220 | * @addr: The address to start the search at |
221 | * @size: The maximum size to search | 221 | * @size: The number of bits to search |
222 | * | 222 | * |
223 | * Returns the bit number of the first set bit, or size. | 223 | * Returns the bit number of the last set bit, or size. |
224 | */ | 224 | */ |
225 | extern unsigned long find_last_bit(const unsigned long *addr, | 225 | extern unsigned long find_last_bit(const unsigned long *addr, |
226 | unsigned long size); | 226 | unsigned long size); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index f4d63544a791..c7496f263860 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -875,6 +875,7 @@ static inline struct file *get_file(struct file *f) | |||
875 | atomic_long_inc(&f->f_count); | 875 | atomic_long_inc(&f->f_count); |
876 | return f; | 876 | return f; |
877 | } | 877 | } |
878 | #define get_file_rcu(x) atomic_long_inc_not_zero(&(x)->f_count) | ||
878 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) | 879 | #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1) |
879 | #define file_count(x) atomic_long_read(&(x)->f_count) | 880 | #define file_count(x) atomic_long_read(&(x)->f_count) |
880 | 881 | ||
@@ -1046,6 +1047,9 @@ extern void lease_get_mtime(struct inode *, struct timespec *time); | |||
1046 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); | 1047 | extern int generic_setlease(struct file *, long, struct file_lock **, void **priv); |
1047 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); | 1048 | extern int vfs_setlease(struct file *, long, struct file_lock **, void **); |
1048 | extern int lease_modify(struct file_lock *, int, struct list_head *); | 1049 | extern int lease_modify(struct file_lock *, int, struct list_head *); |
1050 | struct files_struct; | ||
1051 | extern void show_fd_locks(struct seq_file *f, | ||
1052 | struct file *filp, struct files_struct *files); | ||
1049 | #else /* !CONFIG_FILE_LOCKING */ | 1053 | #else /* !CONFIG_FILE_LOCKING */ |
1050 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, | 1054 | static inline int fcntl_getlk(struct file *file, unsigned int cmd, |
1051 | struct flock __user *user) | 1055 | struct flock __user *user) |
@@ -1182,6 +1186,10 @@ static inline int lease_modify(struct file_lock *fl, int arg, | |||
1182 | { | 1186 | { |
1183 | return -EINVAL; | 1187 | return -EINVAL; |
1184 | } | 1188 | } |
1189 | |||
1190 | struct files_struct; | ||
1191 | static inline void show_fd_locks(struct seq_file *f, | ||
1192 | struct file *filp, struct files_struct *files) {} | ||
1185 | #endif /* !CONFIG_FILE_LOCKING */ | 1193 | #endif /* !CONFIG_FILE_LOCKING */ |
1186 | 1194 | ||
1187 | 1195 | ||
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h index be342b94c640..63ca8dacec59 100644 --- a/include/linux/kconfig.h +++ b/include/linux/kconfig.h | |||
@@ -23,14 +23,6 @@ | |||
23 | #define ___config_enabled(__ignored, val, ...) val | 23 | #define ___config_enabled(__ignored, val, ...) val |
24 | 24 | ||
25 | /* | 25 | /* |
26 | * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm', | ||
27 | * 0 otherwise. | ||
28 | * | ||
29 | */ | ||
30 | #define IS_ENABLED(option) \ | ||
31 | (config_enabled(option) || config_enabled(option##_MODULE)) | ||
32 | |||
33 | /* | ||
34 | * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 | 26 | * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0 |
35 | * otherwise. For boolean options, this is equivalent to | 27 | * otherwise. For boolean options, this is equivalent to |
36 | * IS_ENABLED(CONFIG_FOO). | 28 | * IS_ENABLED(CONFIG_FOO). |
@@ -43,4 +35,11 @@ | |||
43 | */ | 35 | */ |
44 | #define IS_MODULE(option) config_enabled(option##_MODULE) | 36 | #define IS_MODULE(option) config_enabled(option##_MODULE) |
45 | 37 | ||
38 | /* | ||
39 | * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm', | ||
40 | * 0 otherwise. | ||
41 | */ | ||
42 | #define IS_ENABLED(option) \ | ||
43 | (IS_BUILTIN(option) || IS_MODULE(option)) | ||
44 | |||
46 | #endif /* __LINUX_KCONFIG_H */ | 45 | #endif /* __LINUX_KCONFIG_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d6d630d31ef3..3a5b48e52a9e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -103,6 +103,18 @@ | |||
103 | (((__x) - ((__d) / 2)) / (__d)); \ | 103 | (((__x) - ((__d) / 2)) / (__d)); \ |
104 | } \ | 104 | } \ |
105 | ) | 105 | ) |
106 | /* | ||
107 | * Same as above but for u64 dividends. divisor must be a 32-bit | ||
108 | * number. | ||
109 | */ | ||
110 | #define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ | ||
111 | { \ | ||
112 | typeof(divisor) __d = divisor; \ | ||
113 | unsigned long long _tmp = (x) + (__d) / 2; \ | ||
114 | do_div(_tmp, __d); \ | ||
115 | _tmp; \ | ||
116 | } \ | ||
117 | ) | ||
106 | 118 | ||
107 | /* | 119 | /* |
108 | * Multiplies an integer by a fraction, while avoiding unnecessary | 120 | * Multiplies an integer by a fraction, while avoiding unnecessary |
diff --git a/include/linux/mfd/samsung/rtc.h b/include/linux/mfd/samsung/rtc.h index b6401e7661c7..29c30ac36020 100644 --- a/include/linux/mfd/samsung/rtc.h +++ b/include/linux/mfd/samsung/rtc.h | |||
@@ -105,6 +105,8 @@ enum s2mps_rtc_reg { | |||
105 | #define S5M_RTC_UDR_MASK (1 << S5M_RTC_UDR_SHIFT) | 105 | #define S5M_RTC_UDR_MASK (1 << S5M_RTC_UDR_SHIFT) |
106 | #define S2MPS_RTC_WUDR_SHIFT 4 | 106 | #define S2MPS_RTC_WUDR_SHIFT 4 |
107 | #define S2MPS_RTC_WUDR_MASK (1 << S2MPS_RTC_WUDR_SHIFT) | 107 | #define S2MPS_RTC_WUDR_MASK (1 << S2MPS_RTC_WUDR_SHIFT) |
108 | #define S2MPS13_RTC_AUDR_SHIFT 1 | ||
109 | #define S2MPS13_RTC_AUDR_MASK (1 << S2MPS13_RTC_AUDR_SHIFT) | ||
108 | #define S2MPS_RTC_RUDR_SHIFT 0 | 110 | #define S2MPS_RTC_RUDR_SHIFT 0 |
109 | #define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT) | 111 | #define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT) |
110 | #define RTC_TCON_SHIFT 1 | 112 | #define RTC_TCON_SHIFT 1 |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 590630eb59ba..8d37e26a1007 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -429,7 +429,7 @@ struct mm_struct { | |||
429 | #endif | 429 | #endif |
430 | 430 | ||
431 | /* store ref to file /proc/<pid>/exe symlink points to */ | 431 | /* store ref to file /proc/<pid>/exe symlink points to */ |
432 | struct file *exe_file; | 432 | struct file __rcu *exe_file; |
433 | #ifdef CONFIG_MMU_NOTIFIER | 433 | #ifdef CONFIG_MMU_NOTIFIER |
434 | struct mmu_notifier_mm *mmu_notifier_mm; | 434 | struct mmu_notifier_mm *mmu_notifier_mm; |
435 | #endif | 435 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index b7361f831226..795d5fea5697 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -212,4 +212,7 @@ static inline void setup_sysctl_set(struct ctl_table_set *p, | |||
212 | 212 | ||
213 | #endif /* CONFIG_SYSCTL */ | 213 | #endif /* CONFIG_SYSCTL */ |
214 | 214 | ||
215 | int sysctl_max_threads(struct ctl_table *table, int write, | ||
216 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
217 | |||
215 | #endif /* _LINUX_SYSCTL_H */ | 218 | #endif /* _LINUX_SYSCTL_H */ |
diff --git a/include/linux/util_macros.h b/include/linux/util_macros.h new file mode 100644 index 000000000000..d5f4fb69dba3 --- /dev/null +++ b/include/linux/util_macros.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef _LINUX_HELPER_MACROS_H_ | ||
2 | #define _LINUX_HELPER_MACROS_H_ | ||
3 | |||
4 | #define __find_closest(x, a, as, op) \ | ||
5 | ({ \ | ||
6 | typeof(as) __fc_i, __fc_as = (as) - 1; \ | ||
7 | typeof(x) __fc_x = (x); \ | ||
8 | typeof(*a) *__fc_a = (a); \ | ||
9 | for (__fc_i = 0; __fc_i < __fc_as; __fc_i++) { \ | ||
10 | if (__fc_x op DIV_ROUND_CLOSEST(__fc_a[__fc_i] + \ | ||
11 | __fc_a[__fc_i + 1], 2)) \ | ||
12 | break; \ | ||
13 | } \ | ||
14 | (__fc_i); \ | ||
15 | }) | ||
16 | |||
17 | /** | ||
18 | * find_closest - locate the closest element in a sorted array | ||
19 | * @x: The reference value. | ||
20 | * @a: The array in which to look for the closest element. Must be sorted | ||
21 | * in ascending order. | ||
22 | * @as: Size of 'a'. | ||
23 | * | ||
24 | * Returns the index of the element closest to 'x'. | ||
25 | */ | ||
26 | #define find_closest(x, a, as) __find_closest(x, a, as, <=) | ||
27 | |||
28 | /** | ||
29 | * find_closest_descending - locate the closest element in a sorted array | ||
30 | * @x: The reference value. | ||
31 | * @a: The array in which to look for the closest element. Must be sorted | ||
32 | * in descending order. | ||
33 | * @as: Size of 'a'. | ||
34 | * | ||
35 | * Similar to find_closest() but 'a' is expected to be sorted in descending | ||
36 | * order. | ||
37 | */ | ||
38 | #define find_closest_descending(x, a, as) __find_closest(x, a, as, >=) | ||
39 | |||
40 | #endif | ||
diff --git a/include/uapi/asm-generic/errno.h b/include/uapi/asm-generic/errno.h index 1e1ea6e6e7a5..88e0914cf2d9 100644 --- a/include/uapi/asm-generic/errno.h +++ b/include/uapi/asm-generic/errno.h | |||
@@ -6,7 +6,16 @@ | |||
6 | #define EDEADLK 35 /* Resource deadlock would occur */ | 6 | #define EDEADLK 35 /* Resource deadlock would occur */ |
7 | #define ENAMETOOLONG 36 /* File name too long */ | 7 | #define ENAMETOOLONG 36 /* File name too long */ |
8 | #define ENOLCK 37 /* No record locks available */ | 8 | #define ENOLCK 37 /* No record locks available */ |
9 | #define ENOSYS 38 /* Function not implemented */ | 9 | |
10 | /* | ||
11 | * This error code is special: arch syscall entry code will return | ||
12 | * -ENOSYS if users try to call a syscall that doesn't exist. To keep | ||
13 | * failures of syscalls that really do exist distinguishable from | ||
14 | * failures due to attempts to use a nonexistent syscall, syscall | ||
15 | * implementations should refrain from returning -ENOSYS. | ||
16 | */ | ||
17 | #define ENOSYS 38 /* Invalid system call number */ | ||
18 | |||
10 | #define ENOTEMPTY 39 /* Directory not empty */ | 19 | #define ENOTEMPTY 39 /* Directory not empty */ |
11 | #define ELOOP 40 /* Too many symbolic links encountered */ | 20 | #define ELOOP 40 /* Too many symbolic links encountered */ |
12 | #define EWOULDBLOCK EAGAIN /* Operation would block */ | 21 | #define EWOULDBLOCK EAGAIN /* Operation would block */ |