summaryrefslogtreecommitdiff
path: root/fs/bfs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-06-08 12:03:38 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2009-06-12 05:36:14 +0400
commit561e47ce7244168788d4ecef9a2271df204b3c89 (patch)
treeb587db305924ff4fea0ca1ad18b341dfda65281e /fs/bfs/inode.c
parente28964365faf3b9961695eb62b48cbc9f2a2a245 (diff)
downloadlinux-561e47ce7244168788d4ecef9a2271df204b3c89.tar.xz
bfs: add ->sync_fs
Add a ->sync_fs method for data integrity syncs, and reimplement ->write_super ontop of it. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/bfs/inode.c')
-rw-r--r--fs/bfs/inode.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c
index d1d9d9088371..6f60336c6628 100644
--- a/fs/bfs/inode.c
+++ b/fs/bfs/inode.c
@@ -216,6 +216,26 @@ static void bfs_delete_inode(struct inode *inode)
clear_inode(inode);
}
+static int bfs_sync_fs(struct super_block *sb, int wait)
+{
+ struct bfs_sb_info *info = BFS_SB(sb);
+
+ mutex_lock(&info->bfs_lock);
+ mark_buffer_dirty(info->si_sbh);
+ sb->s_dirt = 0;
+ mutex_unlock(&info->bfs_lock);
+
+ return 0;
+}
+
+static void bfs_write_super(struct super_block *sb)
+{
+ if (!(sb->s_flags & MS_RDONLY))
+ bfs_sync_fs(sb, 1);
+ else
+ sb->s_dirt = 0;
+}
+
static void bfs_put_super(struct super_block *s)
{
struct bfs_sb_info *info = BFS_SB(s);
@@ -254,17 +274,6 @@ static int bfs_statfs(struct dentry *dentry, struct kstatfs *buf)
return 0;
}
-static void bfs_write_super(struct super_block *s)
-{
- struct bfs_sb_info *info = BFS_SB(s);
-
- mutex_lock(&info->bfs_lock);
- if (!(s->s_flags & MS_RDONLY))
- mark_buffer_dirty(info->si_sbh);
- s->s_dirt = 0;
- mutex_unlock(&info->bfs_lock);
-}
-
static struct kmem_cache *bfs_inode_cachep;
static struct inode *bfs_alloc_inode(struct super_block *sb)
@@ -312,6 +321,7 @@ static const struct super_operations bfs_sops = {
.delete_inode = bfs_delete_inode,
.put_super = bfs_put_super,
.write_super = bfs_write_super,
+ .sync_fs = bfs_sync_fs,
.statfs = bfs_statfs,
};