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 ...
This commit is contained in:
commit
54e514b91b
158 changed files with 2194 additions and 1555 deletions
|
|
@ -283,16 +283,16 @@ static inline int bitmap_empty(const unsigned long *src, unsigned nbits)
|
|||
{
|
||||
if (small_const_nbits(nbits))
|
||||
return ! (*src & BITMAP_LAST_WORD_MASK(nbits));
|
||||
else
|
||||
return __bitmap_empty(src, nbits);
|
||||
|
||||
return find_first_bit(src, nbits) == nbits;
|
||||
}
|
||||
|
||||
static inline int bitmap_full(const unsigned long *src, unsigned int nbits)
|
||||
{
|
||||
if (small_const_nbits(nbits))
|
||||
return ! (~(*src) & BITMAP_LAST_WORD_MASK(nbits));
|
||||
else
|
||||
return __bitmap_full(src, nbits);
|
||||
|
||||
return find_first_zero_bit(src, nbits) == nbits;
|
||||
}
|
||||
|
||||
static inline int bitmap_weight(const unsigned long *src, unsigned int nbits)
|
||||
|
|
|
|||
|
|
@ -218,9 +218,9 @@ static inline unsigned long __ffs64(u64 word)
|
|||
/**
|
||||
* find_last_bit - find the last set bit in a memory region
|
||||
* @addr: The address to start the search at
|
||||
* @size: The maximum size to search
|
||||
* @size: The number of bits to search
|
||||
*
|
||||
* Returns the bit number of the first set bit, or size.
|
||||
* Returns the bit number of the last set bit, or size.
|
||||
*/
|
||||
extern unsigned long find_last_bit(const unsigned long *addr,
|
||||
unsigned long size);
|
||||
|
|
|
|||
|
|
@ -875,6 +875,7 @@ static inline struct file *get_file(struct file *f)
|
|||
atomic_long_inc(&f->f_count);
|
||||
return f;
|
||||
}
|
||||
#define get_file_rcu(x) atomic_long_inc_not_zero(&(x)->f_count)
|
||||
#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
|
||||
#define file_count(x) atomic_long_read(&(x)->f_count)
|
||||
|
||||
|
|
@ -1046,6 +1047,9 @@ extern void lease_get_mtime(struct inode *, struct timespec *time);
|
|||
extern int generic_setlease(struct file *, long, struct file_lock **, void **priv);
|
||||
extern int vfs_setlease(struct file *, long, struct file_lock **, void **);
|
||||
extern int lease_modify(struct file_lock *, int, struct list_head *);
|
||||
struct files_struct;
|
||||
extern void show_fd_locks(struct seq_file *f,
|
||||
struct file *filp, struct files_struct *files);
|
||||
#else /* !CONFIG_FILE_LOCKING */
|
||||
static inline int fcntl_getlk(struct file *file, unsigned int cmd,
|
||||
struct flock __user *user)
|
||||
|
|
@ -1182,6 +1186,10 @@ static inline int lease_modify(struct file_lock *fl, int arg,
|
|||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
struct files_struct;
|
||||
static inline void show_fd_locks(struct seq_file *f,
|
||||
struct file *filp, struct files_struct *files) {}
|
||||
#endif /* !CONFIG_FILE_LOCKING */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,14 +22,6 @@
|
|||
#define __config_enabled(arg1_or_junk) ___config_enabled(arg1_or_junk 1, 0)
|
||||
#define ___config_enabled(__ignored, val, ...) val
|
||||
|
||||
/*
|
||||
* IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
|
||||
* 0 otherwise.
|
||||
*
|
||||
*/
|
||||
#define IS_ENABLED(option) \
|
||||
(config_enabled(option) || config_enabled(option##_MODULE))
|
||||
|
||||
/*
|
||||
* IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
|
||||
* otherwise. For boolean options, this is equivalent to
|
||||
|
|
@ -43,4 +35,11 @@
|
|||
*/
|
||||
#define IS_MODULE(option) config_enabled(option##_MODULE)
|
||||
|
||||
/*
|
||||
* IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
|
||||
* 0 otherwise.
|
||||
*/
|
||||
#define IS_ENABLED(option) \
|
||||
(IS_BUILTIN(option) || IS_MODULE(option))
|
||||
|
||||
#endif /* __LINUX_KCONFIG_H */
|
||||
|
|
|
|||
|
|
@ -103,6 +103,18 @@
|
|||
(((__x) - ((__d) / 2)) / (__d)); \
|
||||
} \
|
||||
)
|
||||
/*
|
||||
* Same as above but for u64 dividends. divisor must be a 32-bit
|
||||
* number.
|
||||
*/
|
||||
#define DIV_ROUND_CLOSEST_ULL(x, divisor)( \
|
||||
{ \
|
||||
typeof(divisor) __d = divisor; \
|
||||
unsigned long long _tmp = (x) + (__d) / 2; \
|
||||
do_div(_tmp, __d); \
|
||||
_tmp; \
|
||||
} \
|
||||
)
|
||||
|
||||
/*
|
||||
* Multiplies an integer by a fraction, while avoiding unnecessary
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ enum s2mps_rtc_reg {
|
|||
#define S5M_RTC_UDR_MASK (1 << S5M_RTC_UDR_SHIFT)
|
||||
#define S2MPS_RTC_WUDR_SHIFT 4
|
||||
#define S2MPS_RTC_WUDR_MASK (1 << S2MPS_RTC_WUDR_SHIFT)
|
||||
#define S2MPS13_RTC_AUDR_SHIFT 1
|
||||
#define S2MPS13_RTC_AUDR_MASK (1 << S2MPS13_RTC_AUDR_SHIFT)
|
||||
#define S2MPS_RTC_RUDR_SHIFT 0
|
||||
#define S2MPS_RTC_RUDR_MASK (1 << S2MPS_RTC_RUDR_SHIFT)
|
||||
#define RTC_TCON_SHIFT 1
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ struct mm_struct {
|
|||
#endif
|
||||
|
||||
/* store ref to file /proc/<pid>/exe symlink points to */
|
||||
struct file *exe_file;
|
||||
struct file __rcu *exe_file;
|
||||
#ifdef CONFIG_MMU_NOTIFIER
|
||||
struct mmu_notifier_mm *mmu_notifier_mm;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -212,4 +212,7 @@ static inline void setup_sysctl_set(struct ctl_table_set *p,
|
|||
|
||||
#endif /* CONFIG_SYSCTL */
|
||||
|
||||
int sysctl_max_threads(struct ctl_table *table, int write,
|
||||
void __user *buffer, size_t *lenp, loff_t *ppos);
|
||||
|
||||
#endif /* _LINUX_SYSCTL_H */
|
||||
|
|
|
|||
40
include/linux/util_macros.h
Normal file
40
include/linux/util_macros.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef _LINUX_HELPER_MACROS_H_
|
||||
#define _LINUX_HELPER_MACROS_H_
|
||||
|
||||
#define __find_closest(x, a, as, op) \
|
||||
({ \
|
||||
typeof(as) __fc_i, __fc_as = (as) - 1; \
|
||||
typeof(x) __fc_x = (x); \
|
||||
typeof(*a) *__fc_a = (a); \
|
||||
for (__fc_i = 0; __fc_i < __fc_as; __fc_i++) { \
|
||||
if (__fc_x op DIV_ROUND_CLOSEST(__fc_a[__fc_i] + \
|
||||
__fc_a[__fc_i + 1], 2)) \
|
||||
break; \
|
||||
} \
|
||||
(__fc_i); \
|
||||
})
|
||||
|
||||
/**
|
||||
* find_closest - locate the closest element in a sorted array
|
||||
* @x: The reference value.
|
||||
* @a: The array in which to look for the closest element. Must be sorted
|
||||
* in ascending order.
|
||||
* @as: Size of 'a'.
|
||||
*
|
||||
* Returns the index of the element closest to 'x'.
|
||||
*/
|
||||
#define find_closest(x, a, as) __find_closest(x, a, as, <=)
|
||||
|
||||
/**
|
||||
* find_closest_descending - locate the closest element in a sorted array
|
||||
* @x: The reference value.
|
||||
* @a: The array in which to look for the closest element. Must be sorted
|
||||
* in descending order.
|
||||
* @as: Size of 'a'.
|
||||
*
|
||||
* Similar to find_closest() but 'a' is expected to be sorted in descending
|
||||
* order.
|
||||
*/
|
||||
#define find_closest_descending(x, a, as) __find_closest(x, a, as, >=)
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue