2010-07-04 05:33:30

by Ryusuke Konishi

[permalink] [raw]
Subject: [PATCH] nilfs2: remove BKL uses

Nilfs has BKL uses in its put_super and remount functions, but none of
them are necessary, just came from earlier push downs. This
eliminates the BKL uses from nilfs.

Signed-off-by: Ryusuke Konishi <[email protected]>
---
fs/nilfs2/ioctl.c | 1 -
fs/nilfs2/super.c | 9 ---------
2 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
index f90a33d..0442ee3 100644
--- a/fs/nilfs2/ioctl.c
+++ b/fs/nilfs2/ioctl.c
@@ -22,7 +22,6 @@

#include <linux/fs.h>
#include <linux/wait.h>
-#include <linux/smp_lock.h> /* lock_kernel(), unlock_kernel() */
#include <linux/slab.h>
#include <linux/capability.h> /* capable() */
#include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index f2cfbba..29be735 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -45,7 +45,6 @@
#include <linux/parser.h>
#include <linux/random.h>
#include <linux/crc32.h>
-#include <linux/smp_lock.h>
#include <linux/vfs.h>
#include <linux/writeback.h>
#include <linux/kobject.h>
@@ -357,8 +356,6 @@ static void nilfs_put_super(struct super_block *sb)
struct nilfs_sb_info *sbi = NILFS_SB(sb);
struct the_nilfs *nilfs = sbi->s_nilfs;

- lock_kernel();
-
nilfs_detach_segment_constructor(sbi);

if (!(sb->s_flags & MS_RDONLY)) {
@@ -376,8 +373,6 @@ static void nilfs_put_super(struct super_block *sb)
sbi->s_super = NULL;
sb->s_fs_info = NULL;
nilfs_put_sbinfo(sbi);
-
- unlock_kernel();
}

static int nilfs_sync_fs(struct super_block *sb, int wait)
@@ -913,8 +908,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
struct nilfs_mount_options old_opts;
int was_snapshot, err;

- lock_kernel();
-
down_write(&nilfs->ns_super_sem);
old_sb_flags = sb->s_flags;
old_opts.mount_opt = sbi->s_mount_opt;
@@ -988,7 +981,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
}
out:
up_write(&nilfs->ns_super_sem);
- unlock_kernel();
return 0;

restore_opts:
@@ -996,7 +988,6 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data)
sbi->s_mount_opt = old_opts.mount_opt;
sbi->s_snapshot_cno = old_opts.snapshot_cno;
up_write(&nilfs->ns_super_sem);
- unlock_kernel();
return err;
}

--
1.6.6.2


2010-07-05 14:50:31

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH] nilfs2: remove BKL uses

On Sunday 04 July 2010, Ryusuke Konishi wrote:
> Nilfs has BKL uses in its put_super and remount functions, but none of
> them are necessary, just came from earlier push downs. This
> eliminates the BKL uses from nilfs.
>
> Signed-off-by: Ryusuke Konishi <[email protected]>

This looks good, but there is a another patch series pushing the BKL
into the get_sb and fill_super operations, which should be the final
pushdown for file systems. I wonder if there is a way to find a
shortcut on this so we don't need to add it first just to have you
go through the effort of removing it again.

Arnd

2010-07-05 14:53:21

by Frederic Weisbecker

[permalink] [raw]
Subject: Re: [PATCH] nilfs2: remove BKL uses

On Mon, Jul 05, 2010 at 04:50:23PM +0200, Arnd Bergmann wrote:
> On Sunday 04 July 2010, Ryusuke Konishi wrote:
> > Nilfs has BKL uses in its put_super and remount functions, but none of
> > them are necessary, just came from earlier push downs. This
> > eliminates the BKL uses from nilfs.
> >
> > Signed-off-by: Ryusuke Konishi <[email protected]>
>
> This looks good, but there is a another patch series pushing the BKL
> into the get_sb and fill_super operations, which should be the final
> pushdown for file systems. I wonder if there is a way to find a
> shortcut on this so we don't need to add it first just to have you
> go through the effort of removing it again.


I could take his patch in the mount pushdown series.

2010-07-05 17:55:28

by Ryusuke Konishi

[permalink] [raw]
Subject: Re: [PATCH] nilfs2: remove BKL uses

On Mon, 5 Jul 2010 16:53:29 +0200, Frederic Weisbecker wrote:
> On Mon, Jul 05, 2010 at 04:50:23PM +0200, Arnd Bergmann wrote:
> > On Sunday 04 July 2010, Ryusuke Konishi wrote:
> > > Nilfs has BKL uses in its put_super and remount functions, but none of
> > > them are necessary, just came from earlier push downs. This
> > > eliminates the BKL uses from nilfs.
> > >
> > > Signed-off-by: Ryusuke Konishi <[email protected]>
> >
> > This looks good, but there is a another patch series pushing the BKL
> > into the get_sb and fill_super operations, which should be the final
> > pushdown for file systems. I wonder if there is a way to find a
> > shortcut on this so we don't need to add it first just to have you
> > go through the effort of removing it again.
>
>
> I could take his patch in the mount pushdown series.

OK, please treat this patch as needed.

I've forgotten the additional BKL push down patch and Jan's BKL
removal patch on nilfs, but yes, it looks omissible to add BKL and
remove it again there.

For now, I will drop my patch from my tree.

Thanks,
Ryusuke Konishi