aboutsummaryrefslogtreecommitdiffstats
path: root/fs/isofs/inode.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2010-09-12 13:05:56 -0400
committerArnd Bergmann <arnd@arndb.de>2010-10-04 15:10:45 -0400
commit4f819a7899b06afcd7623ab9d00fd81503ad3e24 (patch)
tree4506a992e9207f6374803e89d9a0e9b9a9b33ddb /fs/isofs/inode.c
parent3768744cfea7b995dce27f02341161fbfdfee80c (diff)
BKL: Remove BKL from isofs
As in other file systems, we can replace the big kernel lock with a private mutex in isofs. This means we can now access multiple file systems concurrently, but it also means that we serialize readdir and lookup across sleeping operations which previously released the big kernel lock. This should not matter though, as these operations are in practice serialized through the hardware access. The isofs_get_blocks functions now does not take any lock any more, it used to recursively get the BKL. After looking at the code for hours, I convinced myself that it was never needed here anyway, because it only reads constant fields of the inode and writes to a buffer head array that is at this time only visible to the caller. The get_sb and fill_super operations do not need the locking at all because they operate on a file system that is either about to be created or to be destroyed but in either case is not visible to other threads. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'fs/isofs/inode.c')
-rw-r--r--fs/isofs/inode.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 05baf7721e8..09ff41a752a 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -17,7 +17,6 @@
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <linux/nls.h> 18#include <linux/nls.h>
19#include <linux/ctype.h> 19#include <linux/ctype.h>
20#include <linux/smp_lock.h>
21#include <linux/statfs.h> 20#include <linux/statfs.h>
22#include <linux/cdrom.h> 21#include <linux/cdrom.h>
23#include <linux/parser.h> 22#include <linux/parser.h>
@@ -44,11 +43,7 @@ static void isofs_put_super(struct super_block *sb)
44 struct isofs_sb_info *sbi = ISOFS_SB(sb); 43 struct isofs_sb_info *sbi = ISOFS_SB(sb);
45 44
46#ifdef CONFIG_JOLIET 45#ifdef CONFIG_JOLIET
47 lock_kernel();
48
49 unload_nls(sbi->s_nls_iocharset); 46 unload_nls(sbi->s_nls_iocharset);
50
51 unlock_kernel();
52#endif 47#endif
53 48
54 kfree(sbi); 49 kfree(sbi);
@@ -571,15 +566,11 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
571 int table, error = -EINVAL; 566 int table, error = -EINVAL;
572 unsigned int vol_desc_start; 567 unsigned int vol_desc_start;
573 568
574 lock_kernel();
575
576 save_mount_options(s, data); 569 save_mount_options(s, data);
577 570
578 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 571 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
579 if (!sbi) { 572 if (!sbi)
580 unlock_kernel();
581 return -ENOMEM; 573 return -ENOMEM;
582 }
583 s->s_fs_info = sbi; 574 s->s_fs_info = sbi;
584 575
585 if (!parse_options((char *)data, &opt)) 576 if (!parse_options((char *)data, &opt))
@@ -827,6 +818,7 @@ root_found:
827 sbi->s_utf8 = opt.utf8; 818 sbi->s_utf8 = opt.utf8;
828 sbi->s_nocompress = opt.nocompress; 819 sbi->s_nocompress = opt.nocompress;
829 sbi->s_overriderockperm = opt.overriderockperm; 820 sbi->s_overriderockperm = opt.overriderockperm;
821 mutex_init(&sbi->s_mutex);
830 /* 822 /*
831 * It would be incredibly stupid to allow people to mark every file 823 * It would be incredibly stupid to allow people to mark every file
832 * on the disk as suid, so we merely allow them to set the default 824 * on the disk as suid, so we merely allow them to set the default
@@ -904,7 +896,6 @@ root_found:
904 896
905 kfree(opt.iocharset); 897 kfree(opt.iocharset);
906 898
907 unlock_kernel();
908 return 0; 899 return 0;
909 900
910 /* 901 /*
@@ -944,7 +935,6 @@ out_freesbi:
944 kfree(opt.iocharset); 935 kfree(opt.iocharset);
945 kfree(sbi); 936 kfree(sbi);
946 s->s_fs_info = NULL; 937 s->s_fs_info = NULL;
947 unlock_kernel();
948 return error; 938 return error;
949} 939}
950 940
@@ -983,8 +973,6 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
983 int section, rv, error; 973 int section, rv, error;
984 struct iso_inode_info *ei = ISOFS_I(inode); 974 struct iso_inode_info *ei = ISOFS_I(inode);
985 975
986 lock_kernel();
987
988 error = -EIO; 976 error = -EIO;
989 rv = 0; 977 rv = 0;
990 if (iblock < 0 || iblock != iblock_s) { 978 if (iblock < 0 || iblock != iblock_s) {
@@ -1060,7 +1048,6 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s,
1060 1048
1061 error = 0; 1049 error = 0;
1062abort: 1050abort:
1063 unlock_kernel();
1064 return rv != 0 ? rv : error; 1051 return rv != 0 ? rv : error;
1065} 1052}
1066 1053