summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/dma.c3
-rw-r--r--kernel/exec_domain.c49
-rw-r--r--kernel/exit.c2
-rw-r--r--kernel/fork.c5
-rw-r--r--kernel/ksyms.c8
-rw-r--r--kernel/sched.c31
-rw-r--r--kernel/sysctl.c4
-rw-r--r--kernel/timer.c12
8 files changed, 43 insertions, 71 deletions
diff --git a/kernel/dma.c b/kernel/dma.c
index 73b51a72b..983dedb60 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -115,8 +115,9 @@ int request_dma(unsigned int dmanr, const char *device_id)
return -EINVAL;
}
-void free_dma(unsigned int dmanr)
+int free_dma(unsigned int dmanr)
{
+ return -EINVAL;
}
int get_dma_list(char *buf)
diff --git a/kernel/exec_domain.c b/kernel/exec_domain.c
index 1daf64cc1..3f3b5fc16 100644
--- a/kernel/exec_domain.c
+++ b/kernel/exec_domain.c
@@ -104,37 +104,32 @@ int unregister_exec_domain(struct exec_domain *it)
void __set_personality(unsigned long personality)
{
- struct exec_domain *it, *prev;
+ struct exec_domain *it;
it = lookup_exec_domain(personality);
- if (it == current->exec_domain) {
- current->personality = personality;
- return;
- }
- if (!it)
- return;
- if (atomic_read(&current->fs->count) != 1) {
- struct fs_struct *new = copy_fs_struct(current->fs);
- struct fs_struct *old;
- if (!new) {
- put_exec_domain(it);
- return;
+ if (it) {
+ if (atomic_read(&current->fs->count) != 1) {
+ struct fs_struct *new = copy_fs_struct(current->fs);
+ struct fs_struct *old;
+ if (!new) {
+ put_exec_domain(it);
+ return;
+ }
+ task_lock(current);
+ old = current->fs;
+ current->fs = new;
+ task_unlock(current);
+ put_fs_struct(old);
}
- task_lock(current);
- old = current->fs;
- current->fs = new;
- task_unlock(current);
- put_fs_struct(old);
+ /*
+ * At that point we are guaranteed to be the sole owner of
+ * current->fs.
+ */
+ current->personality = personality;
+ current->exec_domain = it;
+ set_fs_altroot();
+ put_exec_domain(current->exec_domain);
}
- /*
- * At that point we are guaranteed to be the sole owner of
- * current->fs.
- */
- current->personality = personality;
- prev = current->exec_domain;
- current->exec_domain = it;
- set_fs_altroot();
- put_exec_domain(prev);
}
asmlinkage long sys_personality(unsigned long personality)
diff --git a/kernel/exit.c b/kernel/exit.c
index 3bd501cf1..e912b75bc 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -514,7 +514,7 @@ repeat:
case TASK_STOPPED:
if (!p->exit_code)
continue;
- if (!(options & WUNTRACED) && !(p->ptrace&PT_PTRACED))
+ if (!(options & WUNTRACED) && !(p->ptrace & PT_PTRACED))
continue;
read_unlock(&tasklist_lock);
retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0;
diff --git a/kernel/fork.c b/kernel/fork.c
index 07bc503ac..b441988aa 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -601,9 +601,8 @@ static inline void copy_flags(unsigned long clone_flags, struct task_struct *p)
new_flags &= ~(PF_SUPERPRIV | PF_USEDFPU | PF_VFORK);
new_flags |= PF_FORKNOEXEC;
- if (!(clone_flags & CLONE_PTRACE)) {
+ if (!(clone_flags & CLONE_PTRACE))
p->ptrace = 0;
- }
if (clone_flags & CLONE_VFORK)
new_flags |= PF_VFORK;
p->flags = new_flags;
@@ -675,7 +674,7 @@ int do_fork(unsigned long clone_flags, unsigned long usp, struct pt_regs *regs)
if ((clone_flags & CLONE_VFORK) || !(clone_flags & CLONE_PARENT)) {
p->p_opptr = current;
- if (!(p->ptrace&PT_PTRACED))
+ if (!(p->ptrace & PT_PTRACED))
p->p_pptr = current;
}
p->p_cptr = NULL;
diff --git a/kernel/ksyms.c b/kernel/ksyms.c
index a885a0c7f..f1032de30 100644
--- a/kernel/ksyms.c
+++ b/kernel/ksyms.c
@@ -172,8 +172,6 @@ EXPORT_SYMBOL(__invalidate_buffers);
EXPORT_SYMBOL(invalidate_inodes);
EXPORT_SYMBOL(invalidate_inode_pages);
EXPORT_SYMBOL(truncate_inode_pages);
-EXPORT_SYMBOL(fsync_inode_buffers);
-EXPORT_SYMBOL(buffer_insert_inode_queue);
EXPORT_SYMBOL(fsync_dev);
EXPORT_SYMBOL(permission);
EXPORT_SYMBOL(inode_setattr);
@@ -207,7 +205,7 @@ EXPORT_SYMBOL(generic_ro_fops);
EXPORT_SYMBOL(generic_buffer_fdatasync);
EXPORT_SYMBOL(page_hash_bits);
EXPORT_SYMBOL(page_hash_table);
-EXPORT_SYMBOL(file_lock_list);
+EXPORT_SYMBOL(file_lock_table);
EXPORT_SYMBOL(posix_lock_file);
EXPORT_SYMBOL(posix_test_lock);
EXPORT_SYMBOL(posix_block_lock);
@@ -273,7 +271,6 @@ EXPORT_SYMBOL(tty_std_termios);
/* block device driver support */
EXPORT_SYMBOL(block_read);
EXPORT_SYMBOL(block_write);
-EXPORT_SYMBOL(wait_for_request);
EXPORT_SYMBOL(blksize_size);
EXPORT_SYMBOL(hardsect_size);
EXPORT_SYMBOL(blk_size);
@@ -296,8 +293,6 @@ EXPORT_SYMBOL(refile_buffer);
EXPORT_SYMBOL(max_sectors);
EXPORT_SYMBOL(max_readahead);
EXPORT_SYMBOL(file_moveto);
-EXPORT_SYMBOL(drive_stat_acct);
-EXPORT_SYMBOL(set_bh_page);
/* tty routines */
EXPORT_SYMBOL(tty_hangup);
@@ -507,6 +502,7 @@ EXPORT_SYMBOL(disk_name); /* for md.c */
/* binfmt_aout */
EXPORT_SYMBOL(get_write_access);
+EXPORT_SYMBOL(put_write_access);
/* dynamic registering of consoles */
EXPORT_SYMBOL(register_console);
diff --git a/kernel/sched.c b/kernel/sched.c
index b8d389ef8..f85cc4213 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -60,8 +60,8 @@ struct task_struct * init_tasks[NR_CPUS] = {&init_task, };
* The run-queue lock locks the parts that actually access
* and change the run-queues, and have to be interrupt-safe.
*/
-spinlock_t runqueue_lock = SPIN_LOCK_UNLOCKED; /* second */
-rwlock_t tasklist_lock = RW_LOCK_UNLOCKED; /* third */
+__cacheline_aligned spinlock_t runqueue_lock = SPIN_LOCK_UNLOCKED; /* second */
+__cacheline_aligned rwlock_t tasklist_lock = RW_LOCK_UNLOCKED; /* third */
static LIST_HEAD(runqueue_head);
@@ -337,23 +337,16 @@ out:
spin_unlock_irqrestore(&runqueue_lock, flags);
}
-struct foo_struct {
- struct task_struct *process;
- struct timer_list timer;
-};
-
static void process_timeout(unsigned long __data)
{
- struct foo_struct * foo = (struct foo_struct *) __data;
-
- wake_up_process(foo->process);
+ struct task_struct * p = (struct task_struct *) __data;
- timer_exit(&foo->timer);
+ wake_up_process(p);
}
signed long schedule_timeout(signed long timeout)
{
- struct foo_struct foo;
+ struct timer_list timer;
unsigned long expire;
switch (timeout)
@@ -388,16 +381,14 @@ signed long schedule_timeout(signed long timeout)
expire = timeout + jiffies;
- init_timer(&foo.timer);
- foo.timer.expires = expire;
- foo.timer.data = (unsigned long) &foo;
- foo.timer.function = process_timeout;
-
- foo.process = current;
+ init_timer(&timer);
+ timer.expires = expire;
+ timer.data = (unsigned long) current;
+ timer.function = process_timeout;
- add_timer(&foo.timer);
+ add_timer(&timer);
schedule();
- del_timer_sync(&foo.timer);
+ del_timer(&timer);
/* RED-PEN. Timer may be running now on another cpu.
* Pray that process will not exit enough fastly.
*/
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index ab62787d1..5fc0418f9 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -255,9 +255,9 @@ static ctl_table fs_table[] = {
0444, NULL, &proc_dointvec},
{FS_STATINODE, "inode-state", &inodes_stat, 7*sizeof(int),
0444, NULL, &proc_dointvec},
- {FS_NRFILE, "file-nr", &files_stat, 3*sizeof(int),
+ {FS_NRFILE, "file-nr", &nr_files, 3*sizeof(int),
0444, NULL, &proc_dointvec},
- {FS_MAXFILE, "file-max", &files_stat.max_files, sizeof(int),
+ {FS_MAXFILE, "file-max", &max_files, sizeof(int),
0644, NULL, &proc_dointvec},
{FS_NRSUPER, "super-nr", &nr_super_blocks, sizeof(int),
0444, NULL, &proc_dointvec},
diff --git a/kernel/timer.c b/kernel/timer.c
index 5457c450b..9fa35a63b 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -238,17 +238,7 @@ int del_timer_sync(struct timer_list * timer)
if (!running)
return ret;
-
- {
- int count = 50*1000*1000;
- while (timer_is_running(timer) && --count)
- ;
- if (count == 0) {
- printk( "del_timer_sync(%p): deadlock! Called from %p\n",
- timer, __builtin_return_address(0));
- printk("See http://www.uow.edu.au/~andrewm/linux/deadlock.html\n");
- }
- }
+ timer_synchronize(timer);
}
return ret;