From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754004Ab1AYWUn (ORCPT ); Tue, 25 Jan 2011 17:20:43 -0500 Received: from moutng.kundenserver.de ([212.227.17.10]:52175 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753705Ab1AYWSB (ORCPT ); Tue, 25 Jan 2011 17:18:01 -0500 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Russell King , Stuart Swales Subject: [PATCH 08/20] adfs: remove the big kernel lock Date: Tue, 25 Jan 2011 23:17:22 +0100 Message-Id: <1295993854-4971-9-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1295993854-4971-1-git-send-email-arnd@arndb.de> References: <1295993854-4971-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:021osT6Ew6X5m2fkV7PsXtXOFeujoWp3qRa3XTDs4XL de4P8AmOU9nU9zyBQr+m8nt04U6/uvJA2jy30nYD0zI+6C7MKn WDMqIyVkA3iPQPmAtBfs+YIylRR9VGm96B1WLjmNFNKuR0xbyN YzxzyHW9p7W9MvcCFSEVQtFvWSaeNui++/hCe/uTamyyzOCXGm IwT5eOiqSX5bLTKhKNMPA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Russell King Cc: Stuart Swales --- fs/adfs/Kconfig | 1 - fs/adfs/dir.c | 6 ------ fs/adfs/inode.c | 6 ------ fs/adfs/super.c | 13 +------------ 4 files changed, 1 insertions(+), 25 deletions(-) diff --git a/fs/adfs/Kconfig b/fs/adfs/Kconfig index 1dd5f34..e55182a 100644 --- a/fs/adfs/Kconfig +++ b/fs/adfs/Kconfig @@ -1,7 +1,6 @@ config ADFS_FS tristate "ADFS file system support (EXPERIMENTAL)" depends on BLOCK && EXPERIMENTAL - depends on BKL # need to fix help The Acorn Disc Filing System is the standard file system of the 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 3b4a764..3d83075 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -9,7 +9,6 @@ * * Common directory handling for ADFS */ -#include #include "adfs.h" /* @@ -27,8 +26,6 @@ adfs_readdir(struct file *filp, void *dirent, filldir_t filldir) struct adfs_dir dir; int ret = 0; - lock_kernel(); - if (filp->f_pos >> 32) goto out; @@ -70,7 +67,6 @@ free_out: ops->free(&dir); out: - unlock_kernel(); return ret; } @@ -276,7 +272,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) struct object_info obj; int error; - lock_kernel(); error = adfs_dir_lookup_byname(dir, &dentry->d_name, &obj); if (error == 0) { error = -EACCES; @@ -288,7 +283,6 @@ adfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) if (inode) error = 0; } - unlock_kernel(); d_add(dentry, inode); return ERR_PTR(error); } diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 65794b8..09fe401 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -7,7 +7,6 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include #include #include #include "adfs.h" @@ -316,8 +315,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr) unsigned int ia_valid = attr->ia_valid; int error; - lock_kernel(); - error = inode_change_ok(inode, attr); /* @@ -359,7 +356,6 @@ adfs_notify_change(struct dentry *dentry, struct iattr *attr) if (ia_valid & (ATTR_SIZE | ATTR_MTIME | ATTR_MODE)) mark_inode_dirty(inode); out: - unlock_kernel(); return error; } @@ -374,7 +370,6 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc) struct object_info obj; int ret; - lock_kernel(); obj.file_id = inode->i_ino; obj.name_len = 0; obj.parent_id = ADFS_I(inode)->parent_id; @@ -384,6 +379,5 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc) obj.size = inode->i_size; ret = adfs_dir_update(sb, &obj, wbc->sync_mode == WB_SYNC_ALL); - unlock_kernel(); return ret; } diff --git a/fs/adfs/super.c b/fs/adfs/super.c index 2d79540..06d7388 100644 --- a/fs/adfs/super.c +++ b/fs/adfs/super.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include "adfs.h" #include "dir_f.h" @@ -120,15 +119,11 @@ static void adfs_put_super(struct super_block *sb) int i; struct adfs_sb_info *asb = ADFS_SB(sb); - lock_kernel(); - for (i = 0; i < asb->s_map_size; i++) brelse(asb->s_map[i].dm_bh); kfree(asb->s_map); kfree(asb); sb->s_fs_info = NULL; - - unlock_kernel(); } 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) struct adfs_sb_info *asb; struct inode *root; - lock_kernel(); - sb->s_flags |= MS_NODIRATIME; asb = kzalloc(sizeof(*asb), GFP_KERNEL); - if (!asb) { - unlock_kernel(); + if (!asb) return -ENOMEM; - } sb->s_fs_info = asb; /* set default options */ @@ -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"); goto error; } - unlock_kernel(); return 0; error_free_bh: @@ -493,7 +483,6 @@ error_free_bh: error: sb->s_fs_info = NULL; kfree(asb); - unlock_kernel(); return -EINVAL; } -- 1.7.1