diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-09-12 19:05:56 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2010-10-04 21:10:45 +0200 |
commit | 4f819a7899b06afcd7623ab9d00fd81503ad3e24 (patch) | |
tree | 4506a992e9207f6374803e89d9a0e9b9a9b33ddb /fs/isofs/inode.c | |
parent | 3768744cfea7b995dce27f02341161fbfdfee80c (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.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 05baf7721e8c..09ff41a752a0 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -17,7 +17,6 @@ #include <linux/slab.h> #include <linux/nls.h> #include <linux/ctype.h> -#include <linux/smp_lock.h> #include <linux/statfs.h> #include <linux/cdrom.h> #include <linux/parser.h> @@ -44,11 +43,7 @@ static void isofs_put_super(struct super_block *sb) struct isofs_sb_info *sbi = ISOFS_SB(sb); #ifdef CONFIG_JOLIET - lock_kernel(); - unload_nls(sbi->s_nls_iocharset); - - unlock_kernel(); #endif kfree(sbi); @@ -571,15 +566,11 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) int table, error = -EINVAL; unsigned int vol_desc_start; - lock_kernel(); - save_mount_options(s, data); sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); - if (!sbi) { - unlock_kernel(); + if (!sbi) return -ENOMEM; - } s->s_fs_info = sbi; if (!parse_options((char *)data, &opt)) @@ -827,6 +818,7 @@ root_found: sbi->s_utf8 = opt.utf8; sbi->s_nocompress = opt.nocompress; sbi->s_overriderockperm = opt.overriderockperm; + mutex_init(&sbi->s_mutex); /* * It would be incredibly stupid to allow people to mark every file * on the disk as suid, so we merely allow them to set the default @@ -904,7 +896,6 @@ root_found: kfree(opt.iocharset); - unlock_kernel(); return 0; /* @@ -944,7 +935,6 @@ out_freesbi: kfree(opt.iocharset); kfree(sbi); s->s_fs_info = NULL; - unlock_kernel(); return error; } @@ -983,8 +973,6 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s, int section, rv, error; struct iso_inode_info *ei = ISOFS_I(inode); - lock_kernel(); - error = -EIO; rv = 0; if (iblock < 0 || iblock != iblock_s) { @@ -1060,7 +1048,6 @@ int isofs_get_blocks(struct inode *inode, sector_t iblock_s, error = 0; abort: - unlock_kernel(); return rv != 0 ? rv : error; } |