Commit e87866ff authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Linus Torvalds

[PATCH] neaten fs/locks.c a little

 - Fix my email address to one which reaches me ;-)
 - Remove timer.h include as we don't use timers.
 - Add module.h.
 - Sort includes alphabetically.
 - Move EXPORT_SYMBOL from ksyms.c to locks.c.
 - Simplify locks_conflict().
parent e3db4852
...@@ -107,22 +107,22 @@ ...@@ -107,22 +107,22 @@
* Use slab allocator instead of kmalloc/kfree. * Use slab allocator instead of kmalloc/kfree.
* Use generic list implementation from <linux/list.h>. * Use generic list implementation from <linux/list.h>.
* Sped up posix_locks_deadlock by only considering blocked locks. * Sped up posix_locks_deadlock by only considering blocked locks.
* Matthew Wilcox <willy@thepuffingroup.com>, March, 2000. * Matthew Wilcox <willy@debian.org>, March, 2000.
* *
* Leases and LOCK_MAND * Leases and LOCK_MAND
* Matthew Wilcox <willy@linuxcare.com>, June, 2000. * Matthew Wilcox <willy@debian.org>, June, 2000.
* Stephen Rothwell <sfr@canb.auug.org.au>, June, 2000. * Stephen Rothwell <sfr@canb.auug.org.au>, June, 2000.
*/ */
#include <linux/slab.h>
#include <linux/file.h>
#include <linux/smp_lock.h>
#include <linux/init.h>
#include <linux/capability.h> #include <linux/capability.h>
#include <linux/timer.h> #include <linux/file.h>
#include <linux/time.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/security.h> #include <linux/security.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/time.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
...@@ -519,19 +519,11 @@ static void locks_delete_lock(struct file_lock **thisfl_p) ...@@ -519,19 +519,11 @@ static void locks_delete_lock(struct file_lock **thisfl_p)
*/ */
static int locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl) static int locks_conflict(struct file_lock *caller_fl, struct file_lock *sys_fl)
{ {
switch (caller_fl->fl_type) { if (sys_fl->fl_type == F_WRLCK)
case F_RDLCK: return 1;
return (sys_fl->fl_type == F_WRLCK); if (caller_fl->fl_type == F_WRLCK)
return 1;
case F_WRLCK: return 0;
return (1);
default:
printk(KERN_ERR "locks_conflict(): impossible lock type - %d\n",
caller_fl->fl_type);
break;
}
return (0); /* This should never happen */
} }
/* Determine if lock sys_fl blocks lock caller_fl. POSIX specific /* Determine if lock sys_fl blocks lock caller_fl. POSIX specific
...@@ -1966,3 +1958,13 @@ static int __init filelock_init(void) ...@@ -1966,3 +1958,13 @@ static int __init filelock_init(void)
} }
module_init(filelock_init) module_init(filelock_init)
EXPORT_SYMBOL(file_lock_list);
EXPORT_SYMBOL(locks_init_lock);
EXPORT_SYMBOL(locks_copy_lock);
EXPORT_SYMBOL(posix_lock_file);
EXPORT_SYMBOL(posix_test_lock);
EXPORT_SYMBOL(posix_block_lock);
EXPORT_SYMBOL(posix_unblock_lock);
EXPORT_SYMBOL(posix_locks_deadlock);
EXPORT_SYMBOL(locks_mandatory_area);
...@@ -235,15 +235,6 @@ EXPORT_SYMBOL(generic_file_write_nolock); ...@@ -235,15 +235,6 @@ EXPORT_SYMBOL(generic_file_write_nolock);
EXPORT_SYMBOL(generic_file_mmap); EXPORT_SYMBOL(generic_file_mmap);
EXPORT_SYMBOL(generic_file_readonly_mmap); EXPORT_SYMBOL(generic_file_readonly_mmap);
EXPORT_SYMBOL(generic_ro_fops); EXPORT_SYMBOL(generic_ro_fops);
EXPORT_SYMBOL(file_lock_list);
EXPORT_SYMBOL(locks_init_lock);
EXPORT_SYMBOL(locks_copy_lock);
EXPORT_SYMBOL(posix_lock_file);
EXPORT_SYMBOL(posix_test_lock);
EXPORT_SYMBOL(posix_block_lock);
EXPORT_SYMBOL(posix_unblock_lock);
EXPORT_SYMBOL(posix_locks_deadlock);
EXPORT_SYMBOL(locks_mandatory_area);
EXPORT_SYMBOL(dput); EXPORT_SYMBOL(dput);
EXPORT_SYMBOL(have_submounts); EXPORT_SYMBOL(have_submounts);
EXPORT_SYMBOL(d_find_alias); EXPORT_SYMBOL(d_find_alias);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment