aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2006-03-25 06:07:44 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-25 11:22:56 -0500
commitd25b9a1ff0741e71a46f37f45263b5ddcbc948c4 (patch)
tree7cbf0f402041840b413a43c6da936998981f100d
parent11b8448751ba114416c63899638a8e473ebd21e7 (diff)
[PATCH] freeze_bdev() cleanup
freeze_bdev() uses a fsync_super() without sync_blockdev(). This patch makes __fsync_super() and shares it. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/buffer.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 6d77ce9f54e5..3b3ab5281920 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -160,12 +160,7 @@ int sync_blockdev(struct block_device *bdev)
160} 160}
161EXPORT_SYMBOL(sync_blockdev); 161EXPORT_SYMBOL(sync_blockdev);
162 162
163/* 163static void __fsync_super(struct super_block *sb)
164 * Write out and wait upon all dirty data associated with this
165 * superblock. Filesystem data as well as the underlying block
166 * device. Takes the superblock lock.
167 */
168int fsync_super(struct super_block *sb)
169{ 164{
170 sync_inodes_sb(sb, 0); 165 sync_inodes_sb(sb, 0);
171 DQUOT_SYNC(sb); 166 DQUOT_SYNC(sb);
@@ -177,7 +172,16 @@ int fsync_super(struct super_block *sb)
177 sb->s_op->sync_fs(sb, 1); 172 sb->s_op->sync_fs(sb, 1);
178 sync_blockdev(sb->s_bdev); 173 sync_blockdev(sb->s_bdev);
179 sync_inodes_sb(sb, 1); 174 sync_inodes_sb(sb, 1);
175}
180 176
177/*
178 * Write out and wait upon all dirty data associated with this
179 * superblock. Filesystem data as well as the underlying block
180 * device. Takes the superblock lock.
181 */
182int fsync_super(struct super_block *sb)
183{
184 __fsync_super(sb);
181 return sync_blockdev(sb->s_bdev); 185 return sync_blockdev(sb->s_bdev);
182} 186}
183 187
@@ -216,19 +220,7 @@ struct super_block *freeze_bdev(struct block_device *bdev)
216 sb->s_frozen = SB_FREEZE_WRITE; 220 sb->s_frozen = SB_FREEZE_WRITE;
217 smp_wmb(); 221 smp_wmb();
218 222
219 sync_inodes_sb(sb, 0); 223 __fsync_super(sb);
220 DQUOT_SYNC(sb);
221
222 lock_super(sb);
223 if (sb->s_dirt && sb->s_op->write_super)
224 sb->s_op->write_super(sb);
225 unlock_super(sb);
226
227 if (sb->s_op->sync_fs)
228 sb->s_op->sync_fs(sb, 1);
229
230 sync_blockdev(sb->s_bdev);
231 sync_inodes_sb(sb, 1);
232 224
233 sb->s_frozen = SB_FREEZE_TRANS; 225 sb->s_frozen = SB_FREEZE_TRANS;
234 smp_wmb(); 226 smp_wmb();