diff options
author | Yongqiang Yang <xiaoqiangnk@gmail.com> | 2011-07-26 21:35:44 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2011-07-26 21:35:44 -0400 |
commit | 8f82f840ec6ab873f520364d443ff6fa1b3f8e22 (patch) | |
tree | 72d90cdc8f7311ef913b7471e53f718bebbf7414 /fs/ext4/ext4.h | |
parent | 2d859db3e4a82a365572592d57624a5f996ed0ec (diff) |
ext4: prevent parallel resizers by atomic bit ops
Before this patch, parallel resizers are allowed and protected by a
mutex lock, actually, there is no need to support parallel resizer, so
this patch prevents parallel resizers by atmoic bit ops, like
lock_page() and unlock_page() do.
To do this, the patch removed the mutex lock s_resize_lock from struct
ext4_sb_info and added a unsigned long field named s_resize_flags
which inidicates if there is a resizer.
Signed-off-by: Yongqiang Yang <xiaoqiangnk@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 62cee2b6fe79..bb0f7760c7c8 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1127,7 +1127,8 @@ struct ext4_sb_info { | |||
1127 | struct journal_s *s_journal; | 1127 | struct journal_s *s_journal; |
1128 | struct list_head s_orphan; | 1128 | struct list_head s_orphan; |
1129 | struct mutex s_orphan_lock; | 1129 | struct mutex s_orphan_lock; |
1130 | struct mutex s_resize_lock; | 1130 | unsigned long s_resize_flags; /* Flags indicating if there |
1131 | is a resizer */ | ||
1131 | unsigned long s_commit_interval; | 1132 | unsigned long s_commit_interval; |
1132 | u32 s_max_batch_time; | 1133 | u32 s_max_batch_time; |
1133 | u32 s_min_batch_time; | 1134 | u32 s_min_batch_time; |
@@ -2269,6 +2270,10 @@ static inline void set_bitmap_uptodate(struct buffer_head *bh) | |||
2269 | extern wait_queue_head_t ext4__ioend_wq[EXT4_WQ_HASH_SZ]; | 2270 | extern wait_queue_head_t ext4__ioend_wq[EXT4_WQ_HASH_SZ]; |
2270 | extern struct mutex ext4__aio_mutex[EXT4_WQ_HASH_SZ]; | 2271 | extern struct mutex ext4__aio_mutex[EXT4_WQ_HASH_SZ]; |
2271 | 2272 | ||
2273 | #define EXT4_RESIZING 0 | ||
2274 | extern int ext4_resize_begin(struct super_block *sb); | ||
2275 | extern void ext4_resize_end(struct super_block *sb); | ||
2276 | |||
2272 | #endif /* __KERNEL__ */ | 2277 | #endif /* __KERNEL__ */ |
2273 | 2278 | ||
2274 | #endif /* _EXT4_H */ | 2279 | #endif /* _EXT4_H */ |