aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-02-24 07:25:33 -0500
committerArnd Bergmann <arnd@arndb.de>2010-10-04 15:10:51 -0400
commit60056794127a25d641465b706e8828186f7a2e1f (patch)
treed325fbc91d9eb5f1373d2a6c90dfe5bd34c4cc7d
parent3dbc4b32d0b39701cbec65582e196a20889155fb (diff)
BKL: Remove BKL from OCFS2
The BKL in ocfs2/dlmfs is used in put_super, fill_super and remount_fs that are all three protected by the superblocks s_umount rw_semaphore. The use in ocfs2_control_open is evidently unrelated and the function is protected by ocfs2_control_lock. Therefore it is safe to remove the BKL entirely. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <joel.becker@oracle.com>
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c9
-rw-r--r--fs/ocfs2/stack_user.c3
-rw-r--r--fs/ocfs2/super.c12
3 files changed, 1 insertions, 23 deletions
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 667d7ceba8c9..c2903b84bb7a 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -44,7 +44,6 @@
44#include <linux/string.h> 44#include <linux/string.h>
45#include <linux/backing-dev.h> 45#include <linux/backing-dev.h>
46#include <linux/poll.h> 46#include <linux/poll.h>
47#include <linux/smp_lock.h>
48 47
49#include <asm/uaccess.h> 48#include <asm/uaccess.h>
50 49
@@ -589,27 +588,21 @@ static int dlmfs_fill_super(struct super_block * sb,
589 struct inode * inode; 588 struct inode * inode;
590 struct dentry * root; 589 struct dentry * root;
591 590
592 lock_kernel();
593
594 sb->s_maxbytes = MAX_LFS_FILESIZE; 591 sb->s_maxbytes = MAX_LFS_FILESIZE;
595 sb->s_blocksize = PAGE_CACHE_SIZE; 592 sb->s_blocksize = PAGE_CACHE_SIZE;
596 sb->s_blocksize_bits = PAGE_CACHE_SHIFT; 593 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
597 sb->s_magic = DLMFS_MAGIC; 594 sb->s_magic = DLMFS_MAGIC;
598 sb->s_op = &dlmfs_ops; 595 sb->s_op = &dlmfs_ops;
599 inode = dlmfs_get_root_inode(sb); 596 inode = dlmfs_get_root_inode(sb);
600 if (!inode) { 597 if (!inode)
601 unlock_kernel();
602 return -ENOMEM; 598 return -ENOMEM;
603 }
604 599
605 root = d_alloc_root(inode); 600 root = d_alloc_root(inode);
606 if (!root) { 601 if (!root) {
607 iput(inode); 602 iput(inode);
608 unlock_kernel();
609 return -ENOMEM; 603 return -ENOMEM;
610 } 604 }
611 sb->s_root = root; 605 sb->s_root = root;
612 unlock_kernel();
613 return 0; 606 return 0;
614} 607}
615 608
diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index 2dc57bca0688..0e68f542ef2e 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -22,7 +22,6 @@
22#include <linux/miscdevice.h> 22#include <linux/miscdevice.h>
23#include <linux/mutex.h> 23#include <linux/mutex.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/smp_lock.h>
26#include <linux/reboot.h> 25#include <linux/reboot.h>
27#include <asm/uaccess.h> 26#include <asm/uaccess.h>
28 27
@@ -612,12 +611,10 @@ static int ocfs2_control_open(struct inode *inode, struct file *file)
612 return -ENOMEM; 611 return -ENOMEM;
613 p->op_this_node = -1; 612 p->op_this_node = -1;
614 613
615 lock_kernel();
616 mutex_lock(&ocfs2_control_lock); 614 mutex_lock(&ocfs2_control_lock);
617 file->private_data = p; 615 file->private_data = p;
618 list_add(&p->op_list, &ocfs2_control_private_list); 616 list_add(&p->op_list, &ocfs2_control_private_list);
619 mutex_unlock(&ocfs2_control_lock); 617 mutex_unlock(&ocfs2_control_lock);
620 unlock_kernel();
621 618
622 return 0; 619 return 0;
623} 620}
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index b7e4f2d19d40..b7d724393b5a 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -609,8 +609,6 @@ static int ocfs2_remount(struct super_block *sb, int *flags, char *data)
609 struct mount_options parsed_options; 609 struct mount_options parsed_options;
610 struct ocfs2_super *osb = OCFS2_SB(sb); 610 struct ocfs2_super *osb = OCFS2_SB(sb);
611 611
612 lock_kernel();
613
614 if (!ocfs2_parse_options(sb, data, &parsed_options, 1) || 612 if (!ocfs2_parse_options(sb, data, &parsed_options, 1) ||
615 !ocfs2_check_set_options(sb, &parsed_options)) { 613 !ocfs2_check_set_options(sb, &parsed_options)) {
616 ret = -EINVAL; 614 ret = -EINVAL;
@@ -717,7 +715,6 @@ unlock_osb:
717 MS_POSIXACL : 0); 715 MS_POSIXACL : 0);
718 } 716 }
719out: 717out:
720 unlock_kernel();
721 return ret; 718 return ret;
722} 719}
723 720
@@ -1002,8 +999,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
1002 char nodestr[8]; 999 char nodestr[8];
1003 struct ocfs2_blockcheck_stats stats; 1000 struct ocfs2_blockcheck_stats stats;
1004 1001
1005 lock_kernel();
1006
1007 mlog_entry("%p, %p, %i", sb, data, silent); 1002 mlog_entry("%p, %p, %i", sb, data, silent);
1008 1003
1009 if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) { 1004 if (!ocfs2_parse_options(sb, data, &parsed_options, 0)) {
@@ -1181,7 +1176,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
1181 atomic_set(&osb->vol_state, VOLUME_DISABLED); 1176 atomic_set(&osb->vol_state, VOLUME_DISABLED);
1182 wake_up(&osb->osb_mount_event); 1177 wake_up(&osb->osb_mount_event);
1183 mlog_exit(status); 1178 mlog_exit(status);
1184 unlock_kernel();
1185 return status; 1179 return status;
1186 } 1180 }
1187 } 1181 }
@@ -1196,7 +1190,6 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
1196 ocfs2_orphan_scan_start(osb); 1190 ocfs2_orphan_scan_start(osb);
1197 1191
1198 mlog_exit(status); 1192 mlog_exit(status);
1199 unlock_kernel();
1200 return status; 1193 return status;
1201 1194
1202read_super_error: 1195read_super_error:
@@ -1212,7 +1205,6 @@ read_super_error:
1212 } 1205 }
1213 1206
1214 mlog_exit(status); 1207 mlog_exit(status);
1215 unlock_kernel();
1216 return status; 1208 return status;
1217} 1209}
1218 1210
@@ -1645,13 +1637,9 @@ static void ocfs2_put_super(struct super_block *sb)
1645{ 1637{
1646 mlog_entry("(0x%p)\n", sb); 1638 mlog_entry("(0x%p)\n", sb);
1647 1639
1648 lock_kernel();
1649
1650 ocfs2_sync_blockdev(sb); 1640 ocfs2_sync_blockdev(sb);
1651 ocfs2_dismount_volume(sb, 0); 1641 ocfs2_dismount_volume(sb, 0);
1652 1642
1653 unlock_kernel();
1654
1655 mlog_exit_void(); 1643 mlog_exit_void();
1656} 1644}
1657 1645