Btrfs: Btree defrag on the extent-mapping tree as well
[linux-2.6-block.git] / fs / btrfs / super.c
index 2e797d5fb28148495dda85bc129d95eb2299a8d1..74f3de47423c193d6a249420cf8ba82cc9428f1f 100644 (file)
@@ -121,7 +121,9 @@ static int btrfs_sync_fs(struct super_block *sb, int wait)
                filemap_flush(root->fs_info->btree_inode->i_mapping);
                return 0;
        }
+       btrfs_clean_old_snapshots(root);
        mutex_lock(&root->fs_info->fs_mutex);
+       btrfs_defrag_dirty_roots(root->fs_info);
        trans = btrfs_start_transaction(root, 1);
        ret = btrfs_commit_transaction(trans, root);
        sb->s_dirt = 0;