Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts: drivers/mtd/mtdcore.c Pull in the bdi fixes and ARM platform changes that other outstanding patches depend on.
这个提交包含在:
@@ -103,7 +103,8 @@ config HEADERS_CHECK
|
||||
|
||||
config DEBUG_SECTION_MISMATCH
|
||||
bool "Enable full Section mismatch analysis"
|
||||
depends on UNDEFINED
|
||||
depends on UNDEFINED || (BLACKFIN)
|
||||
default y
|
||||
# This option is on purpose disabled for now.
|
||||
# It will be enabled when we are down to a reasonable number
|
||||
# of section mismatch warnings (< 10 for an allyesconfig build)
|
||||
@@ -355,7 +356,7 @@ config SLUB_STATS
|
||||
config DEBUG_KMEMLEAK
|
||||
bool "Kernel memory leak detector"
|
||||
depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \
|
||||
(X86 || ARM || PPC || S390 || SUPERH)
|
||||
(X86 || ARM || PPC || S390 || SPARC64 || SUPERH || MICROBLAZE)
|
||||
|
||||
select DEBUG_FS if SYSFS
|
||||
select STACKTRACE if STACKTRACE_SUPPORT
|
||||
|
@@ -21,7 +21,7 @@ lib-y += kobject.o kref.o klist.o
|
||||
|
||||
obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
|
||||
bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
|
||||
string_helpers.o gcd.o list_sort.o
|
||||
string_helpers.o gcd.o lcm.o list_sort.o
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_KOBJECT),y)
|
||||
CFLAGS_kobject.o += -DDEBUG
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/cpumask.h>
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/init.h>
|
||||
#include <asm/atomic.h>
|
||||
#include "crc32defs.h"
|
||||
|
@@ -12,6 +12,7 @@
|
||||
#include <linux/sched.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/hash.h>
|
||||
|
||||
#define ODEBUG_HASH_BITS 14
|
||||
|
@@ -97,7 +97,7 @@ STATIC inline int INIT unlzo(u8 *input, int in_len,
|
||||
u32 src_len, dst_len;
|
||||
size_t tmp;
|
||||
u8 *in_buf, *in_buf_save, *out_buf;
|
||||
int obytes_processed = 0;
|
||||
int ret = -1;
|
||||
|
||||
set_error_fn(error_fn);
|
||||
|
||||
@@ -174,15 +174,22 @@ STATIC inline int INIT unlzo(u8 *input, int in_len,
|
||||
|
||||
/* decompress */
|
||||
tmp = dst_len;
|
||||
r = lzo1x_decompress_safe((u8 *) in_buf, src_len,
|
||||
|
||||
/* When the input data is not compressed at all,
|
||||
* lzo1x_decompress_safe will fail, so call memcpy()
|
||||
* instead */
|
||||
if (unlikely(dst_len == src_len))
|
||||
memcpy(out_buf, in_buf, src_len);
|
||||
else {
|
||||
r = lzo1x_decompress_safe((u8 *) in_buf, src_len,
|
||||
out_buf, &tmp);
|
||||
|
||||
if (r != LZO_E_OK || dst_len != tmp) {
|
||||
error("Compressed data violation");
|
||||
goto exit_2;
|
||||
if (r != LZO_E_OK || dst_len != tmp) {
|
||||
error("Compressed data violation");
|
||||
goto exit_2;
|
||||
}
|
||||
}
|
||||
|
||||
obytes_processed += dst_len;
|
||||
if (flush)
|
||||
flush(out_buf, dst_len);
|
||||
if (output)
|
||||
@@ -196,6 +203,7 @@ STATIC inline int INIT unlzo(u8 *input, int in_len,
|
||||
in_buf += src_len;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
exit_2:
|
||||
if (!input)
|
||||
free(in_buf);
|
||||
@@ -203,7 +211,7 @@ exit_1:
|
||||
if (!output)
|
||||
free(out_buf);
|
||||
exit:
|
||||
return obytes_processed;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define decompress unlzo
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#include <linux/pci.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
void devm_ioremap_release(struct device *dev, void *res)
|
||||
|
@@ -570,7 +570,7 @@ static ssize_t filter_write(struct file *file, const char __user *userbuf,
|
||||
* Now parse out the first token and use it as the name for the
|
||||
* driver to filter for.
|
||||
*/
|
||||
for (i = 0; i < NAME_MAX_LEN; ++i) {
|
||||
for (i = 0; i < NAME_MAX_LEN - 1; ++i) {
|
||||
current_driver_name[i] = buf[i];
|
||||
if (isspace(buf[i]) || buf[i] == ' ' || buf[i] == 0)
|
||||
break;
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/dynamic_debug.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
extern struct _ddebug __start___verbose[];
|
||||
extern struct _ddebug __stop___verbose[];
|
||||
|
@@ -99,7 +99,7 @@ struct flex_array *flex_array_alloc(int element_size, unsigned int total,
|
||||
ret->element_size = element_size;
|
||||
ret->total_nr_elements = total;
|
||||
if (elements_fit_in_base(ret) && !(flags & __GFP_ZERO))
|
||||
memset(ret->parts[0], FLEX_ARRAY_FREE,
|
||||
memset(&ret->parts[0], FLEX_ARRAY_FREE,
|
||||
FLEX_ARRAY_BASE_BYTES_LEFT);
|
||||
return ret;
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@
|
||||
* Version 2. See the file COPYING for more details.
|
||||
*/
|
||||
|
||||
#include <linux/slab.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/genalloc.h>
|
||||
|
@@ -103,6 +103,7 @@
|
||||
the two sets of lengths.
|
||||
*/
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#ifdef RCSID
|
||||
static char rcsid[] = "#Id: inflate.c,v 0.14 1993/06/10 13:27:04 jloup Exp #";
|
||||
|
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/string.h>
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
#include <linux/string.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <linux/socket.h>
|
||||
#include <linux/skbuff.h>
|
||||
|
@@ -13,6 +13,7 @@
|
||||
|
||||
#include <linux/kref.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
/**
|
||||
* kref_set - initialize object and set refcount to requested number.
|
||||
|
15
lib/lcm.c
普通文件
15
lib/lcm.c
普通文件
@@ -0,0 +1,15 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/gcd.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
/* Lowest common multiple */
|
||||
unsigned long lcm(unsigned long a, unsigned long b)
|
||||
{
|
||||
if (a && b)
|
||||
return (a * b) / gcd(a, b);
|
||||
else if (b)
|
||||
return b;
|
||||
|
||||
return a;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(lcm);
|
@@ -28,7 +28,6 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/notifier.h>
|
||||
#include <linux/cpu.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/rcupdate.h>
|
||||
@@ -556,6 +555,10 @@ EXPORT_SYMBOL(radix_tree_tag_clear);
|
||||
*
|
||||
* 0: tag not present or not set
|
||||
* 1: tag set
|
||||
*
|
||||
* Note that the return value of this function may not be relied on, even if
|
||||
* the RCU lock is held, unless tag modification and node deletion are excluded
|
||||
* from concurrency.
|
||||
*/
|
||||
int radix_tree_tag_get(struct radix_tree_root *root,
|
||||
unsigned long index, unsigned int tag)
|
||||
@@ -596,12 +599,8 @@ int radix_tree_tag_get(struct radix_tree_root *root,
|
||||
*/
|
||||
if (!tag_get(node, tag, offset))
|
||||
saw_unset_tag = 1;
|
||||
if (height == 1) {
|
||||
int ret = tag_get(node, tag, offset);
|
||||
|
||||
BUG_ON(ret && saw_unset_tag);
|
||||
return !!ret;
|
||||
}
|
||||
if (height == 1)
|
||||
return !!tag_get(node, tag, offset);
|
||||
node = rcu_dereference_raw(node->slots[offset]);
|
||||
shift -= RADIX_TREE_MAP_SHIFT;
|
||||
height--;
|
||||
|
@@ -16,9 +16,14 @@
|
||||
/*
|
||||
* __ratelimit - rate limiting
|
||||
* @rs: ratelimit_state data
|
||||
* @func: name of calling function
|
||||
*
|
||||
* This enforces a rate limit: not more than @rs->ratelimit_burst callbacks
|
||||
* in every @rs->ratelimit_jiffies
|
||||
* This enforces a rate limit: not more than @rs->burst callbacks
|
||||
* in every @rs->interval
|
||||
*
|
||||
* RETURNS:
|
||||
* 0 means callbacks will be suppressed.
|
||||
* 1 means go ahead and do it.
|
||||
*/
|
||||
int ___ratelimit(struct ratelimit_state *rs, const char *func)
|
||||
{
|
||||
@@ -35,7 +40,7 @@ int ___ratelimit(struct ratelimit_state *rs, const char *func)
|
||||
* the entity that is holding the lock already:
|
||||
*/
|
||||
if (!spin_trylock_irqsave(&rs->lock, flags))
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
if (!rs->begin)
|
||||
rs->begin = jiffies;
|
||||
|
@@ -143,13 +143,14 @@ void __sched __down_read(struct rw_semaphore *sem)
|
||||
{
|
||||
struct rwsem_waiter waiter;
|
||||
struct task_struct *tsk;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irq(&sem->wait_lock);
|
||||
spin_lock_irqsave(&sem->wait_lock, flags);
|
||||
|
||||
if (sem->activity >= 0 && list_empty(&sem->wait_list)) {
|
||||
/* granted */
|
||||
sem->activity++;
|
||||
spin_unlock_irq(&sem->wait_lock);
|
||||
spin_unlock_irqrestore(&sem->wait_lock, flags);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -164,7 +165,7 @@ void __sched __down_read(struct rw_semaphore *sem)
|
||||
list_add_tail(&waiter.list, &sem->wait_list);
|
||||
|
||||
/* we don't need to touch the semaphore struct anymore */
|
||||
spin_unlock_irq(&sem->wait_lock);
|
||||
spin_unlock_irqrestore(&sem->wait_lock, flags);
|
||||
|
||||
/* wait to be given the lock */
|
||||
for (;;) {
|
||||
@@ -209,13 +210,14 @@ void __sched __down_write_nested(struct rw_semaphore *sem, int subclass)
|
||||
{
|
||||
struct rwsem_waiter waiter;
|
||||
struct task_struct *tsk;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irq(&sem->wait_lock);
|
||||
spin_lock_irqsave(&sem->wait_lock, flags);
|
||||
|
||||
if (sem->activity == 0 && list_empty(&sem->wait_list)) {
|
||||
/* granted */
|
||||
sem->activity = -1;
|
||||
spin_unlock_irq(&sem->wait_lock);
|
||||
spin_unlock_irqrestore(&sem->wait_lock, flags);
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -230,7 +232,7 @@ void __sched __down_write_nested(struct rw_semaphore *sem, int subclass)
|
||||
list_add_tail(&waiter.list, &sem->wait_list);
|
||||
|
||||
/* we don't need to touch the semaphore struct anymore */
|
||||
spin_unlock_irq(&sem->wait_lock);
|
||||
spin_unlock_irqrestore(&sem->wait_lock, flags);
|
||||
|
||||
/* wait to be given the lock */
|
||||
for (;;) {
|
||||
|
@@ -7,6 +7,7 @@
|
||||
* Version 2. See the file COPYING for more details.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/highmem.h>
|
||||
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/gfp.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <asm/dma.h>
|
||||
|
@@ -103,6 +103,7 @@
|
||||
#include <linux/rcupdate.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/textsearch.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
static LIST_HEAD(ts_ops);
|
||||
static DEFINE_SPINLOCK(ts_mod_lock);
|
||||
|
@@ -118,6 +118,7 @@ long long simple_strtoll(const char *cp, char **endp, unsigned int base)
|
||||
|
||||
return simple_strtoull(cp, endp, base);
|
||||
}
|
||||
EXPORT_SYMBOL(simple_strtoll);
|
||||
|
||||
/**
|
||||
* strict_strtoul - convert a string to an unsigned long strictly
|
||||
@@ -408,12 +409,12 @@ enum format_type {
|
||||
};
|
||||
|
||||
struct printf_spec {
|
||||
u16 type;
|
||||
s16 field_width; /* width of output field */
|
||||
u8 type; /* format_type enum */
|
||||
u8 flags; /* flags to number() */
|
||||
u8 base;
|
||||
s8 precision; /* # of digits/chars */
|
||||
u8 qualifier;
|
||||
u8 base; /* number base, 8, 10 or 16 only */
|
||||
u8 qualifier; /* number qualifier, one of 'hHlLtzZ' */
|
||||
s16 field_width; /* width of output field */
|
||||
s16 precision; /* # of digits/chars */
|
||||
};
|
||||
|
||||
static char *number(char *buf, char *end, unsigned long long num,
|
||||
|
在新工单中引用
屏蔽一个用户