summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-24 00:12:35 +0000
commit482368b1a8e45430672c58c9a42e7d2004367126 (patch)
treece2a1a567d4d62dee7c2e71a46a99cf72cf1d606 /kernel
parente4d0251c6f56ab2e191afb70f80f382793e23f74 (diff)
Merge with 2.3.47. Guys, this is buggy as shit. You've been warned.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/fork.c7
-rw-r--r--kernel/kmod.c21
-rw-r--r--kernel/ksyms.c8
-rw-r--r--kernel/pm.c1
-rw-r--r--kernel/printk.c16
-rw-r--r--kernel/ptrace.c1
-rw-r--r--kernel/sched.c4
7 files changed, 39 insertions, 19 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index de0b59bac..71989b3f7 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -252,18 +252,19 @@ static inline int dup_mmap(struct mm_struct * mm)
tmp->vm_next = NULL;
file = tmp->vm_file;
if (file) {
+ struct inode *inode = file->f_dentry->d_inode;
get_file(file);
if (tmp->vm_flags & VM_DENYWRITE)
- atomic_dec(&file->f_dentry->d_inode->i_writecount);
+ atomic_dec(&inode->i_writecount);
/* insert tmp into the share list, just after mpnt */
- spin_lock(&file->f_dentry->d_inode->i_shared_lock);
+ spin_lock(&inode->i_mapping->i_shared_lock);
if((tmp->vm_next_share = mpnt->vm_next_share) != NULL)
mpnt->vm_next_share->vm_pprev_share =
&tmp->vm_next_share;
mpnt->vm_next_share = tmp;
tmp->vm_pprev_share = &mpnt->vm_next_share;
- spin_unlock(&file->f_dentry->d_inode->i_shared_lock);
+ spin_unlock(&inode->i_mapping->i_shared_lock);
}
/* Copy the pages, but defer checking for errors */
diff --git a/kernel/kmod.c b/kernel/kmod.c
index 22c7509a8..dca806e94 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -63,10 +63,8 @@ use_init_fs_context(void)
unlock_kernel();
}
-static int exec_modprobe(void * module_name)
+int exec_usermodehelper(char *program_path, char *argv[], char *envp[])
{
- static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
- char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL };
int i;
current->session = 1;
@@ -101,13 +99,24 @@ static int exec_modprobe(void * module_name)
set_fs(KERNEL_DS);
/* Go, go, go... */
- if (execve(modprobe_path, argv, envp) < 0) {
+ if (execve(program_path, argv, envp) < 0)
+ return -errno;
+ return 0;
+}
+
+static int exec_modprobe(void * module_name)
+{
+ static char * envp[] = { "HOME=/", "TERM=linux", "PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
+ char *argv[] = { modprobe_path, "-s", "-k", (char*)module_name, NULL };
+ int ret;
+
+ ret = exec_usermodehelper(modprobe_path, argv, envp);
+ if (ret) {
printk(KERN_ERR
"kmod: failed to exec %s -s -k %s, errno = %d\n",
modprobe_path, (char*) module_name, errno);
- return -errno;
}
- return 0;
+ return ret;
}
/*
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index bd74f5413..79525ce16 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -74,6 +74,7 @@ __attribute__((section("__ksymtab"))) = {
#ifdef CONFIG_KMOD
EXPORT_SYMBOL(request_module);
+EXPORT_SYMBOL(exec_usermodehelper);
#endif
#ifdef CONFIG_MODULES
@@ -125,6 +126,7 @@ EXPORT_SYMBOL(highmem_start_page);
#endif
/* filesystem internal functions */
+EXPORT_SYMBOL(def_blk_fops);
EXPORT_SYMBOL(in_group_p);
EXPORT_SYMBOL(update_atime);
EXPORT_SYMBOL(get_super);
@@ -259,6 +261,7 @@ EXPORT_SYMBOL(is_read_only);
EXPORT_SYMBOL(set_device_ro);
EXPORT_SYMBOL(bmap);
EXPORT_SYMBOL(sync_dev);
+EXPORT_SYMBOL(devfs_register_partitions);
EXPORT_SYMBOL(blkdev_open);
EXPORT_SYMBOL(blkdev_get);
EXPORT_SYMBOL(blkdev_put);
@@ -373,6 +376,7 @@ EXPORT_SYMBOL(do_gettimeofday);
EXPORT_SYMBOL(loops_per_sec);
#endif
EXPORT_SYMBOL(kstat);
+EXPORT_SYMBOL(nr_running);
/* misc */
EXPORT_SYMBOL(panic);
@@ -460,12 +464,16 @@ EXPORT_SYMBOL(get_fast_time);
/* library functions */
EXPORT_SYMBOL(strnicmp);
+EXPORT_SYMBOL(strspn);
/* software interrupts */
EXPORT_SYMBOL(tasklet_hi_vec);
+EXPORT_SYMBOL(tasklet_vec);
EXPORT_SYMBOL(bh_task_vec);
EXPORT_SYMBOL(init_bh);
EXPORT_SYMBOL(remove_bh);
+EXPORT_SYMBOL(tasklet_init);
+EXPORT_SYMBOL(tasklet_kill);
/* init task, for moving kthread roots - ought to export a function ?? */
diff --git a/kernel/pm.c b/kernel/pm.c
index 26811bff2..c35620402 100644
--- a/kernel/pm.c
+++ b/kernel/pm.c
@@ -168,3 +168,4 @@ EXPORT_SYMBOL(pm_unregister);
EXPORT_SYMBOL(pm_unregister_all);
EXPORT_SYMBOL(pm_send_request);
EXPORT_SYMBOL(pm_find);
+EXPORT_SYMBOL(pm_active);
diff --git a/kernel/printk.c b/kernel/printk.c
index 407635131..fa18cc558 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -318,14 +318,14 @@ void console_print(const char *s)
unsigned long flags;
int len = strlen(s);
- spin_lock_irqsave(&console_lock,flags);
+ spin_lock_irqsave(&console_lock, flags);
c = console_drivers;
while(c) {
if ((c->flags & CON_ENABLED) && c->write)
c->write(c, s, len);
c = c->next;
}
- spin_unlock_irqrestore(&console_lock,flags);
+ spin_unlock_irqrestore(&console_lock, flags);
}
void unblank_console(void)
@@ -333,14 +333,14 @@ void unblank_console(void)
struct console *c;
unsigned long flags;
- spin_lock_irqsave(&console_lock,flags);
+ spin_lock_irqsave(&console_lock, flags);
c = console_drivers;
while(c) {
if ((c->flags & CON_ENABLED) && c->unblank)
c->unblank();
c = c->next;
}
- spin_unlock_irqrestore(&console_lock,flags);
+ spin_unlock_irqrestore(&console_lock, flags);
}
/*
@@ -402,7 +402,7 @@ void register_console(struct console * console)
* Put this console in the list - keep the
* preferred driver at the head of the list.
*/
- spin_lock_irqsave(&console_lock,flags);
+ spin_lock_irqsave(&console_lock, flags);
if ((console->flags & CON_CONSDEV) || console_drivers == NULL) {
console->next = console_drivers;
console_drivers = console;
@@ -445,7 +445,7 @@ void register_console(struct console * console)
j = 0;
}
done:
- spin_unlock_irqrestore(&console_lock,flags);
+ spin_unlock_irqrestore(&console_lock, flags);
}
@@ -455,7 +455,7 @@ int unregister_console(struct console * console)
unsigned long flags;
int res = 1;
- spin_lock_irqsave(&console_lock,flags);
+ spin_lock_irqsave(&console_lock, flags);
if (console_drivers == console) {
console_drivers=console->next;
res = 0;
@@ -471,7 +471,7 @@ int unregister_console(struct console * console)
}
}
- spin_unlock_irqrestore(&console_lock,flags);
+ spin_unlock_irqrestore(&console_lock, flags);
return res;
}
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 2980059b2..c3f75124f 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -53,6 +53,7 @@ repeat:
maddr = kmap(page);
memcpy((char *)maddr + (addr & ~PAGE_MASK), buf, len);
flush_page_to_ram(page);
+ flush_icache_page(vma, page);
kunmap(page);
} else {
maddr = kmap(page);
diff --git a/kernel/sched.c b/kernel/sched.c
index 03c05e7c3..1ccc6826c 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -141,7 +141,7 @@ static inline int goodness(struct task_struct * p, int this_cpu, struct mm_struc
#endif
/* .. and a slight advantage to the current MM */
- if (p->mm == this_mm)
+ if (p->mm == this_mm || !p->mm)
weight += 1;
weight += p->priority;
@@ -173,7 +173,7 @@ static inline int prev_goodness(struct task_struct * p, int this_cpu, struct mm_
*/
static inline int preemption_goodness(struct task_struct * prev, struct task_struct * p, int cpu)
{
- return goodness(p, cpu, prev->mm) - goodness(prev, cpu, prev->mm);
+ return goodness(p, cpu, prev->active_mm) - goodness(prev, cpu, prev->active_mm);
}
/*