* [PATCH] Remove superfluous lock_super() in ext2 and ext3 xattr code
@ 2006-10-19 18:34 Andreas Gruenbacher
2006-10-19 22:52 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: Andreas Gruenbacher @ 2006-10-19 18:34 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel, Andrew Morton
lock_super() is unnecessary for setting super-block feature flags.
Use the provided *_SET_COMPAT_FEATURE() macros as well.
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Index: linux-2.6.19-rc2/fs/ext2/xattr.c
===================================================================
--- linux-2.6.19-rc2.orig/fs/ext2/xattr.c
+++ linux-2.6.19-rc2/fs/ext2/xattr.c
@@ -342,12 +342,9 @@ static void ext2_xattr_update_super_bloc
if (EXT2_HAS_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR))
return;
- lock_super(sb);
- EXT2_SB(sb)->s_es->s_feature_compat |=
- cpu_to_le32(EXT2_FEATURE_COMPAT_EXT_ATTR);
+ EXT2_SET_COMPAT_FEATURE(sb, EXT2_FEATURE_COMPAT_EXT_ATTR);
sb->s_dirt = 1;
mark_buffer_dirty(EXT2_SB(sb)->s_sbh);
- unlock_super(sb);
}
/*
Index: linux-2.6.19-rc2/fs/ext3/xattr.c
===================================================================
--- linux-2.6.19-rc2.orig/fs/ext3/xattr.c
+++ linux-2.6.19-rc2/fs/ext3/xattr.c
@@ -459,14 +459,11 @@ static void ext3_xattr_update_super_bloc
if (EXT3_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_EXT_ATTR))
return;
- lock_super(sb);
if (ext3_journal_get_write_access(handle, EXT3_SB(sb)->s_sbh) == 0) {
- EXT3_SB(sb)->s_es->s_feature_compat |=
- cpu_to_le32(EXT3_FEATURE_COMPAT_EXT_ATTR);
+ EXT3_SET_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_EXT_ATTR);
sb->s_dirt = 1;
ext3_journal_dirty_metadata(handle, EXT3_SB(sb)->s_sbh);
}
- unlock_super(sb);
}
/*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove superfluous lock_super() in ext2 and ext3 xattr code
2006-10-19 18:34 [PATCH] Remove superfluous lock_super() in ext2 and ext3 xattr code Andreas Gruenbacher
@ 2006-10-19 22:52 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2006-10-19 22:52 UTC (permalink / raw)
To: Andreas Gruenbacher; +Cc: Linus Torvalds, linux-kernel
On Thu, 19 Oct 2006 20:34:24 +0200
Andreas Gruenbacher <agruen@suse.de> wrote:
> Index: linux-2.6.19-rc2/fs/ext2/xattr.c
> Index: linux-2.6.19-rc2/fs/ext3/xattr.c
You forgot ext4 ;)
I updated the patch, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-10-19 22:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-19 18:34 [PATCH] Remove superfluous lock_super() in ext2 and ext3 xattr code Andreas Gruenbacher
2006-10-19 22:52 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox