Tejun Heo | 1 Nov 2009 10:31

Re: [PATCH] Fix bio_alloc() and bio_kmalloc() documentation

Alberto Bertogli wrote:
> Commit 451a9ebf accidentally broke bio_alloc() and bio_kmalloc() comments by
> (almost) swapping them.
> 
> This patch fixes that, by placing the comments in the right place.
> 
> Signed-off-by: Alberto Bertogli <albertito <at> blitiri.com.ar>

Oops,

Acked-by: Tejun Heo <tj <at> kernel.org>

Thank you.

--

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jan Blunck | 2 Nov 2009 11:04
Picon

[PATCH 00/27] Push down BKL to the filesystems (v2)

During the realtime preemption mini-summit we discussed the entire removal of
the big kernel lock. I've started working on this for some filesystems. My plan
is to push the BKL down to the implementations first and remove it from there
later.

This series is pushing the BKL from do_new_mount() down to the filesystems and
removes it from ext series of filesystems and one other trivial use: if the BKL
is only used in get_sb/fill_super due to the push-down, we just need to make
sure that parallel calls to get_sb/fill_super would race against each other.

I addressed the feedback from Matthew Wilcox and tried to be more verbose about
why I think it is safe to remove the BKL. In most cases there is no shared
resource accessed anyway so it is trivially safe to remove the lock.

There are two filesystems where I'm not 100% sure if the proposed patch is
enough, namely btrfs and xfs. Chris(+toph), could you help me here?

I left out the patch to remove default_llseek() on purpose. This indeed needs
some more lovin'.

Comments?

Jan

Jan Blunck (27):
  BKL: Push down BKL from do_new_mount() to the filesystems
    get_sb/fill_super operation
  BKL: Remove outdated comment and include
  BKL: Remove BKL from simple_fill_super
  ext2: Add ext2_sb_info mutex
(Continue reading)

Jan Blunck | 2 Nov 2009 11:04
Picon

[PATCH 02/27] BKL: Remove outdated comment and include

remount_fs does not need lock_kernel() anymore since that was pushed down some
time ago. Since nothing needs smp_lock.h anymore lets remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/super.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/super.c b/fs/super.c
index 19eb70b..6fe4611 100644
--- a/fs/super.c
+++ b/fs/super.c
 <at>  <at>  -23,7 +23,6  <at>  <at> 
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/init.h>
-#include <linux/smp_lock.h>
 #include <linux/acct.h>
 #include <linux/blkdev.h>
 #include <linux/quotaops.h>
 <at>  <at>  -618,8 +617,6  <at>  <at>  static void do_emergency_remount(struct work_struct *work)
 		down_write(&sb->s_umount);
 		if (sb->s_root && sb->s_bdev && !(sb->s_flags & MS_RDONLY)) {
 			/*
-			 * ->remount_fs needs lock_kernel().
-			 *
 			 * What lock protects sb->s_flags??
 			 */
 			do_remount_sb(sb, MS_RDONLY, NULL, 1);
--

-- 
(Continue reading)

Jan Blunck | 2 Nov 2009 11:04
Picon

[PATCH 16/27] BKL: Remove BKL from efs

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/efs/super.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/efs/super.c b/fs/efs/super.c
index 0981141..f049428 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
 <at>  <at>  -249,13 +249,9  <at>  <at>  static int efs_fill_super(struct super_block *s, void *d, int silent)
 	struct inode *root;
 	int ret = -EINVAL;

-	lock_kernel();
-
-	sb = kzalloc(sizeof(struct efs_sb_info), GFP_KERNEL);
-	if (!sb) {
-		unlock_kernel();
+ 	sb = kzalloc(sizeof(struct efs_sb_info), GFP_KERNEL);
+	if (!sb)
 		return -ENOMEM;
-	}
 	s->s_fs_info = sb;

 	s->s_magic		= EFS_SUPER_MAGIC;
 <at>  <at>  -323,14 +319,12  <at>  <at>  static int efs_fill_super(struct super_block *s, void *d, int silent)
 		goto out_no_fs;
 	}
(Continue reading)

Jan Blunck | 2 Nov 2009 11:04
Picon

[PATCH 12/27] BKL: Remove BKL from btrfs

BKL is only used in get_sb. It is safe to remove it.

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

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index e5cd2cf..752a546 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
 <at>  <at>  -480,17 +480,13  <at>  <at>  static int btrfs_get_sb(struct file_system_type *fs_type, int flags,
 	fmode_t mode = FMODE_READ;
 	int error = 0;

-	lock_kernel();
-
 	if (!(flags & MS_RDONLY))
 		mode |= FMODE_WRITE;

 	error = btrfs_parse_early_options(data, mode, fs_type,
 					  &subvol_name, &fs_devices);
-	if (error) {
-		unlock_kernel();
+	if (error)
 		return error;
-	}

 	error = btrfs_scan_one_device(dev_name, mode, fs_type, &fs_devices);
 	if (error)
(Continue reading)

Jan Blunck | 2 Nov 2009 11:04
Picon

[PATCH 11/27] BKL: Remove BKL from befs

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/befs/linuxvfs.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index f2aa193..33baf27 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
 <at>  <at>  -759,8 +759,6  <at>  <at>  befs_fill_super(struct super_block *sb, void *data, int silent)
 	const unsigned long sb_block = 0;
 	const off_t x86_sb_off = 512;

-	lock_kernel();
-
 	save_mount_options(sb, data);

 	sb->s_fs_info = kmalloc(sizeof (*befs_sb), GFP_KERNEL);
 <at>  <at>  -869,7 +867,6  <at>  <at>  befs_fill_super(struct super_block *sb, void *data, int silent)
 		befs_sb->nls = load_nls_default();
 	}

