History

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 ...

Linus Torvalds committed 11 years ago

Commit 54e514b2 parents 4fc8adc 6c8c903158 files · +2190 −1551Browse files

Showing the changes to include (11 of 158 files). Show all

Unified · Split

11 files
  1. include/asm-generic/seccomp.h +2 −0
  2. include/linux/bitmap.h +4 −4
  3. include/linux/bitops.h +2 −2
  4. include/linux/fs.h +8 −0
  5. include/linux/kconfig.h +7 −8
  6. include/linux/kernel.h +12 −0
  7. include/linux/mfd/samsung/rtc.h +2 −0
  8. include/linux/mm_types.h +1 −1
  9. include/linux/sysctl.h +3 −0
  10. include/linux/util_macros.h +40 −0
  11. include/uapi/asm-generic/errno.h +10 −1
include/asm-generic/seccomp.h+2−0
@@ -17,7 +17,9 @@ · 16 unmodified lines
1717 #define __NR_seccomp_read_32 __NR_read
1818 #define __NR_seccomp_write_32 __NR_write
1919 #define __NR_seccomp_exit_32 __NR_exit
20+#ifndef __NR_seccomp_sigreturn_32
2021 #define __NR_seccomp_sigreturn_32 __NR_rt_sigreturn
22+#endif
2123 #endif /* CONFIG_COMPAT && ! already defined */
2224
2325 #define __NR_seccomp_read __NR_read
include/linux/bitmap.h+4−4
@@ -283,16 +283,16 @@ static inline int bitmap_empty(const unsigned long *src, unsigned nbits) · 282 unmodified lines
283283 {
284284 if (small_const_nbits(nbits))
285285 return ! (*src & BITMAP_LAST_WORD_MASK(nbits));
286− else
287− return __bitmap_empty(src, nbits);
286+
287+ return find_first_bit(src, nbits) == nbits;
288288 }
289289
290290 static inline int bitmap_full(const unsigned long *src, unsigned int nbits)
291291 {
292292 if (small_const_nbits(nbits))
293293 return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits));
294− else
295− return __bitmap_full(src, nbits);
294+
295+ return find_first_zero_bit(src, nbits) == nbits;
296296 }
297297
298298 static inline int bitmap_weight(const unsigned long *src, unsigned int nbits)
include/linux/bitops.h+2−2
@@ -218,9 +218,9 @@ static inline unsigned long __ffs64(u64 word) · 217 unmodified lines
218218 /**
219219 * find_last_bit - find the last set bit in a memory region
220220 * @addr: The address to start the search at
221− * @size: The maximum size to search
221+ * @size: The number of bits to search
222222 *
223− * Returns the bit number of the first set bit, or size.
223+ * Returns the bit number of the last set bit, or size.
224224 */
225225 extern unsigned long find_last_bit(const unsigned long *addr,
226226 unsigned long size);
include/linux/fs.h+8−0
@@ -875,6 +875,7 @@ static inline struct file *get_file(struct file *f) · 874 unmodified lines
875875 atomic_long_inc(&f->f_count);
876876 return f;
877877 }
878+#define get_file_rcu(x) atomic_long_inc_not_zero(&(x)->f_count)
878879 #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
879880 #define file_count(x) atomic_long_read(&(x)->f_count)
880881
@@ -1046,6 +1047,9 @@ extern void lease_get_mtime(struct inode *, struct timespec *time); · 165 unmodified lines
10461047 extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
10471048 extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
10481049 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);
10491053 #else /* !CONFIG_FILE_LOCKING */
10501054 static inline int fcntl_getlk(struct file *file, unsigned int cmd,
10511055 struct flock __user *user)
@@ -1182,6 +1186,10 @@ static inline int lease_modify(struct file_lock *fl, int arg, · 130 unmodified lines
11821186 {
11831187 return -EINVAL;
11841188 }
1189+
1190+struct files_struct;
1191+static inline void show_fd_locks(struct seq_file *f,
1192+ struct file *filp, struct files_struct *files) {}
11851193 #endif /* !CONFIG_FILE_LOCKING */
11861194
11871195
include/linux/kconfig.h+7−8
@@ -22,14 +22,6 @@ · 21 unmodified lines
2222 #define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0)
2323 #define ___config_enabled(__ignored, val, ...) val
2424
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−
3325 /*
3426 * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
3527 * otherwise. For boolean options, this is equivalent to
@@ -43,4 +35,11 @@ · 7 unmodified lines
4335 */
4436 #define IS_MODULE(option) config_enabled(option##_MODULE)
4537
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+
4645 #endif /* __LINUX_KCONFIG_H */
include/linux/kernel.h+12−0
@@ -103,6 +103,18 @@ · 102 unmodified lines
103103 (((__x) - ((__d) / 2)) / (__d)); \
104104 } \
105105 )
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+)
106118
107119 /*
108120 * Multiplies an integer by a fraction, while avoiding unnecessary
include/linux/mfd/samsung/rtc.h+2−0
@@ -105,6 +105,8 @@ enum s2mps_rtc_reg { · 104 unmodified lines
105105 #define S5M_RTC_UDR_MASK (1 << S5M_RTC_UDR_SHIFT)
106106 #define S2MPS_RTC_WUDR_SHIFT 4
107107 #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)
108110 #define S2MPS_RTC_RUDR_SHIFT 0
109111 #define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT)
110112 #define RTC_TCON_SHIFT 1
include/linux/mm_types.h+1−1
@@ -429,7 +429,7 @@ struct mm_struct { · 428 unmodified lines
429429 #endif
430430
431431 /* store ref to file /proc/<pid>/exe symlink points to */
432− struct file *exe_file;
432+ struct file __rcu *exe_file;
433433 #ifdef CONFIG_MMU_NOTIFIER
434434 struct mmu_notifier_mm *mmu_notifier_mm;
435435 #endif
include/linux/sysctl.h+3−0
@@ -212,4 +212,7 @@ static inline void setup_sysctl_set(struct ctl_table_set *p, · 211 unmodified lines
212212
213213 #endif /* CONFIG_SYSCTL */
214214
215+int sysctl_max_threads(struct ctl_table *table, int write,
216+ void __user *buffer, size_t *lenp, loff_t *ppos);
217+
215218 #endif /* _LINUX_SYSCTL_H */
include/linux/util_macros.h+40−0
@@ -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
include/uapi/asm-generic/errno.h+10−1
@@ -6,7 +6,16 @@ · 5 unmodified lines
66 #define EDEADLK 35 /* Resource deadlock would occur */
77 #define ENAMETOOLONG 36 /* File name too long */
88 #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+
1019 #define ENOTEMPTY 39 /* Directory not empty */
1120 #define ELOOP 40 /* Too many symbolic links encountered */
1221 #define EWOULDBLOCK EAGAIN /* Operation would block */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t