aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 11:46:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-17 11:46:57 -0400
commitfeb72ce827b939d5228664c92c2dfed7753cae46 (patch)
treede2d78ee45d9e0df234e98eea67ebc3a21525d8f
parent65795efbd380a832ae508b04dba8f8e53f0b84d9 (diff)
parent5ac3455a843d2ca77333c954eea83aa4514c8199 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: get rid of BKL in fs/sysv get rid of BKL in fs/minix get rid of BKL in fs/efs befs ->pust_super() doesn't need BKL Cleanup of adfs headers 9P doesn't need BKL in ->umount_begin() fuse doesn't need BKL in ->umount_begin() No instance of ->bmap() needs BKL remove unlock_kernel() left accidentally ext4: avoid unnecessary spinlock in critical POSIX ACL path ext3: avoid unnecessary spinlock in critical POSIX ACL path
-rw-r--r--Documentation/filesystems/Locking2
-rw-r--r--fs/9p/vfs_super.c3
-rw-r--r--fs/adfs/adfs.h55
-rw-r--r--fs/adfs/dir.c8
-rw-r--r--fs/adfs/dir_f.c8
-rw-r--r--fs/adfs/dir_fplus.c8
-rw-r--r--fs/adfs/file.c4
-rw-r--r--fs/adfs/inode.c10
-rw-r--r--fs/adfs/map.c6
-rw-r--r--fs/adfs/super.c17
-rw-r--r--fs/befs/linuxvfs.c4
-rw-r--r--fs/efs/dir.c5
-rw-r--r--fs/efs/namei.c9
-rw-r--r--fs/efs/symlink.c7
-rw-r--r--fs/ext3/acl.c13
-rw-r--r--fs/ext4/acl.c13
-rw-r--r--fs/fuse/inode.c3
-rw-r--r--fs/ioctl.c2
-rw-r--r--fs/minix/bitmap.c25
-rw-r--r--fs/minix/dir.c5
-rw-r--r--fs/minix/inode.c4
-rw-r--r--fs/super.c12
-rw-r--r--fs/sysv/dir.c5
-rw-r--r--fs/sysv/inode.c11
-rw-r--r--include/linux/adfs_fs.h13
-rw-r--r--include/linux/adfs_fs_i.h24
-rw-r--r--include/linux/adfs_fs_sb.h38
27 files changed, 95 insertions, 219 deletions
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
index 3120f8dd2c31..229d7b7c50a3 100644
--- a/Documentation/filesystems/Locking
+++ b/Documentation/filesystems/Locking
@@ -187,7 +187,7 @@ readpages: no
187write_begin: no locks the page yes 187write_begin: no locks the page yes
188write_end: no yes, unlocks yes 188write_end: no yes, unlocks yes
189perform_write: no n/a yes 189perform_write: no n/a yes
190bmap: yes 190bmap: no
191invalidatepage: no yes 191invalidatepage: no yes
192releasepage: no yes 192releasepage: no yes
193direct_IO: no 193direct_IO: no
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c
index ab5547ff29a1..38d695d66a0b 100644
--- a/fs/9p/vfs_super.c
+++ b/fs/9p/vfs_super.c
@@ -37,7 +37,6 @@
37#include <linux/mount.h> 37#include <linux/mount.h>
38#include <linux/idr.h> 38#include <linux/idr.h>
39#include <linux/sched.h> 39#include <linux/sched.h>
40#include <linux/smp_lock.h>
41#include <net/9p/9p.h> 40#include <net/9p/9p.h>
42#include <net/9p/client.h> 41#include <net/9p/client.h>
43 42
@@ -231,10 +230,8 @@ v9fs_umount_begin(struct super_block *sb)
231{ 230{
232 struct v9fs_session_info *v9ses; 231 struct v9fs_session_info *v9ses;
233 232
234 lock_kernel();
235 v9ses = sb->s_fs_info; 233 v9ses = sb->s_fs_info;
236 v9fs_session_cancel(v9ses); 234 v9fs_session_cancel(v9ses);
237 unlock_kernel();
238} 235}
239 236
240static const struct super_operations v9fs_super_ops = { 237static const struct super_operations v9fs_super_ops = {
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h
index a6665f37f456..9cc18775b832 100644
--- a/fs/adfs/adfs.h
+++ b/fs/adfs/adfs.h
@@ -1,3 +1,6 @@
1#include <linux/fs.h>
2#include <linux/adfs_fs.h>
3
1/* Internal data structures for ADFS */ 4/* Internal data structures for ADFS */
2 5
3#define ADFS_FREE_FRAG 0 6#define ADFS_FREE_FRAG 0
@@ -17,6 +20,58 @@
17struct buffer_head; 20struct buffer_head;
18 21
19/* 22/*
23 * adfs file system inode data in memory
24 */
25struct adfs_inode_info {
26 loff_t mmu_private;
27 unsigned long parent_id; /* object id of parent */
28 __u32 loadaddr; /* RISC OS load address */
29 __u32 execaddr; /* RISC OS exec address */
30 unsigned int filetype; /* RISC OS file type */
31 unsigned int attr; /* RISC OS permissions */
32 unsigned int stamped:1; /* RISC OS file has date/time */
33 struct inode vfs_inode;
34};
35
36/*
37 * Forward-declare this
38 */
39struct adfs_discmap;
40struct adfs_dir_ops;
41
42/*
43 * ADFS file system superblock data in memory
44 */
45struct adfs_sb_info {
46 struct adfs_discmap *s_map; /* bh list containing map */
47 struct adfs_dir_ops *s_dir; /* directory operations */
48
49 uid_t s_uid; /* owner uid */
50 gid_t s_gid; /* owner gid */
51 umode_t s_owner_mask; /* ADFS owner perm -> unix perm */
52 umode_t s_other_mask; /* ADFS other perm -> unix perm */
53
54 __u32 s_ids_per_zone; /* max. no ids in one zone */
55 __u32 s_idlen; /* length of ID in map */
56 __u32 s_map_size; /* sector size of a map */
57 unsigned long s_size; /* total size (in blocks) of this fs */
58 signed int s_map2blk; /* shift left by this for map->sector */
59 unsigned int s_log2sharesize;/* log2 share size */
60 __le32 s_version; /* disc format version */
61 unsigned int s_namelen; /* maximum number of characters in name */
62};
63
64static inline struct adfs_sb_info *ADFS_SB(struct super_block *sb)
65{
66 return sb->s_fs_info;
67}
68
69static inline struct adfs_inode_info *ADFS_I(struct inode *inode)
70{
71 return container_of(inode, struct adfs_inode_info, vfs_inode);
72}
73
74/*
20 * Directory handling 75 * Directory handling
21 */ 76 */
22struct adfs_dir { 77struct adfs_dir {
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index 4d4073447d1a..23aa52f548a0 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -9,15 +9,7 @@
9 * 9 *
10 * Common directory handling for ADFS 10 * Common directory handling for ADFS
11 */ 11 */
12#include <linux/errno.h>
13#include <linux/fs.h>
14#include <linux/adfs_fs.h>
15#include <linux/time.h>
16#include <linux/stat.h>
17#include <linux/spinlock.h>
18#include <linux/smp_lock.h> 12#include <linux/smp_lock.h>
19#include <linux/buffer_head.h> /* for file_fsync() */
20
21#include "adfs.h" 13#include "adfs.h"
22 14
23/* 15/*
diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c
index 31df6adf0de6..bafc71222e25 100644
--- a/fs/adfs/dir_f.c
+++ b/fs/adfs/dir_f.c
@@ -9,15 +9,7 @@
9 * 9 *
10 * E and F format directory handling 10 * E and F format directory handling
11 */ 11 */
12#include <linux/errno.h>
13#include <linux/fs.h>
14#include <linux/adfs_fs.h>
15#include <linux/time.h>
16#include <linux/stat.h>
17#include <linux/spinlock.h>
18#include <linux/buffer_head.h> 12#include <linux/buffer_head.h>
19#include <linux/string.h>
20
21#include "adfs.h" 13#include "adfs.h"
22#include "dir_f.h" 14#include "dir_f.h"
23 15
diff --git a/fs/adfs/dir_fplus.c b/fs/adfs/dir_fplus.c
index 139e0f345f18..1796bb352d05 100644
--- a/fs/adfs/dir_fplus.c
+++ b/fs/adfs/dir_fplus.c
@@ -7,15 +7,7 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/errno.h>
11#include <linux/fs.h>
12#include <linux/adfs_fs.h>
13#include <linux/time.h>
14#include <linux/stat.h>
15#include <linux/spinlock.h>
16#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
17#include <linux/string.h>
18
19#include "adfs.h" 11#include "adfs.h"
20#include "dir_fplus.h" 12#include "dir_fplus.h"
21 13
diff --git a/fs/adfs/file.c b/fs/adfs/file.c
index 8224d54a2afb..005ea34d1758 100644
--- a/fs/adfs/file.c
+++ b/fs/adfs/file.c
@@ -19,10 +19,6 @@
19 * 19 *
20 * adfs regular file handling primitives 20 * adfs regular file handling primitives
21 */ 21 */
22#include <linux/fs.h>
23#include <linux/buffer_head.h> /* for file_fsync() */
24#include <linux/adfs_fs.h>
25
26#include "adfs.h" 22#include "adfs.h"
27 23
28const struct file_operations adfs_file_operations = { 24const struct file_operations adfs_file_operations = {
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 05b3a677201d..798cb071d132 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -7,17 +7,8 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/errno.h>
11#include <linux/fs.h>
12#include <linux/adfs_fs.h>
13#include <linux/time.h>
14#include <linux/stat.h>
15#include <linux/string.h>
16#include <linux/mm.h>
17#include <linux/smp_lock.h> 10#include <linux/smp_lock.h>
18#include <linux/module.h>
19#include <linux/buffer_head.h> 11#include <linux/buffer_head.h>
20
21#include "adfs.h" 12#include "adfs.h"
22 13
23/* 14/*
@@ -395,4 +386,3 @@ int adfs_write_inode(struct inode *inode, int wait)
395 unlock_kernel(); 386 unlock_kernel();
396 return ret; 387 return ret;
397} 388}
398MODULE_LICENSE("GPL");
diff --git a/fs/adfs/map.c b/fs/adfs/map.c
index 568081b93f73..d1a5932bb0f1 100644
--- a/fs/adfs/map.c
+++ b/fs/adfs/map.c
@@ -7,14 +7,8 @@
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/errno.h>
11#include <linux/fs.h>
12#include <linux/adfs_fs.h>
13#include <linux/spinlock.h>
14#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
15
16#include <asm/unaligned.h> 11#include <asm/unaligned.h>
17
18#include "adfs.h" 12#include "adfs.h"
19 13
20/* 14/*
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index 0ec5aaf47aa7..aad92f0a1048 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -8,26 +8,12 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/errno.h>
12#include <linux/fs.h>
13#include <linux/adfs_fs.h>
14#include <linux/slab.h>
15#include <linux/time.h>
16#include <linux/stat.h>
17#include <linux/string.h>
18#include <linux/init.h> 11#include <linux/init.h>
19#include <linux/buffer_head.h> 12#include <linux/buffer_head.h>
20#include <linux/vfs.h>
21#include <linux/parser.h> 13#include <linux/parser.h>
22#include <linux/bitops.h>
23#include <linux/mount.h> 14#include <linux/mount.h>
24#include <linux/seq_file.h> 15#include <linux/seq_file.h>
25 16#include <linux/statfs.h>
26#include <asm/uaccess.h>
27#include <asm/system.h>
28
29#include <stdarg.h>
30
31#include "adfs.h" 17#include "adfs.h"
32#include "dir_f.h" 18#include "dir_f.h"
33#include "dir_fplus.h" 19#include "dir_fplus.h"
@@ -534,3 +520,4 @@ static void __exit exit_adfs_fs(void)
534 520
535module_init(init_adfs_fs) 521module_init(init_adfs_fs)
536module_exit(exit_adfs_fs) 522module_exit(exit_adfs_fs)
523MODULE_LICENSE("GPL");
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 89cd2deeb4af..615d5496fe0f 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -735,8 +735,6 @@ parse_options(char *options, befs_mount_options * opts)
735static void 735static void
736befs_put_super(struct super_block *sb) 736befs_put_super(struct super_block *sb)
737{ 737{
738 lock_kernel();
739
740 kfree(BEFS_SB(sb)->mount_opts.iocharset); 738 kfree(BEFS_SB(sb)->mount_opts.iocharset);
741 BEFS_SB(sb)->mount_opts.iocharset = NULL; 739 BEFS_SB(sb)->mount_opts.iocharset = NULL;
742 740
@@ -747,8 +745,6 @@ befs_put_super(struct super_block *sb)
747 745
748 kfree(sb->s_fs_info); 746 kfree(sb->s_fs_info);
749 sb->s_fs_info = NULL; 747 sb->s_fs_info = NULL;
750
751 unlock_kernel();
752} 748}
753 749
754/* Allocate private field of the superblock, fill it. 750/* Allocate private field of the superblock, fill it.
diff --git a/fs/efs/dir.c b/fs/efs/dir.c
index 49308a29798a..7ee6f7e3a608 100644
--- a/fs/efs/dir.c
+++ b/fs/efs/dir.c
@@ -5,12 +5,12 @@
5 */ 5 */
6 6
7#include <linux/buffer_head.h> 7#include <linux/buffer_head.h>
8#include <linux/smp_lock.h>
9#include "efs.h" 8#include "efs.h"
10 9
11static int efs_readdir(struct file *, void *, filldir_t); 10static int efs_readdir(struct file *, void *, filldir_t);
12 11
13const struct file_operations efs_dir_operations = { 12const struct file_operations efs_dir_operations = {
13 .llseek = generic_file_llseek,
14 .read = generic_read_dir, 14 .read = generic_read_dir,
15 .readdir = efs_readdir, 15 .readdir = efs_readdir,
16}; 16};
@@ -33,8 +33,6 @@ static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) {
33 if (inode->i_size & (EFS_DIRBSIZE-1)) 33 if (inode->i_size & (EFS_DIRBSIZE-1))
34 printk(KERN_WARNING "EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n"); 34 printk(KERN_WARNING "EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n");
35 35
36 lock_kernel();
37
38 /* work out where this entry can be found */ 36 /* work out where this entry can be found */
39 block = filp->f_pos >> EFS_DIRBSIZE_BITS; 37 block = filp->f_pos >> EFS_DIRBSIZE_BITS;
40 38
@@ -107,7 +105,6 @@ static int efs_readdir(struct file *filp, void *dirent, filldir_t filldir) {
107 105
108 filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot; 106 filp->f_pos = (block << EFS_DIRBSIZE_BITS) | slot;
109out: 107out:
110 unlock_kernel();
111 return 0; 108 return 0;
112} 109}
113 110
diff --git a/fs/efs/namei.c b/fs/efs/namei.c
index c3fb5f9c4a44..1511bf9e5f80 100644
--- a/fs/efs/namei.c
+++ b/fs/efs/namei.c
@@ -8,7 +8,6 @@
8 8
9#include <linux/buffer_head.h> 9#include <linux/buffer_head.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/smp_lock.h>
12#include <linux/exportfs.h> 11#include <linux/exportfs.h>
13#include "efs.h" 12#include "efs.h"
14 13
@@ -63,16 +62,12 @@ struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, struct namei
63 efs_ino_t inodenum; 62 efs_ino_t inodenum;
64 struct inode * inode = NULL; 63 struct inode * inode = NULL;
65 64
66 lock_kernel();
67 inodenum = efs_find_entry(dir, dentry->d_name.name, dentry->d_name.len); 65 inodenum = efs_find_entry(dir, dentry->d_name.name, dentry->d_name.len);
68 if (inodenum) { 66 if (inodenum) {
69 inode = efs_iget(dir->i_sb, inodenum); 67 inode = efs_iget(dir->i_sb, inodenum);
70 if (IS_ERR(inode)) { 68 if (IS_ERR(inode))
71 unlock_kernel();
72 return ERR_CAST(inode); 69 return ERR_CAST(inode);
73 }
74 } 70 }
75 unlock_kernel();
76 71
77 return d_splice_alias(inode, dentry); 72 return d_splice_alias(inode, dentry);
78} 73}
@@ -115,11 +110,9 @@ struct dentry *efs_get_parent(struct dentry *child)
115 struct dentry *parent = ERR_PTR(-ENOENT); 110 struct dentry *parent = ERR_PTR(-ENOENT);
116 efs_ino_t ino; 111 efs_ino_t ino;
117 112
118 lock_kernel();
119 ino = efs_find_entry(child->d_inode, "..", 2); 113 ino = efs_find_entry(child->d_inode, "..", 2);
120 if (ino) 114 if (ino)
121 parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino)); 115 parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino));
122 unlock_kernel();
123 116
124 return parent; 117 return parent;
125} 118}
diff --git a/fs/efs/symlink.c b/fs/efs/symlink.c
index 41911ec83aaf..75117d0dac2b 100644
--- a/fs/efs/symlink.c
+++ b/fs/efs/symlink.c
@@ -9,7 +9,6 @@
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/pagemap.h> 10#include <linux/pagemap.h>
11#include <linux/buffer_head.h> 11#include <linux/buffer_head.h>
12#include <linux/smp_lock.h>
13#include "efs.h" 12#include "efs.h"
14 13
15static int efs_symlink_readpage(struct file *file, struct page *page) 14static int efs_symlink_readpage(struct file *file, struct page *page)
@@ -22,9 +21,8 @@ static int efs_symlink_readpage(struct file *file, struct page *page)
22 21
23 err = -ENAMETOOLONG; 22 err = -ENAMETOOLONG;
24 if (size > 2 * EFS_BLOCKSIZE) 23 if (size > 2 * EFS_BLOCKSIZE)
25 goto fail_notlocked; 24 goto fail;
26 25
27 lock_kernel();
28 /* read first 512 bytes of link target */ 26 /* read first 512 bytes of link target */
29 err = -EIO; 27 err = -EIO;
30 bh = sb_bread(inode->i_sb, efs_bmap(inode, 0)); 28 bh = sb_bread(inode->i_sb, efs_bmap(inode, 0));
@@ -40,14 +38,11 @@ static int efs_symlink_readpage(struct file *file, struct page *page)
40 brelse(bh); 38 brelse(bh);
41 } 39 }
42 link[size] = '\0'; 40 link[size] = '\0';
43 unlock_kernel();
44 SetPageUptodate(page); 41 SetPageUptodate(page);
45 kunmap(page); 42 kunmap(page);
46 unlock_page(page); 43 unlock_page(page);
47 return 0; 44 return 0;
48fail: 45fail:
49 unlock_kernel();
50fail_notlocked:
51 SetPageError(page); 46 SetPageError(page);
52 kunmap(page); 47 kunmap(page);
53 unlock_page(page); 48 unlock_page(page);
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index d81ef2fdb08e..e0c745451715 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -129,12 +129,15 @@ fail:
129static inline struct posix_acl * 129static inline struct posix_acl *
130ext3_iget_acl(struct inode *inode, struct posix_acl **i_acl) 130ext3_iget_acl(struct inode *inode, struct posix_acl **i_acl)
131{ 131{
132 struct posix_acl *acl = EXT3_ACL_NOT_CACHED; 132 struct posix_acl *acl = ACCESS_ONCE(*i_acl);
133 133
134 spin_lock(&inode->i_lock); 134 if (acl) {
135 if (*i_acl != EXT3_ACL_NOT_CACHED) 135 spin_lock(&inode->i_lock);
136 acl = posix_acl_dup(*i_acl); 136 acl = *i_acl;
137 spin_unlock(&inode->i_lock); 137 if (acl != EXT3_ACL_NOT_CACHED)
138 acl = posix_acl_dup(acl);
139 spin_unlock(&inode->i_lock);
140 }
138 141
139 return acl; 142 return acl;
140} 143}
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index 647e0d65a284..605aeed96d68 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -129,12 +129,15 @@ fail:
129static inline struct posix_acl * 129static inline struct posix_acl *
130ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl) 130ext4_iget_acl(struct inode *inode, struct posix_acl **i_acl)
131{ 131{
132 struct posix_acl *acl = EXT4_ACL_NOT_CACHED; 132 struct posix_acl *acl = ACCESS_ONCE(*i_acl);
133 133
134 spin_lock(&inode->i_lock); 134 if (acl) {
135 if (*i_acl != EXT4_ACL_NOT_CACHED) 135 spin_lock(&inode->i_lock);
136 acl = posix_acl_dup(*i_acl); 136 acl = *i_acl;
137 spin_unlock(&inode->i_lock); 137 if (acl != EXT4_ACL_NOT_CACHED)
138 acl = posix_acl_dup(acl);
139 spin_unlock(&inode->i_lock);
140 }
138 141
139 return acl; 142 return acl;
140} 143}
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index f0df55a52929..d8673ccf90b7 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -19,7 +19,6 @@
19#include <linux/random.h> 19#include <linux/random.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/exportfs.h> 21#include <linux/exportfs.h>
22#include <linux/smp_lock.h>
23 22
24MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>"); 23MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
25MODULE_DESCRIPTION("Filesystem in Userspace"); 24MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -260,9 +259,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
260 259
261static void fuse_umount_begin(struct super_block *sb) 260static void fuse_umount_begin(struct super_block *sb)
262{ 261{
263 lock_kernel();
264 fuse_abort_conn(get_fuse_conn_super(sb)); 262 fuse_abort_conn(get_fuse_conn_super(sb));
265 unlock_kernel();
266} 263}
267 264
268static void fuse_send_destroy(struct fuse_conn *fc) 265static void fuse_send_destroy(struct fuse_conn *fc)
diff --git a/fs/ioctl.c b/fs/ioctl.c
index 286f38dfc6c0..001f8d3118f2 100644
--- a/fs/ioctl.c
+++ b/fs/ioctl.c
@@ -70,9 +70,7 @@ static int ioctl_fibmap(struct file *filp, int __user *p)
70 res = get_user(block, p); 70 res = get_user(block, p);
71 if (res) 71 if (res)
72 return res; 72 return res;
73 lock_kernel();
74 res = mapping->a_ops->bmap(mapping, block); 73 res = mapping->a_ops->bmap(mapping, block);
75 unlock_kernel();
76 return put_user(res, p); 74 return put_user(res, p);
77} 75}
78 76
diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
index 3aebe322271a..6ac693faae49 100644
--- a/fs/minix/bitmap.c
+++ b/fs/minix/bitmap.c
@@ -12,13 +12,14 @@
12/* bitmap.c contains the code that handles the inode and block bitmaps */ 12/* bitmap.c contains the code that handles the inode and block bitmaps */
13 13
14#include "minix.h" 14#include "minix.h"
15#include <linux/smp_lock.h>
16#include <linux/buffer_head.h> 15#include <linux/buffer_head.h>
17#include <linux/bitops.h> 16#include <linux/bitops.h>
18#include <linux/sched.h> 17#include <linux/sched.h>
19 18
20static const int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 }; 19static const int nibblemap[] = { 4,3,3,2,3,2,2,1,3,2,2,1,2,1,1,0 };
21 20
21static DEFINE_SPINLOCK(bitmap_lock);
22
22static unsigned long count_free(struct buffer_head *map[], unsigned numblocks, __u32 numbits) 23static unsigned long count_free(struct buffer_head *map[], unsigned numblocks, __u32 numbits)
23{ 24{
24 unsigned i, j, sum = 0; 25 unsigned i, j, sum = 0;
@@ -69,11 +70,11 @@ void minix_free_block(struct inode *inode, unsigned long block)
69 return; 70 return;
70 } 71 }
71 bh = sbi->s_zmap[zone]; 72 bh = sbi->s_zmap[zone];
72 lock_kernel(); 73 spin_lock(&bitmap_lock);
73 if (!minix_test_and_clear_bit(bit, bh->b_data)) 74 if (!minix_test_and_clear_bit(bit, bh->b_data))
74 printk("minix_free_block (%s:%lu): bit already cleared\n", 75 printk("minix_free_block (%s:%lu): bit already cleared\n",
75 sb->s_id, block); 76 sb->s_id, block);
76 unlock_kernel(); 77 spin_unlock(&bitmap_lock);
77 mark_buffer_dirty(bh); 78 mark_buffer_dirty(bh);
78 return; 79 return;
79} 80}
@@ -88,18 +89,18 @@ int minix_new_block(struct inode * inode)
88 struct buffer_head *bh = sbi->s_zmap[i]; 89 struct buffer_head *bh = sbi->s_zmap[i];
89 int j; 90 int j;
90 91
91 lock_kernel(); 92 spin_lock(&bitmap_lock);
92 j = minix_find_first_zero_bit(bh->b_data, bits_per_zone); 93 j = minix_find_first_zero_bit(bh->b_data, bits_per_zone);
93 if (j < bits_per_zone) { 94 if (j < bits_per_zone) {
94 minix_set_bit(j, bh->b_data); 95 minix_set_bit(j, bh->b_data);
95 unlock_kernel(); 96 spin_unlock(&bitmap_lock);
96 mark_buffer_dirty(bh); 97 mark_buffer_dirty(bh);
97 j += i * bits_per_zone + sbi->s_firstdatazone-1; 98 j += i * bits_per_zone + sbi->s_firstdatazone-1;
98 if (j < sbi->s_firstdatazone || j >= sbi->s_nzones) 99 if (j < sbi->s_firstdatazone || j >= sbi->s_nzones)
99 break; 100 break;
100 return j; 101 return j;
101 } 102 }
102 unlock_kernel(); 103 spin_unlock(&bitmap_lock);
103 } 104 }
104 return 0; 105 return 0;
105} 106}
@@ -211,10 +212,10 @@ void minix_free_inode(struct inode * inode)
211 minix_clear_inode(inode); /* clear on-disk copy */ 212 minix_clear_inode(inode); /* clear on-disk copy */
212 213
213 bh = sbi->s_imap[ino]; 214 bh = sbi->s_imap[ino];
214 lock_kernel(); 215 spin_lock(&bitmap_lock);
215 if (!minix_test_and_clear_bit(bit, bh->b_data)) 216 if (!minix_test_and_clear_bit(bit, bh->b_data))
216 printk("minix_free_inode: bit %lu already cleared\n", bit); 217 printk("minix_free_inode: bit %lu already cleared\n", bit);
217 unlock_kernel(); 218 spin_unlock(&bitmap_lock);
218 mark_buffer_dirty(bh); 219 mark_buffer_dirty(bh);
219 out: 220 out:
220 clear_inode(inode); /* clear in-memory copy */ 221 clear_inode(inode); /* clear in-memory copy */
@@ -237,7 +238,7 @@ struct inode * minix_new_inode(const struct inode * dir, int * error)
237 j = bits_per_zone; 238 j = bits_per_zone;
238 bh = NULL; 239 bh = NULL;
239 *error = -ENOSPC; 240 *error = -ENOSPC;
240 lock_kernel(); 241 spin_lock(&bitmap_lock);
241 for (i = 0; i < sbi->s_imap_blocks; i++) { 242 for (i = 0; i < sbi->s_imap_blocks; i++) {
242 bh = sbi->s_imap[i]; 243 bh = sbi->s_imap[i];
243 j = minix_find_first_zero_bit(bh->b_data, bits_per_zone); 244 j = minix_find_first_zero_bit(bh->b_data, bits_per_zone);
@@ -245,17 +246,17 @@ struct inode * minix_new_inode(const struct inode * dir, int * error)
245 break; 246 break;
246 } 247 }
247 if (!bh || j >= bits_per_zone) { 248 if (!bh || j >= bits_per_zone) {
248 unlock_kernel(); 249 spin_unlock(&bitmap_lock);
249 iput(inode); 250 iput(inode);
250 return NULL; 251 return NULL;
251 } 252 }
252 if (minix_test_and_set_bit(j, bh->b_data)) { /* shouldn't happen */ 253 if (minix_test_and_set_bit(j, bh->b_data)) { /* shouldn't happen */
253 unlock_kernel(); 254 spin_unlock(&bitmap_lock);
254 printk("minix_new_inode: bit already set\n"); 255 printk("minix_new_inode: bit already set\n");
255 iput(inode); 256 iput(inode);
256 return NULL; 257 return NULL;
257 } 258 }
258 unlock_kernel(); 259 spin_unlock(&bitmap_lock);
259 mark_buffer_dirty(bh); 260 mark_buffer_dirty(bh);
260 j += i * bits_per_zone; 261 j += i * bits_per_zone;
261 if (!j || j > sbi->s_ninodes) { 262 if (!j || j > sbi->s_ninodes) {
diff --git a/fs/minix/dir.c b/fs/minix/dir.c
index e5f206467e40..d407e7a0b6fe 100644
--- a/fs/minix/dir.c
+++ b/fs/minix/dir.c
@@ -11,7 +11,6 @@
11#include "minix.h" 11#include "minix.h"
12#include <linux/buffer_head.h> 12#include <linux/buffer_head.h>
13#include <linux/highmem.h> 13#include <linux/highmem.h>
14#include <linux/smp_lock.h>
15#include <linux/swap.h> 14#include <linux/swap.h>
16 15
17typedef struct minix_dir_entry minix_dirent; 16typedef struct minix_dir_entry minix_dirent;
@@ -20,6 +19,7 @@ typedef struct minix3_dir_entry minix3_dirent;
20static int minix_readdir(struct file *, void *, filldir_t); 19static int minix_readdir(struct file *, void *, filldir_t);
21 20
22const struct file_operations minix_dir_operations = { 21const struct file_operations minix_dir_operations = {
22 .llseek = generic_file_llseek,
23 .read = generic_read_dir, 23 .read = generic_read_dir,
24 .readdir = minix_readdir, 24 .readdir = minix_readdir,
25 .fsync = simple_fsync, 25 .fsync = simple_fsync,
@@ -102,8 +102,6 @@ static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir)
102 char *name; 102 char *name;
103 __u32 inumber; 103 __u32 inumber;
104 104
105 lock_kernel();
106
107 pos = (pos + chunk_size-1) & ~(chunk_size-1); 105 pos = (pos + chunk_size-1) & ~(chunk_size-1);
108 if (pos >= inode->i_size) 106 if (pos >= inode->i_size)
109 goto done; 107 goto done;
@@ -146,7 +144,6 @@ static int minix_readdir(struct file * filp, void * dirent, filldir_t filldir)
146 144
147done: 145done:
148 filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset; 146 filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset;
149 unlock_kernel();
150 return 0; 147 return 0;
151} 148}
152 149
diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index f91a23693597..74ea82d72164 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
@@ -35,8 +35,6 @@ static void minix_put_super(struct super_block *sb)
35 int i; 35 int i;
36 struct minix_sb_info *sbi = minix_sb(sb); 36 struct minix_sb_info *sbi = minix_sb(sb);
37 37
38 lock_kernel();
39
40 if (!(sb->s_flags & MS_RDONLY)) { 38 if (!(sb->s_flags & MS_RDONLY)) {
41 if (sbi->s_version != MINIX_V3) /* s_state is now out from V3 sb */ 39 if (sbi->s_version != MINIX_V3) /* s_state is now out from V3 sb */
42 sbi->s_ms->s_state = sbi->s_mount_state; 40 sbi->s_ms->s_state = sbi->s_mount_state;
@@ -50,8 +48,6 @@ static void minix_put_super(struct super_block *sb)
50 kfree(sbi->s_imap); 48 kfree(sbi->s_imap);
51 sb->s_fs_info = NULL; 49 sb->s_fs_info = NULL;
52 kfree(sbi); 50 kfree(sbi);
53
54 unlock_kernel();
55} 51}
56 52
57static struct kmem_cache * minix_inode_cachep; 53static struct kmem_cache * minix_inode_cachep;
diff --git a/fs/super.c b/fs/super.c
index 83b47416d006..d40d53a22fb5 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -545,24 +545,18 @@ int do_remount_sb(struct super_block *sb, int flags, void *data, int force)
545 if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) { 545 if ((flags & MS_RDONLY) && !(sb->s_flags & MS_RDONLY)) {
546 if (force) 546 if (force)
547 mark_files_ro(sb); 547 mark_files_ro(sb);
548 else if (!fs_may_remount_ro(sb)) { 548 else if (!fs_may_remount_ro(sb))
549 unlock_kernel();
550 return -EBUSY; 549 return -EBUSY;
551 }
552 retval = vfs_dq_off(sb, 1); 550 retval = vfs_dq_off(sb, 1);
553 if (retval < 0 && retval != -ENOSYS) { 551 if (retval < 0 && retval != -ENOSYS)
554 unlock_kernel();
555 return -EBUSY; 552 return -EBUSY;
556 }
557 } 553 }
558 remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY); 554 remount_rw = !(flags & MS_RDONLY) && (sb->s_flags & MS_RDONLY);
559 555
560 if (sb->s_op->remount_fs) { 556 if (sb->s_op->remount_fs) {
561 retval = sb->s_op->remount_fs(sb, &flags, data); 557 retval = sb->s_op->remount_fs(sb, &flags, data);
562 if (retval) { 558 if (retval)
563 unlock_kernel();
564 return retval; 559 return retval;
565 }
566 } 560 }
567 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK); 561 sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
568 if (remount_rw) 562 if (remount_rw)
diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c
index c7798079e644..4e50286a4cc3 100644
--- a/fs/sysv/dir.c
+++ b/fs/sysv/dir.c
@@ -15,13 +15,13 @@
15 15
16#include <linux/pagemap.h> 16#include <linux/pagemap.h>
17#include <linux/highmem.h> 17#include <linux/highmem.h>
18#include <linux/smp_lock.h>
19#include <linux/swap.h> 18#include <linux/swap.h>
20#include "sysv.h" 19#include "sysv.h"
21 20
22static int sysv_readdir(struct file *, void *, filldir_t); 21static int sysv_readdir(struct file *, void *, filldir_t);
23 22
24const struct file_operations sysv_dir_operations = { 23const struct file_operations sysv_dir_operations = {
24 .llseek = generic_file_llseek,
25 .read = generic_read_dir, 25 .read = generic_read_dir,
26 .readdir = sysv_readdir, 26 .readdir = sysv_readdir,
27 .fsync = simple_fsync, 27 .fsync = simple_fsync,
@@ -74,8 +74,6 @@ static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir)
74 unsigned long n = pos >> PAGE_CACHE_SHIFT; 74 unsigned long n = pos >> PAGE_CACHE_SHIFT;
75 unsigned long npages = dir_pages(inode); 75 unsigned long npages = dir_pages(inode);
76 76
77 lock_kernel();
78
79 pos = (pos + SYSV_DIRSIZE-1) & ~(SYSV_DIRSIZE-1); 77 pos = (pos + SYSV_DIRSIZE-1) & ~(SYSV_DIRSIZE-1);
80 if (pos >= inode->i_size) 78 if (pos >= inode->i_size)
81 goto done; 79 goto done;
@@ -113,7 +111,6 @@ static int sysv_readdir(struct file * filp, void * dirent, filldir_t filldir)
113 111
114done: 112done:
115 filp->f_pos = ((loff_t)n << PAGE_CACHE_SHIFT) | offset; 113 filp->f_pos = ((loff_t)n << PAGE_CACHE_SHIFT) | offset;
116 unlock_kernel();
117 return 0; 114 return 0;
118} 115}
119 116
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c
index 479923456a54..9824743832a7 100644
--- a/fs/sysv/inode.c
+++ b/fs/sysv/inode.c
@@ -21,7 +21,6 @@
21 * the superblock. 21 * the superblock.
22 */ 22 */
23 23
24#include <linux/smp_lock.h>
25#include <linux/highuid.h> 24#include <linux/highuid.h>
26#include <linux/slab.h> 25#include <linux/slab.h>
27#include <linux/init.h> 26#include <linux/init.h>
@@ -37,7 +36,6 @@ static int sysv_sync_fs(struct super_block *sb, int wait)
37 unsigned long time = get_seconds(), old_time; 36 unsigned long time = get_seconds(), old_time;
38 37
39 lock_super(sb); 38 lock_super(sb);
40 lock_kernel();
41 39
42 /* 40 /*
43 * If we are going to write out the super block, 41 * If we are going to write out the super block,
@@ -52,7 +50,6 @@ static int sysv_sync_fs(struct super_block *sb, int wait)
52 mark_buffer_dirty(sbi->s_bh2); 50 mark_buffer_dirty(sbi->s_bh2);
53 } 51 }
54 52
55 unlock_kernel();
56 unlock_super(sb); 53 unlock_super(sb);
57 54
58 return 0; 55 return 0;
@@ -82,8 +79,6 @@ static void sysv_put_super(struct super_block *sb)
82{ 79{
83 struct sysv_sb_info *sbi = SYSV_SB(sb); 80 struct sysv_sb_info *sbi = SYSV_SB(sb);
84 81
85 lock_kernel();
86
87 if (sb->s_dirt) 82 if (sb->s_dirt)
88 sysv_write_super(sb); 83 sysv_write_super(sb);
89 84
@@ -99,8 +94,6 @@ static void sysv_put_super(struct super_block *sb)
99 brelse(sbi->s_bh2); 94 brelse(sbi->s_bh2);
100 95
101 kfree(sbi); 96 kfree(sbi);
102
103 unlock_kernel();
104} 97}
105 98
106static int sysv_statfs(struct dentry *dentry, struct kstatfs *buf) 99static int sysv_statfs(struct dentry *dentry, struct kstatfs *buf)
@@ -275,7 +268,6 @@ int sysv_write_inode(struct inode *inode, int wait)
275 return -EIO; 268 return -EIO;
276 } 269 }
277 270
278 lock_kernel();
279 raw_inode->i_mode = cpu_to_fs16(sbi, inode->i_mode); 271 raw_inode->i_mode = cpu_to_fs16(sbi, inode->i_mode);
280 raw_inode->i_uid = cpu_to_fs16(sbi, fs_high2lowuid(inode->i_uid)); 272 raw_inode->i_uid = cpu_to_fs16(sbi, fs_high2lowuid(inode->i_uid));
281 raw_inode->i_gid = cpu_to_fs16(sbi, fs_high2lowgid(inode->i_gid)); 273 raw_inode->i_gid = cpu_to_fs16(sbi, fs_high2lowgid(inode->i_gid));
@@ -291,7 +283,6 @@ int sysv_write_inode(struct inode *inode, int wait)
291 for (block = 0; block < 10+1+1+1; block++) 283 for (block = 0; block < 10+1+1+1; block++)
292 write3byte(sbi, (u8 *)&si->i_data[block], 284 write3byte(sbi, (u8 *)&si->i_data[block],
293 &raw_inode->i_data[3*block]); 285 &raw_inode->i_data[3*block]);
294 unlock_kernel();
295 mark_buffer_dirty(bh); 286 mark_buffer_dirty(bh);
296 if (wait) { 287 if (wait) {
297 sync_dirty_buffer(bh); 288 sync_dirty_buffer(bh);
@@ -315,9 +306,7 @@ static void sysv_delete_inode(struct inode *inode)
315 truncate_inode_pages(&inode->i_data, 0); 306 truncate_inode_pages(&inode->i_data, 0);
316 inode->i_size = 0; 307 inode->i_size = 0;
317 sysv_truncate(inode); 308 sysv_truncate(inode);
318 lock_kernel();
319 sysv_free_inode(inode); 309 sysv_free_inode(inode);
320 unlock_kernel();
321} 310}
322 311
323static struct kmem_cache *sysv_inode_cachep; 312static struct kmem_cache *sysv_inode_cachep;
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h
index ef788c2085a1..b19801f73890 100644
--- a/include/linux/adfs_fs.h
+++ b/include/linux/adfs_fs.h
@@ -41,8 +41,6 @@ struct adfs_discrecord {
41#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) 41#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
42 42
43#ifdef __KERNEL__ 43#ifdef __KERNEL__
44#include <linux/adfs_fs_i.h>
45#include <linux/adfs_fs_sb.h>
46/* 44/*
47 * Calculate the boot block checksum on an ADFS drive. Note that this will 45 * Calculate the boot block checksum on an ADFS drive. Note that this will
48 * appear to be correct if the sector contains all zeros, so also check that 46 * appear to be correct if the sector contains all zeros, so also check that
@@ -60,17 +58,6 @@ static inline int adfs_checkbblk(unsigned char *ptr)
60 58
61 return (result & 0xff) != ptr[511]; 59 return (result & 0xff) != ptr[511];
62} 60}
63
64static inline struct adfs_sb_info *ADFS_SB(struct super_block *sb)
65{
66 return sb->s_fs_info;
67}
68
69static inline struct adfs_inode_info *ADFS_I(struct inode *inode)
70{
71 return container_of(inode, struct adfs_inode_info, vfs_inode);
72}
73
74#endif 61#endif
75 62
76#endif 63#endif
diff --git a/include/linux/adfs_fs_i.h b/include/linux/adfs_fs_i.h
deleted file mode 100644
index cb543034e54f..000000000000
--- a/include/linux/adfs_fs_i.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * linux/include/linux/adfs_fs_i.h
3 *
4 * Copyright (C) 1997 Russell King
5 */
6
7#ifndef _ADFS_FS_I
8#define _ADFS_FS_I
9
10/*
11 * adfs file system inode data in memory
12 */
13struct adfs_inode_info {
14 loff_t mmu_private;
15 unsigned long parent_id; /* object id of parent */
16 __u32 loadaddr; /* RISC OS load address */
17 __u32 execaddr; /* RISC OS exec address */
18 unsigned int filetype; /* RISC OS file type */
19 unsigned int attr; /* RISC OS permissions */
20 unsigned int stamped:1; /* RISC OS file has date/time */
21 struct inode vfs_inode;
22};
23
24#endif
diff --git a/include/linux/adfs_fs_sb.h b/include/linux/adfs_fs_sb.h
deleted file mode 100644
index d9bf05c02ccc..000000000000
--- a/include/linux/adfs_fs_sb.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * linux/include/linux/adfs_fs_sb.h
3 *
4 * Copyright (C) 1997-1999 Russell King
5 */
6
7#ifndef _ADFS_FS_SB
8#define _ADFS_FS_SB
9
10/*
11 * Forward-declare this
12 */
13struct adfs_discmap;
14struct adfs_dir_ops;
15
16/*
17 * ADFS file system superblock data in memory
18 */
19struct adfs_sb_info {
20 struct adfs_discmap *s_map; /* bh list containing map */
21 struct adfs_dir_ops *s_dir; /* directory operations */
22
23 uid_t s_uid; /* owner uid */
24 gid_t s_gid; /* owner gid */
25 umode_t s_owner_mask; /* ADFS owner perm -> unix perm */
26 umode_t s_other_mask; /* ADFS other perm -> unix perm */
27
28 __u32 s_ids_per_zone; /* max. no ids in one zone */
29 __u32 s_idlen; /* length of ID in map */
30 __u32 s_map_size; /* sector size of a map */
31 unsigned long s_size; /* total size (in blocks) of this fs */
32 signed int s_map2blk; /* shift left by this for map->sector */
33 unsigned int s_log2sharesize;/* log2 share size */
34 __le32 s_version; /* disc format version */
35 unsigned int s_namelen; /* maximum number of characters in name */
36};
37
38#endif