diff options
author | Jan Blunck <jblunck@suse.de> | 2010-04-14 08:38:38 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 13:30:39 -0400 |
commit | c15271f4e74cd6dbdf461335d6d1450949c4b956 (patch) | |
tree | 585738bde9a80e580686072d02cd6c1e5d261c1e /include/linux/ext2_fs_sb.h | |
parent | 4c96a68bfc110d87b28bcee4c395a7b4d26ed67a (diff) |
ext2: Add ext2_sb_info s_lock spinlock
Add a spinlock that protects against concurrent modifications of
s_mount_state, s_blocks_last, s_overhead_last and the content of the
superblock's buffer pointed to by sbi->s_es. The spinlock is now used in
ext2_xattr_update_super_block() which was setting the
EXT2_FEATURE_COMPAT_EXT_ATTR flag on the superblock without protection
before. Likewise the spinlock is used in ext2_show_options() to have a
consistent view of the mount options.
This is a preparation patch for removing the BKL from ext2 in the next
patch.
Signed-off-by: Jan Blunck <jblunck@suse.de>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jan Kara <jack@suse.cz>
Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'include/linux/ext2_fs_sb.h')
-rw-r--r-- | include/linux/ext2_fs_sb.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h index 1cdb66367c98..db4d9f586bb6 100644 --- a/include/linux/ext2_fs_sb.h +++ b/include/linux/ext2_fs_sb.h | |||
@@ -106,6 +106,15 @@ struct ext2_sb_info { | |||
106 | spinlock_t s_rsv_window_lock; | 106 | spinlock_t s_rsv_window_lock; |
107 | struct rb_root s_rsv_window_root; | 107 | struct rb_root s_rsv_window_root; |
108 | struct ext2_reserve_window_node s_rsv_window_head; | 108 | struct ext2_reserve_window_node s_rsv_window_head; |
109 | /* | ||
110 | * s_lock protects against concurrent modifications of s_mount_state, | ||
111 | * s_blocks_last, s_overhead_last and the content of superblock's | ||
112 | * buffer pointed to by sbi->s_es. | ||
113 | * | ||
114 | * Note: It is used in ext2_show_options() to provide a consistent view | ||
115 | * of the mount options. | ||
116 | */ | ||
117 | spinlock_t s_lock; | ||
109 | }; | 118 | }; |
110 | 119 | ||
111 | static inline spinlock_t * | 120 | static inline spinlock_t * |