diff options
author | Arnd Bergmann <arnd@arndb.de> | 2010-09-12 13:05:56 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2010-10-04 15:10:45 -0400 |
commit | 4f819a7899b06afcd7623ab9d00fd81503ad3e24 (patch) | |
tree | 4506a992e9207f6374803e89d9a0e9b9a9b33ddb /fs/isofs/rock.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/rock.c')
-rw-r--r-- | fs/isofs/rock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/isofs/rock.c b/fs/isofs/rock.c index 96a685c550f..f9cd04db6ea 100644 --- a/fs/isofs/rock.c +++ b/fs/isofs/rock.c | |||
@@ -8,7 +8,6 @@ | |||
8 | 8 | ||
9 | #include <linux/slab.h> | 9 | #include <linux/slab.h> |
10 | #include <linux/pagemap.h> | 10 | #include <linux/pagemap.h> |
11 | #include <linux/smp_lock.h> | ||
12 | 11 | ||
13 | #include "isofs.h" | 12 | #include "isofs.h" |
14 | #include "rock.h" | 13 | #include "rock.h" |
@@ -661,6 +660,7 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page) | |||
661 | { | 660 | { |
662 | struct inode *inode = page->mapping->host; | 661 | struct inode *inode = page->mapping->host; |
663 | struct iso_inode_info *ei = ISOFS_I(inode); | 662 | struct iso_inode_info *ei = ISOFS_I(inode); |
663 | struct isofs_sb_info *sbi = ISOFS_SB(inode->i_sb); | ||
664 | char *link = kmap(page); | 664 | char *link = kmap(page); |
665 | unsigned long bufsize = ISOFS_BUFFER_SIZE(inode); | 665 | unsigned long bufsize = ISOFS_BUFFER_SIZE(inode); |
666 | struct buffer_head *bh; | 666 | struct buffer_head *bh; |
@@ -673,12 +673,12 @@ static int rock_ridge_symlink_readpage(struct file *file, struct page *page) | |||
673 | struct rock_state rs; | 673 | struct rock_state rs; |
674 | int ret; | 674 | int ret; |
675 | 675 | ||
676 | if (!ISOFS_SB(inode->i_sb)->s_rock) | 676 | if (!sbi->s_rock) |
677 | goto error; | 677 | goto error; |
678 | 678 | ||
679 | init_rock_state(&rs, inode); | 679 | init_rock_state(&rs, inode); |
680 | block = ei->i_iget5_block; | 680 | block = ei->i_iget5_block; |
681 | lock_kernel(); | 681 | mutex_lock(&sbi->s_mutex); |
682 | bh = sb_bread(inode->i_sb, block); | 682 | bh = sb_bread(inode->i_sb, block); |
683 | if (!bh) | 683 | if (!bh) |
684 | goto out_noread; | 684 | goto out_noread; |
@@ -748,7 +748,7 @@ repeat: | |||
748 | goto fail; | 748 | goto fail; |
749 | brelse(bh); | 749 | brelse(bh); |
750 | *rpnt = '\0'; | 750 | *rpnt = '\0'; |
751 | unlock_kernel(); | 751 | mutex_unlock(&sbi->s_mutex); |
752 | SetPageUptodate(page); | 752 | SetPageUptodate(page); |
753 | kunmap(page); | 753 | kunmap(page); |
754 | unlock_page(page); | 754 | unlock_page(page); |
@@ -765,7 +765,7 @@ out_bad_span: | |||
765 | printk("symlink spans iso9660 blocks\n"); | 765 | printk("symlink spans iso9660 blocks\n"); |
766 | fail: | 766 | fail: |
767 | brelse(bh); | 767 | brelse(bh); |
768 | unlock_kernel(); | 768 | mutex_unlock(&sbi->s_mutex); |
769 | error: | 769 | error: |
770 | SetPageError(page); | 770 | SetPageError(page); |
771 | kunmap(page); | 771 | kunmap(page); |