Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 561e47ce authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro
Browse files

bfs: add ->sync_fs



Add a ->sync_fs method for data integrity syncs, and reimplement
->write_super ontop of it.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent e2896436
Loading
Loading
Loading
Loading
+21 −11
Original line number Diff line number Diff line
@@ -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,
};