Commit 4688a066 authored by Arnd Bergmann's avatar Arnd Bergmann

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: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarRussell King <rmk@arm.linux.org.uk>
Cc: Stuart Swales <stuart.swales.croftnuisk@gmail.com>
parent f5412be5
config ADFS_FS config ADFS_FS
tristate "ADFS file system support (EXPERIMENTAL)" tristate "ADFS file system support (EXPERIMENTAL)"
depends on BLOCK && EXPERIMENTAL depends on BLOCK && EXPERIMENTAL
depends on BKL # need to fix
help help
The Acorn Disc Filing System is the standard file system of the The Acorn Disc Filing System is the standard file system of the
RiscOS operating system which runs on Acorn's ARM-based Risc PC RiscOS operating system which runs on Acorn's ARM-based Risc PC
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
* *
* Common directory handling for ADFS * Common directory handling for ADFS
*/ */
#include <linux/smp_lock.h>
#include "adfs.h" #include "adfs.h"
/* /*
...@@ -27,8 +26,6 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -27,8 +26,6 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
struct adfs_dir dir; struct adfs_dir dir;
int ret = 0; int ret = 0;
lock_kernel();
if (filp->f_pos >> 32) if (filp->f_pos >> 32)
goto out; goto out;
...@@ -70,7 +67,6 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -70,7 +67,6 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
ops->free(&dir); ops->free(&dir);
out: out:
unlock_kernel();
return ret; return ret;
} }
...@@ -276,7 +272,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) ...@@ -276,7 +272,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
struct object_info obj; struct object_info obj;
int error; int error;
lock_kernel();
error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj); error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj);
if (error == 0) { if (error == 0) {
error = -EACCES; error = -EACCES;
...@@ -288,7 +283,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) ...@@ -288,7 +283,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
if (inode) if (inode)
error = 0; error = 0;
} }
unlock_kernel();
d_add(dentry, inode); d_add(dentry, inode);
return ERR_PTR(error); return ERR_PTR(error);
} }
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
* it under the terms of the GNU General Public License version 2 as * it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation. * published by the Free Software Foundation.
*/ */
#include <linux/smp_lock.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include "adfs.h" #include "adfs.h"
...@@ -316,8 +315,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr) ...@@ -316,8 +315,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
unsigned int ia_valid = attr->ia_valid; unsigned int ia_valid = attr->ia_valid;
int error; int error;
lock_kernel();
error = inode_change_ok(inode, attr); error = inode_change_ok(inode, attr);
/* /*
...@@ -359,7 +356,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr) ...@@ -359,7 +356,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr)
if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MODE)) if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MODE))
mark_inode_dirty(inode); mark_inode_dirty(inode);
out: out:
unlock_kernel();
return error; return error;
} }
...@@ -374,7 +370,6 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -374,7 +370,6 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
struct object_info obj; struct object_info obj;
int ret; int ret;
lock_kernel();
obj.file_id = inode->i_ino; obj.file_id = inode->i_ino;
obj.name_len = 0; obj.name_len = 0;
obj.parent_id = ADFS_I(inode)->parent_id; obj.parent_id = ADFS_I(inode)->parent_id;
...@@ -384,6 +379,5 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc) ...@@ -384,6 +379,5 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
obj.size = inode->i_size; obj.size = inode->i_size;
ret = adfs_dir_update(sb, &obj, wbc->sync_mode == WB_SYNC_ALL); ret = adfs_dir_update(sb, &obj, wbc->sync_mode == WB_SYNC_ALL);
unlock_kernel();
return ret; return ret;
} }
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <linux/mount.h> #include <linux/mount.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/statfs.h> #include <linux/statfs.h>
#include "adfs.h" #include "adfs.h"
#include "dir_f.h" #include "dir_f.h"
...@@ -120,15 +119,11 @@ static void adfs_put_super(struct super_block *sb) ...@@ -120,15 +119,11 @@ static void adfs_put_super(struct super_block *sb)
int i; int i;
struct adfs_sb_info *asb = ADFS_SB(sb); struct adfs_sb_info *asb = ADFS_SB(sb);
lock_kernel();
for (i = 0; i < asb->s_map_size; i++) for (i = 0; i < asb->s_map_size; i++)
brelse(asb->s_map[i].dm_bh); brelse(asb->s_map[i].dm_bh);
kfree(asb->s_map); kfree(asb->s_map);
kfree(asb); kfree(asb);
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
unlock_kernel();
} }
static int adfs_show_options(struct seq_file *seq, struct vfsmount *mnt) static 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,15 +354,11 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
struct adfs_sb_info *asb; struct adfs_sb_info *asb;
struct inode *root; struct inode *root;
lock_kernel();
sb->s_flags |= MS_NODIRATIME; sb->s_flags |= MS_NODIRATIME;
asb = kzalloc(sizeof(*asb), GFP_KERNEL); asb = kzalloc(sizeof(*asb), GFP_KERNEL);
if (!asb) { if (!asb)
unlock_kernel();
return -ENOMEM; return -ENOMEM;
}
sb->s_fs_info = asb; sb->s_fs_info = asb;
/* set default options */ /* set default options */
...@@ -485,7 +476,6 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -485,7 +476,6 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
adfs_error(sb, "get root inode failed\n"); adfs_error(sb, "get root inode failed\n");
goto error; goto error;
} }
unlock_kernel();
return 0; return 0;
error_free_bh: error_free_bh:
...@@ -493,7 +483,6 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -493,7 +483,6 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
error: error:
sb->s_fs_info = NULL; sb->s_fs_info = NULL;
kfree(asb); kfree(asb);
unlock_kernel();
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment