aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-01-22 14:05:05 -0500
committerArnd Bergmann <arnd@arndb.de>2011-03-01 18:02:38 -0500
commit4688a066ecf60086ea82f68edb3b036b567d2c08 (patch)
treee1a4b93e5b5084adfbf78c83de32dc590959fe14
parentf5412be599602124d2bdd49947b231dd77c0bf99 (diff)
adfs: remove the big kernel lock
According to Russell King, adfs was written to not require the big kernel lock, and all inode updates are done under adfs_dir_lock. All other metadata in adfs is read-only and does not require locking. The use of the BKL is the result of various pushdowns from the VFS operations. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Russell King <rmk@arm.linux.org.uk> Cc: Stuart Swales <stuart.swales.croftnuisk@gmail.com>
-rw-r--r--fs/adfs/Kconfig1
-rw-r--r--fs/adfs/dir.c6
-rw-r--r--fs/adfs/inode.c6
-rw-r--r--fs/adfs/super.c13
4 files changed, 1 insertions, 25 deletions
diff --git a/fs/adfs/Kconfig b/fs/adfs/Kconfig
index 1dd5f34b3cf2..e55182a74605 100644
--- a/fs/adfs/Kconfig
+++ b/fs/adfs/Kconfig
@@ -1,7 +1,6 @@
1config ADFS_FS 1config ADFS_FS
2 tristate "ADFS file system support (EXPERIMENTAL)" 2 tristate "ADFS file system support (EXPERIMENTAL)"
3 depends on BLOCK && EXPERIMENTAL 3 depends on BLOCK && EXPERIMENTAL
4 depends on BKL # need to fix
5 help 4 help
6 The Acorn Disc Filing System is the standard file system of the 5 The Acorn Disc Filing System is the standard file system of the
7 RiscOS operating system which runs on Acorn's ARM-based Risc PC 6 RiscOS operating system which runs on Acorn's ARM-based Risc PC
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index 3b4a764ed780..3d83075aaa2e 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -9,7 +9,6 @@
9 * 9 *
10 * Common directory handling for ADFS 10 * Common directory handling for ADFS
11 */ 11 */
12#include <linux/smp_lock.h>
13#include "adfs.h" 12#include "adfs.h"
14 13
15/* 14/*
@@ -27,8 +26,6 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
27 struct adfs_dir dir; 26 struct adfs_dir dir;
28 int ret = 0; 27 int ret = 0;
29 28
30 lock_kernel();
31
32 if (filp->f_pos >> 32) 29 if (filp->f_pos >> 32)
33 goto out; 30 goto out;
34 31
@@ -70,7 +67,6 @@ free_out:
70 ops->free(&dir); 67 ops->free(&dir);
71 68
72out: 69out:
73 unlock_kernel();
74 return ret; 70 return ret;
75} 71}
76 72
@@ -276,7 +272,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
276 struct object_info obj; 272 struct object_info obj;
277 int error; 273 int error;
278 274
279 lock_kernel();
280 error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj); 275 error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj);
281 if (error == 0) { 276 if (error == 0) {
282 error = -EACCES; 277 error = -EACCES;
@@ -288,7 +283,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
288 if (inode) 283 if (inode)
289 error = 0; 284 error = 0;
290 } 285 }
291 unlock_kernel();
292 d_add(dentry, inode); 286 d_add(dentry, inode);
293 return ERR_PTR(error); 287 return ERR_PTR(error);
294} 288}
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index 65794b8fe79e..09fe40198d1c 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -7,7 +7,6 @@
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/smp_lock.h>
11#include <linux/buffer_head.h> 10#include <linux/buffer_head.h>
12#include <linux/writeback.h> 11#include <linux/writeback.h>
13#include "adfs.h" 12#include "adfs.h"
@@ -316,8 +315,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
316 unsigned int ia_valid = attr->ia_valid; 315 unsigned int ia_valid = attr->ia_valid;
317 int error; 316 int error;
318 317
319 lock_kernel();
320
321 error = inode_change_ok(inode, attr); 318 error = inode_change_ok(inode, attr);
322 319
323 /* 320 /*
@@ -359,7 +356,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
359 if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MODE)) 356 if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MODE))
360 mark_inode_dirty(inode); 357 mark_inode_dirty(inode);
361out: 358out:
362 unlock_kernel();
363 return error; 359 return error;
364} 360}
365 361
@@ -374,7 +370,6 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
374 struct object_info obj; 370 struct object_info obj;
375 int ret; 371 int ret;
376 372
377 lock_kernel();
378 obj.file_id = inode->i_ino; 373 obj.file_id = inode->i_ino;
379 obj.name_len = 0; 374 obj.name_len = 0;
380 obj.parent_id = ADFS_I(inode)->parent_id; 375 obj.parent_id = ADFS_I(inode)->parent_id;
@@ -384,6 +379,5 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
384 obj.size = inode->i_size; 379 obj.size = inode->i_size;
385 380
386 ret = adfs_dir_update(sb, &obj, wbc->sync_mode == WB_SYNC_ALL); 381 ret = adfs_dir_update(sb, &obj, wbc->sync_mode == WB_SYNC_ALL);
387 unlock_kernel();
388 return ret; 382 return ret;
389} 383}
diff --git a/fs/adfs/super.c b/fs/adfs/super.c
index 2d7954049fbe..06d7388b477b 100644
--- a/fs/adfs/super.c
+++ b/fs/adfs/super.c
@@ -14,7 +14,6 @@
14#include <linux/mount.h> 14#include <linux/mount.h>
15#include <linux/seq_file.h> 15#include <linux/seq_file.h>
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/smp_lock.h>
18#include <linux/statfs.h> 17#include <linux/statfs.h>
19#include "adfs.h" 18#include "adfs.h"
20#include "dir_f.h" 19#include "dir_f.h"
@@ -120,15 +119,11 @@ static void adfs_put_super(struct super_block *sb)
120 int i; 119 int i;
121 struct adfs_sb_info *asb = ADFS_SB(sb); 120 struct adfs_sb_info *asb = ADFS_SB(sb);
122 121
123 lock_kernel();
124
125 for (i = 0; i < asb->s_map_size; i++) 122 for (i = 0; i < asb->s_map_size; i++)
126 brelse(asb->s_map[i].dm_bh); 123 brelse(asb->s_map[i].dm_bh);
127 kfree(asb->s_map); 124 kfree(asb->s_map);
128 kfree(asb); 125 kfree(asb);
129 sb->s_fs_info = NULL; 126 sb->s_fs_info = NULL;
130
131 unlock_kernel();
132} 127}
133 128
134static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt) 129static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt)
@@ -359,15 +354,11 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
359 struct adfs_sb_info *asb; 354 struct adfs_sb_info *asb;
360 struct inode *root; 355 struct inode *root;
361 356
362 lock_kernel();
363
364 sb->s_flags |= MS_NODIRATIME; 357 sb->s_flags |= MS_NODIRATIME;
365 358
366 asb = kzalloc(sizeof(*asb), GFP_KERNEL); 359 asb = kzalloc(sizeof(*asb), GFP_KERNEL);
367 if (!asb) { 360 if (!asb)
368 unlock_kernel();
369 return -ENOMEM; 361 return -ENOMEM;
370 }
371 sb->s_fs_info = asb; 362 sb->s_fs_info = asb;
372 363
373 /* set default options */ 364 /* set default options */
@@ -485,7 +476,6 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
485 adfs_error(sb, "get root inode failed\n"); 476 adfs_error(sb, "get root inode failed\n");
486 goto error; 477 goto error;
487 } 478 }
488 unlock_kernel();
489 return 0; 479 return 0;
490 480
491error_free_bh: 481error_free_bh:
@@ -493,7 +483,6 @@ error_free_bh:
493error: 483error:
494 sb->s_fs_info = NULL; 484 sb->s_fs_info = NULL;
495 kfree(asb); 485 kfree(asb);
496 unlock_kernel();
497 return -EINVAL; 486 return -EINVAL;
498} 487}
499 488