aboutsummaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2012-05-08 13:32:02 +0930
committerZiyan <jaraidaniel@gmail.com>2016-03-11 16:08:00 +0100
commit7fc94f075d858ebc4e0705e0aa71c0e372913214 (patch)
tree800dc7810e83a9f35201c66fba4ba9089b226931 /fs/file_table.c
parent65a56f6cfce5a348d7584e4615b682e1a124d6d2 (diff)
downloadkernel_samsung_espresso10-7fc94f075d858ebc4e0705e0aa71c0e372913214.zip
kernel_samsung_espresso10-7fc94f075d858ebc4e0705e0aa71c0e372913214.tar.gz
kernel_samsung_espresso10-7fc94f075d858ebc4e0705e0aa71c0e372913214.tar.bz2
brlocks/lglocks: API cleanups
lglocks and brlocks are currently generated with some complicated macros in lglock.h. But there's no reason to not just use common utility functions and put all the data into a common data structure. In preparation, this patch changes the API to look more like normal function calls with pointers, not magic macros. The patch is rather large because I move over all users in one go to keep it bisectable. This impacts the VFS somewhat in terms of lines changed. But no actual behaviour change. [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Andi Kleen <ak@linux.intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> (cherry picked from commit 962830df366b66e71849040770ae6ba55a8b4aec) Conflicts: fs/dcache.c
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index f255e76..27541a5 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -421,9 +421,9 @@ static inline void __file_sb_list_add(struct file *file, struct super_block *sb)
*/
void file_sb_list_add(struct file *file, struct super_block *sb)
{
- lg_local_lock(files_lglock);
+ lg_local_lock(&files_lglock);
__file_sb_list_add(file, sb);
- lg_local_unlock(files_lglock);
+ lg_local_unlock(&files_lglock);
}
/**
@@ -436,9 +436,9 @@ void file_sb_list_add(struct file *file, struct super_block *sb)
void file_sb_list_del(struct file *file)
{
if (!list_empty(&file->f_u.fu_list)) {
- lg_local_lock_cpu(files_lglock, file_list_cpu(file));
+ lg_local_lock_cpu(&files_lglock, file_list_cpu(file));
list_del_init(&file->f_u.fu_list);
- lg_local_unlock_cpu(files_lglock, file_list_cpu(file));
+ lg_local_unlock_cpu(&files_lglock, file_list_cpu(file));
}
}
@@ -477,7 +477,7 @@ int fs_may_remount_ro(struct super_block *sb)
{
struct file *file;
/* Check that no files are currently opened for writing. */
- lg_global_lock(files_lglock);
+ lg_global_lock(&files_lglock);
do_file_list_for_each_entry(sb, file) {
struct inode *inode = file->f_path.dentry->d_inode;
@@ -489,10 +489,10 @@ int fs_may_remount_ro(struct super_block *sb)
if (S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE))
goto too_bad;
} while_file_list_for_each_entry;
- lg_global_unlock(files_lglock);
+ lg_global_unlock(&files_lglock);
return 1; /* Tis' cool bro. */
too_bad:
- lg_global_unlock(files_lglock);
+ lg_global_unlock(&files_lglock);
return 0;
}
@@ -508,7 +508,7 @@ void mark_files_ro(struct super_block *sb)
struct file *f;
retry:
- lg_global_lock(files_lglock);
+ lg_global_lock(&files_lglock);
do_file_list_for_each_entry(sb, f) {
struct vfsmount *mnt;
if (!S_ISREG(f->f_path.dentry->d_inode->i_mode))
@@ -525,12 +525,12 @@ retry:
file_release_write(f);
mnt = mntget(f->f_path.mnt);
/* This can sleep, so we can't hold the spinlock. */
- lg_global_unlock(files_lglock);
+ lg_global_unlock(&files_lglock);
mnt_drop_write(mnt);
mntput(mnt);
goto retry;
} while_file_list_for_each_entry;
- lg_global_unlock(files_lglock);
+ lg_global_unlock(&files_lglock);
}
void __init files_init(unsigned long mempages)
@@ -548,6 +548,6 @@ void __init files_init(unsigned long mempages)
n = (mempages * (PAGE_SIZE / 1024)) / 10;
files_stat.max_files = max_t(unsigned long, n, NR_FILE);
files_defer_init();
- lg_lock_init(files_lglock);
+ lg_lock_init(&files_lglock, "files_lglock");
percpu_counter_init(&nr_files, 0);
}