aboutsummaryrefslogtreecommitdiffstats
path: root/fs/file_table.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2012-05-08 00:02:02 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-29 23:28:41 -0400
commit962830df366b66e71849040770ae6ba55a8b4aec (patch)
tree0af9487fd8d5a73fa7adbde0bed368ada4298e39 /fs/file_table.c
parenteea62f831b8030b0eeea8314eed73b6132d1de26 (diff)
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>
Diffstat (limited to 'fs/file_table.c')
-rw-r--r--fs/file_table.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/file_table.c b/fs/file_table.c
index f5c67c59ec10..a305d9e2d1b2 100644
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -420,9 +420,9 @@ static inline void __file_sb_list_add(struct file *file, struct super_block *sb)
420 */ 420 */
421void file_sb_list_add(struct file *file, struct super_block *sb) 421void file_sb_list_add(struct file *file, struct super_block *sb)
422{ 422{
423 lg_local_lock(files_lglock); 423 lg_local_lock(&files_lglock);
424 __file_sb_list_add(file, sb); 424 __file_sb_list_add(file, sb);
425 lg_local_unlock(files_lglock); 425 lg_local_unlock(&files_lglock);
426} 426}
427 427
428/** 428/**
@@ -435,9 +435,9 @@ void file_sb_list_add(struct file *file, struct super_block *sb)
435void file_sb_list_del(struct file *file) 435void file_sb_list_del(struct file *file)
436{ 436{
437 if (!list_empty(&file->f_u.fu_list)) { 437 if (!list_empty(&file->f_u.fu_list)) {
438 lg_local_lock_cpu(files_lglock, file_list_cpu(file)); 438 lg_local_lock_cpu(&files_lglock, file_list_cpu(file));
439 list_del_init(&file->f_u.fu_list); 439 list_del_init(&file->f_u.fu_list);
440 lg_local_unlock_cpu(files_lglock, file_list_cpu(file)); 440 lg_local_unlock_cpu(&files_lglock, file_list_cpu(file));
441 } 441 }
442} 442}
443 443
@@ -484,7 +484,7 @@ void mark_files_ro(struct super_block *sb)
484 struct file *f; 484 struct file *f;
485 485
486retry: 486retry:
487 lg_global_lock(files_lglock); 487 lg_global_lock(&files_lglock);
488 do_file_list_for_each_entry(sb, f) { 488 do_file_list_for_each_entry(sb, f) {
489 struct vfsmount *mnt; 489 struct vfsmount *mnt;
490 if (!S_ISREG(f->f_path.dentry->d_inode->i_mode)) 490 if (!S_ISREG(f->f_path.dentry->d_inode->i_mode))
@@ -501,12 +501,12 @@ retry:
501 file_release_write(f); 501 file_release_write(f);
502 mnt = mntget(f->f_path.mnt); 502 mnt = mntget(f->f_path.mnt);
503 /* This can sleep, so we can't hold the spinlock. */ 503 /* This can sleep, so we can't hold the spinlock. */
504 lg_global_unlock(files_lglock); 504 lg_global_unlock(&files_lglock);
505 mnt_drop_write(mnt); 505 mnt_drop_write(mnt);
506 mntput(mnt); 506 mntput(mnt);
507 goto retry; 507 goto retry;
508 } while_file_list_for_each_entry; 508 } while_file_list_for_each_entry;
509 lg_global_unlock(files_lglock); 509 lg_global_unlock(&files_lglock);
510} 510}
511 511
512void __init files_init(unsigned long mempages) 512void __init files_init(unsigned long mempages)
@@ -524,6 +524,6 @@ void __init files_init(unsigned long mempages)
524 n = (mempages * (PAGE_SIZE / 1024)) / 10; 524 n = (mempages * (PAGE_SIZE / 1024)) / 10;
525 files_stat.max_files = max_t(unsigned long, n, NR_FILE); 525 files_stat.max_files = max_t(unsigned long, n, NR_FILE);
526 files_defer_init(); 526 files_defer_init();
527 lg_lock_init(files_lglock); 527 lg_lock_init(&files_lglock, "files_lglock");
528 percpu_counter_init(&nr_files, 0); 528 percpu_counter_init(&nr_files, 0);
529} 529}