Lines Matching refs:pending_snapshot
797 struct btrfs_pending_snapshot *pending_snapshot;
813 pending_snapshot = kzalloc(sizeof(*pending_snapshot), GFP_KERNEL);
814 if (!pending_snapshot)
817 ret = get_anon_bdev(&pending_snapshot->anon_dev);
820 pending_snapshot->root_item = kzalloc(sizeof(struct btrfs_root_item),
822 pending_snapshot->path = btrfs_alloc_path();
823 if (!pending_snapshot->root_item || !pending_snapshot->path) {
828 btrfs_init_block_rsv(&pending_snapshot->block_rsv,
839 &pending_snapshot->block_rsv, 8,
844 pending_snapshot->dentry = dentry;
845 pending_snapshot->root = root;
846 pending_snapshot->readonly = readonly;
847 pending_snapshot->dir = dir;
848 pending_snapshot->inherit = inherit;
857 list_add(&pending_snapshot->list,
865 ret = pending_snapshot->error;
869 ret = btrfs_orphan_cleanup(pending_snapshot->snap);
881 pending_snapshot->anon_dev = 0;
884 if (ret && pending_snapshot->snap)
885 pending_snapshot->snap->anon_dev = 0;
886 btrfs_put_root(pending_snapshot->snap);
887 btrfs_subvolume_release_metadata(root, &pending_snapshot->block_rsv);
889 if (pending_snapshot->anon_dev)
890 free_anon_bdev(pending_snapshot->anon_dev);
891 kfree(pending_snapshot->root_item);
892 btrfs_free_path(pending_snapshot->path);
893 kfree(pending_snapshot);