diff mbox

[3/8] ext2: write superblock only once on unmount

Message ID 1332346475-1441-4-git-send-email-dedekind1@gmail.com
State Not Applicable, archived
Headers show

Commit Message

Artem Bityutskiy March 21, 2012, 4:14 p.m. UTC
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>

Currently on unmount if we are mounted R/W, we first write the superblock to
the media if it is dirty, and then write it again, which is not optimal. This
patch makes ext2 write the superblock on unmount less times.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
---
 fs/ext2/super.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

Comments

Jan Kara March 31, 2012, 11:53 a.m. UTC | #1
On Wed 21-03-12 18:14:30, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> 
> Currently on unmount if we are mounted R/W, we first write the superblock to
> the media if it is dirty, and then write it again, which is not optimal. This
> patch makes ext2 write the superblock on unmount less times.
  Looks good. I've added the patch to my tree.

									Honza
> 
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> ---
>  fs/ext2/super.c |    3 ---
>  1 files changed, 0 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext2/super.c b/fs/ext2/super.c
> index 0090595..d141758 100644
> --- a/fs/ext2/super.c
> +++ b/fs/ext2/super.c
> @@ -130,9 +130,6 @@ static void ext2_put_super (struct super_block * sb)
>  
>  	dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
>  
> -	if (sb->s_dirt)
> -		ext2_write_super(sb);
> -
>  	ext2_xattr_put_super(sb);
>  	if (!(sb->s_flags & MS_RDONLY)) {
>  		struct ext2_super_block *es = sbi->s_es;
> -- 
> 1.7.7.6
>
Artem Bityutskiy April 2, 2012, 1:44 p.m. UTC | #2
On Sat, 2012-03-31 at 13:53 +0200, Jan Kara wrote:
> On Wed 21-03-12 18:14:30, Artem Bityutskiy wrote:
> > From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> > 
> > Currently on unmount if we are mounted R/W, we first write the superblock to
> > the media if it is dirty, and then write it again, which is not optimal. This
> > patch makes ext2 write the superblock on unmount less times.
>   Looks good. I've added the patch to my tree.

I would like to test v2 against your tree, I found this one:

git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git

but I do not see this patch there - is that the right tree, or may be
you did not push out? Which branch should I use?

Thanks!
Jan Kara April 2, 2012, 10:10 p.m. UTC | #3
On Mon 02-04-12 16:44:09, Artem Bityutskiy wrote:
> On Sat, 2012-03-31 at 13:53 +0200, Jan Kara wrote:
> > On Wed 21-03-12 18:14:30, Artem Bityutskiy wrote:
> > > From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> > > 
> > > Currently on unmount if we are mounted R/W, we first write the superblock to
> > > the media if it is dirty, and then write it again, which is not optimal. This
> > > patch makes ext2 write the superblock on unmount less times.
> >   Looks good. I've added the patch to my tree.
> 
> I would like to test v2 against your tree, I found this one:
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git
> 
> but I do not see this patch there - is that the right tree, or may be
> you did not push out? Which branch should I use?
  Yeah, I didn't push out the changes. Now they are out (for_next /
for_testing) branch.

								Honza
diff mbox

Patch

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 0090595..d141758 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -130,9 +130,6 @@  static void ext2_put_super (struct super_block * sb)
 
 	dquot_disable(sb, -1, DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
 
-	if (sb->s_dirt)
-		ext2_write_super(sb);
-
 	ext2_xattr_put_super(sb);
 	if (!(sb->s_flags & MS_RDONLY)) {
 		struct ext2_super_block *es = sbi->s_es;