aboutsummaryrefslogtreecommitdiffstats
path: root/fs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-08-29 14:05:54 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-09-30 14:31:19 -0400
commitcf9a2ae8d49948f861b56e5333530e491a9da190 (patch)
tree21f0b0d781b3e60cc60464d39b6d95681201b37e /fs/super.c
parent4090959aee403817ff386415f9bc602c1a0882ef (diff)
[PATCH] BLOCK: Move functions out of buffer code [try #6]
Move some functions out of the buffering code that aren't strictly buffering specific. This is a precursor to being able to disable the block layer. (*) Moved some stuff out of fs/buffer.c: (*) The file sync and general sync stuff moved to fs/sync.c. (*) The superblock sync stuff moved to fs/super.c. (*) do_invalidatepage() moved to mm/truncate.c. (*) try_to_release_page() moved to mm/filemap.c. (*) Moved some related declarations between header files: (*) declarations for do_invalidatepage() and try_to_release_page() moved to linux/mm.h. (*) __set_page_dirty_buffers() moved to linux/buffer_head.h. Signed-Off-By: David Howells <dhowells@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/super.c')
-rw-r--r--fs/super.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/fs/super.c b/fs/super.c
index 6987824d0dce..15671cd048b1 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -220,6 +220,37 @@ static int grab_super(struct super_block *s) __releases(sb_lock)
220 return 0; 220 return 0;
221} 221}
222 222
223/*
224 * Write out and wait upon all dirty data associated with this
225 * superblock. Filesystem data as well as the underlying block
226 * device. Takes the superblock lock. Requires a second blkdev
227 * flush by the caller to complete the operation.
228 */
229void __fsync_super(struct super_block *sb)
230{
231 sync_inodes_sb(sb, 0);
232 DQUOT_SYNC(sb);
233 lock_super(sb);
234 if (sb->s_dirt && sb->s_op->write_super)
235 sb->s_op->write_super(sb);
236 unlock_super(sb);
237 if (sb->s_op->sync_fs)
238 sb->s_op->sync_fs(sb, 1);
239 sync_blockdev(sb->s_bdev);
240 sync_inodes_sb(sb, 1);
241}
242
243/*
244 * Write out and wait upon all dirty data associated with this
245 * superblock. Filesystem data as well as the underlying block
246 * device. Takes the superblock lock.
247 */
248int fsync_super(struct super_block *sb)
249{
250 __fsync_super(sb);
251 return sync_blockdev(sb->s_bdev);
252}
253
223/** 254/**
224 * generic_shutdown_super - common helper for ->kill_sb() 255 * generic_shutdown_super - common helper for ->kill_sb()
225 * @sb: superblock to kill 256 * @sb: superblock to kill