linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Blunck <jblunck@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: Linux-Kernel Mailinglist <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	jkacur@redhat.com, Thomas Gleixner <tglx@linutronix.de>,
	Christoph Hellwig <hch@infradead.org>,
	Arnd Bergmann <arnd@arndb.de>,
	matthew@wil.cx, Jan Blunck <jblunck@suse.de>,
	Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Subject: [PATCH 14/20] BKL: Remove BKL from JFS
Date: Wed, 18 Nov 2009 10:24:47 +0100	[thread overview]
Message-ID: <1258536293-7762-15-git-send-email-jblunck@suse.de> (raw)
In-Reply-To: <1258536293-7762-1-git-send-email-jblunck@suse.de>

The BKL is only used in put_super, fill_super and remount_fs that are all
three protected by the superblocks s_umount rw_semaphore. Therefore it is
safe to remove the BKL entirely.

Signed-off-by: Jan Blunck <jblunck@suse.de>
---
 fs/jfs/super.c |   36 +++++++-----------------------------
 1 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index a8e6046..5ccbb32 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -32,7 +32,6 @@
 #include <linux/crc32.h>
 #include <asm/uaccess.h>
 #include <linux/seq_file.h>
-#include <linux/smp_lock.h>
 
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
@@ -173,8 +172,6 @@ static void jfs_put_super(struct super_block *sb)
 
 	jfs_info("In jfs_put_super");
 
-	lock_kernel();
-
 	rc = jfs_umount(sb);
 	if (rc)
 		jfs_err("jfs_umount failed with return code %d", rc);
@@ -185,8 +182,6 @@ static void jfs_put_super(struct super_block *sb)
 	iput(sbi->direct_inode);
 
 	kfree(sbi);
-
-	unlock_kernel();
 }
 
 enum {
@@ -366,19 +361,16 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
 	if (!parse_options(data, sb, &newLVSize, &flag)) {
 		return -EINVAL;
 	}
-	lock_kernel();
+
 	if (newLVSize) {
 		if (sb->s_flags & MS_RDONLY) {
 			printk(KERN_ERR
 		  "JFS: resize requires volume to be mounted read-write\n");
-			unlock_kernel();
 			return -EROFS;
 		}
 		rc = jfs_extendfs(sb, newLVSize, 0);
-		if (rc) {
-			unlock_kernel();
+		if (rc)
 			return rc;
-		}
 	}
 
 	if ((sb->s_flags & MS_RDONLY) && !(*flags & MS_RDONLY)) {
@@ -390,30 +382,25 @@ static int jfs_remount(struct super_block *sb, int *flags, char *data)
 
 		JFS_SBI(sb)->flag = flag;
 		ret = jfs_mount_rw(sb, 1);
-		unlock_kernel();
 		return ret;
 	}
 	if ((!(sb->s_flags & MS_RDONLY)) && (*flags & MS_RDONLY)) {
 		rc = jfs_umount_rw(sb);
 		JFS_SBI(sb)->flag = flag;
-		unlock_kernel();
 		return rc;
 	}
 	if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY))
 		if (!(sb->s_flags & MS_RDONLY)) {
 			rc = jfs_umount_rw(sb);
-			if (rc) {
-				unlock_kernel();
+			if (rc)
 				return rc;
-			}
+
 			JFS_SBI(sb)->flag = flag;
 			ret = jfs_mount_rw(sb, 1);
-			unlock_kernel();
 			return ret;
 		}
 	JFS_SBI(sb)->flag = flag;
 
-	unlock_kernel();
 	return 0;
 }
 
@@ -425,20 +412,15 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 	s64 newLVSize = 0;
 	int flag, ret = -EINVAL;
 
-	lock_kernel();
-
 	jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags);
 
-	if (!new_valid_dev(sb->s_bdev->bd_dev)) {
-		unlock_kernel();
+	if (!new_valid_dev(sb->s_bdev->bd_dev))
 		return -EOVERFLOW;
-	}
 
 	sbi = kzalloc(sizeof (struct jfs_sb_info), GFP_KERNEL);
-	if (!sbi) {
-		unlock_kernel();
+	if (!sbi)
 		return -ENOMEM;
-	}
+
 	sb->s_fs_info = sbi;
 	sbi->sb = sb;
 	sbi->uid = sbi->gid = sbi->umask = -1;
@@ -448,7 +430,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 
 	if (!parse_options((char *) data, sb, &newLVSize, &flag)) {
 		kfree(sbi);
-		unlock_kernel();
 		return -EINVAL;
 	}
 	sbi->flag = flag;
@@ -460,7 +441,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 	if (newLVSize) {
 		printk(KERN_ERR "resize option for remount only\n");
 		kfree(sbi);
-		unlock_kernel();
 		return -EINVAL;
 	}
 
@@ -536,7 +516,6 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
 	sb->s_maxbytes = min(((u64) PAGE_CACHE_SIZE << 32) - 1, sb->s_maxbytes);
 #endif
 	sb->s_time_gran = 1;
-	unlock_kernel();
 	return 0;
 
 out_no_root:
@@ -558,7 +537,6 @@ out_kfree:
 	if (sbi->nls_tab)
 		unload_nls(sbi->nls_tab);
 	kfree(sbi);
-	unlock_kernel();
 	return ret;
 }
 
-- 
1.6.4.2

  parent reply	other threads:[~2009-11-18  9:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18  9:24 [PATCH 00/20] BKL pushdown from do_new_mount() to the filesystems (v3) Jan Blunck
2009-11-18  9:24 ` [PATCH 01/20] JFS: Free sbi memory in error path Jan Blunck
2009-11-18  9:24 ` [PATCH 02/20] AFFS: " Jan Blunck
2009-11-18  9:24 ` [PATCH 04/20] BKL: Remove outdated comment and include Jan Blunck
2009-11-18  9:24 ` [PATCH 05/20] BKL: Remove BKL from Amiga FFS Jan Blunck
2009-11-18  9:24 ` [PATCH 06/20] BKL: Remove BKL from BFS Jan Blunck
2009-11-18  9:24 ` [PATCH 07/20] BKL: Remove BKL from CifsFS Jan Blunck
2009-11-18  9:24 ` [PATCH 08/20] BKL: Remove BKL from ext3 fill_super() Jan Blunck
2009-11-18  9:24 ` [PATCH 09/20] BKL: Remove BKL from ext3_put_super() and ext3_remount() Jan Blunck
2009-11-18  9:24 ` [PATCH 10/20] BKL: Remove BKL from ext4 filesystem Jan Blunck
2009-11-18  9:24 ` [PATCH 11/20] BKL: Remove BKL from exofs Jan Blunck
2009-11-18  9:24 ` [PATCH 12/20] BKL: Remove BKL from HFS Jan Blunck
2009-11-18  9:24 ` [PATCH 13/20] BKL: Remove BKL from HFS+ Jan Blunck
2009-11-18  9:24 ` Jan Blunck [this message]
2009-11-18  9:24 ` [PATCH 15/20] BKL: Remove BKL from NILFS2 Jan Blunck
2009-11-18 14:40   ` Ryusuke Konishi
2009-11-18  9:24 ` [PATCH 16/20] BKL: Remove BKL from NTFS Jan Blunck
2009-11-18  9:24 ` [PATCH 17/20] BKL: Remove BKL from cgroup Jan Blunck
2009-11-18 18:24   ` Paul Menage
2009-11-18  9:24 ` [PATCH 18/20] BKL: Remove BKL from do_new_mount() Jan Blunck
2009-11-18  9:24 ` [PATCH 19/20] ext2: Add ext2_sb_info s_lock spinlock Jan Blunck
2009-11-18 12:31   ` OGAWA Hirofumi
2009-11-18  9:24 ` [PATCH 20/20] BKL: Remove BKL from ext2 filesystem Jan Blunck
     [not found] ` <1258536293-7762-4-git-send-email-jblunck@suse.de>
2009-11-18 10:41   ` [PATCH 03/20] BKL: Explicitly add BKL around get_sb/fill_super Anders Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258536293-7762-15-git-send-email-jblunck@suse.de \
    --to=jblunck@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=hch@infradead.org \
    --cc=jkacur@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=shaggy@linux.vnet.ibm.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).