diff options
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r-- | fs/btrfs/super.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 67659b6ce962..8f07f462236a 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -474,6 +474,8 @@ static int btrfs_fill_super(struct super_block * sb, void * data, int silent) | |||
474 | disk_super = (struct btrfs_super_block *)bh->b_data; | 474 | disk_super = (struct btrfs_super_block *)bh->b_data; |
475 | root = open_ctree(sb, bh, disk_super); | 475 | root = open_ctree(sb, bh, disk_super); |
476 | sb->s_fs_info = root; | 476 | sb->s_fs_info = root; |
477 | disk_super = root->fs_info->disk_super; | ||
478 | |||
477 | if (!root) { | 479 | if (!root) { |
478 | printk("btrfs: open_ctree failed\n"); | 480 | printk("btrfs: open_ctree failed\n"); |
479 | return -EIO; | 481 | return -EIO; |
@@ -734,15 +736,15 @@ static int btrfs_sync_fs(struct super_block *sb, int wait) | |||
734 | struct btrfs_trans_handle *trans; | 736 | struct btrfs_trans_handle *trans; |
735 | struct btrfs_root *root; | 737 | struct btrfs_root *root; |
736 | int ret; | 738 | int ret; |
739 | root = btrfs_sb(sb); | ||
737 | 740 | ||
738 | sb->s_dirt = 0; | 741 | sb->s_dirt = 0; |
739 | if (!wait) { | 742 | if (!wait) { |
740 | filemap_flush(sb->s_bdev->bd_inode->i_mapping); | 743 | filemap_flush(root->fs_info->btree_inode->i_mapping); |
741 | return 0; | 744 | return 0; |
742 | } | 745 | } |
743 | filemap_write_and_wait(sb->s_bdev->bd_inode->i_mapping); | 746 | filemap_write_and_wait(root->fs_info->btree_inode->i_mapping); |
744 | 747 | ||
745 | root = btrfs_sb(sb); | ||
746 | mutex_lock(&root->fs_info->fs_mutex); | 748 | mutex_lock(&root->fs_info->fs_mutex); |
747 | trans = btrfs_start_transaction(root, 1); | 749 | trans = btrfs_start_transaction(root, 1); |
748 | ret = btrfs_commit_transaction(trans, root); | 750 | ret = btrfs_commit_transaction(trans, root); |