-	unlock_kernel();
 	return 0;
 /*****************/
       unacquire_bh:
 <at>  <at>  -880,7 +877,6  <at>  <at>  befs_fill_super(struct super_block *sb, void *data, int silent)

(Continue reading)

Jan Blunck | 2 Nov 2009 11:05
Picon

[PATCH 27/27] BKL: Remove BKL from xfs

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/xfs/linux-2.6/xfs_super.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
index 7426166..18a4b8e 100644
--- a/fs/xfs/linux-2.6/xfs_super.c
+++ b/fs/xfs/linux-2.6/xfs_super.c
 <at>  <at>  -1412,8 +1412,6  <at>  <at>  xfs_fs_fill_super(
 	int			flags = 0, error = ENOMEM;
 	char			*mtpt = NULL;

-	lock_kernel();
-
 	mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL);
 	if (!mp)
 		goto out;
 <at>  <at>  -1508,7 +1506,6  <at>  <at>  xfs_fs_fill_super(
 	kfree(mtpt);

 	xfs_itrace_exit(XFS_I(sb->s_root->d_inode));
-	unlock_kernel();
 	return 0;

  out_filestream_unmount:
 <at>  <at>  -1525,7 +1522,6  <at>  <at>  xfs_fs_fill_super(
 	kfree(mtpt);
(Continue reading)

Jan Blunck | 2 Nov 2009 11:05
Picon

[PATCH 25/27] BKL: Remove BKL from sysfs

BKL is only used in fill_super and get_sb_single() is used. It is safe to
remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/sysfs/mount.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 2e5a870..9487575 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
 <at>  <at>  -10,7 +10,7  <at>  <at> 
  * Please see Documentation/filesystems/sysfs.txt for more information.
  */

-#define DEBUG 
+#define DEBUG

 #include <linux/fs.h>
 #include <linux/mount.h>
 <at>  <at>  -18,7 +18,6  <at>  <at> 
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/magic.h>
-#include <linux/smp_lock.h> /* Only for lock_kernel() */

 #include "sysfs.h"

 <at>  <at>  -46,8 +45,6  <at>  <at>  static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
(Continue reading)

Jan Blunck | 2 Nov 2009 11:05
Picon

[PATCH 20/27] BKL: Remove BKL from minix

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/minix/inode.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/fs/minix/inode.c b/fs/minix/inode.c
index b8aa0a6..74ea82d 100644
--- a/fs/minix/inode.c
+++ b/fs/minix/inode.c
 <at>  <at>  -147,13 +147,9  <at>  <at>  static int minix_fill_super(struct super_block *s, void *data, int silent)
 	struct minix_sb_info *sbi;
 	int ret = -EINVAL;

-	lock_kernel();
-
 	sbi = kzalloc(sizeof(struct minix_sb_info), GFP_KERNEL);
-	if (!sbi) {
-		unlock_kernel();
+	if (!sbi)
 		return -ENOMEM;
-	}
 	s->s_fs_info = sbi;

 	BUILD_BUG_ON(32 != sizeof (struct minix_inode));
 <at>  <at>  -269,7 +265,6  <at>  <at>  static int minix_fill_super(struct super_block *s, void *data, int silent)
  	else if (sbi->s_mount_state & MINIX_ERROR_FS)
 		printk("MINIX-fs: mounting file system with errors, "
 			"running fsck is recommended\n");
(Continue reading)

Jan Blunck | 2 Nov 2009 11:05
Picon

[PATCH 24/27] BKL: Remove BKL from romfs

BKL is only used in fill_super. It is safe to remove it.

Signed-off-by: Jan Blunck <jblunck <at> suse.de>
---
 fs/romfs/super.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/fs/romfs/super.c b/fs/romfs/super.c
index 7342617..c117fa8 100644
--- a/fs/romfs/super.c
+++ b/fs/romfs/super.c
 <at>  <at>  -468,8 +468,6  <at>  <at>  static int romfs_fill_super(struct super_block *sb, void *data, int silent)
 	size_t len;
 	int ret;

-	lock_kernel();
-
 #ifdef CONFIG_BLOCK
 	if (!sb->s_mtd) {
 		sb_set_blocksize(sb, ROMBSIZE);
 <at>  <at>  -486,10 +484,8  <at>  <at>  static int romfs_fill_super(struct super_block *sb, void *data, int silent)

 	/* read the image superblock and check it */
 	rsb = kmalloc(512, GFP_KERNEL);
-	if (!rsb) {
-		unlock_kernel();
+	if (!rsb)
 		return -ENOMEM;
-	}

(Continue reading)


Gmane