static int cleaner_kthread(void *arg)
 {
-       struct btrfs_root *root = arg;
-       struct btrfs_fs_info *fs_info = root->fs_info;
+       struct btrfs_fs_info *fs_info = (struct btrfs_fs_info *)arg;
        int again;
 
        while (1) {
 
                btrfs_run_delayed_iputs(fs_info);
 
-               again = btrfs_clean_one_deleted_snapshot(root);
+               again = btrfs_clean_one_deleted_snapshot(fs_info);
                mutex_unlock(&fs_info->cleaner_mutex);
 
                /*
                goto fail_sysfs;
        }
 
-       fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root,
+       fs_info->cleaner_kthread = kthread_run(cleaner_kthread, fs_info,
                                               "btrfs-cleaner");
        if (IS_ERR(fs_info->cleaner_kthread))
                goto fail_sysfs;
 
  * because btrfs_commit_super will poke cleaner thread and it will process it a
  * few seconds later.
  */
-int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root)
+int btrfs_clean_one_deleted_snapshot(struct btrfs_fs_info *fs_info)
 {
+       struct btrfs_root *root;
        int ret;
-       struct btrfs_fs_info *fs_info = root->fs_info;
 
        spin_lock(&fs_info->trans_lock);
        if (list_empty(&fs_info->dead_roots)) {
 
 void btrfs_add_dead_root(struct btrfs_root *root);
 int btrfs_defrag_root(struct btrfs_root *root);
 void btrfs_maybe_wake_unfinished_drop(struct btrfs_fs_info *fs_info);
-int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root);
+int btrfs_clean_one_deleted_snapshot(struct btrfs_fs_info *fs_info);
 int btrfs_commit_transaction(struct btrfs_trans_handle *trans);
 void btrfs_commit_transaction_async(struct btrfs_trans_handle *trans);
 int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans);