Lines Matching refs:async_extent

357 struct async_extent {  struct
392 struct async_extent *async_extent; in add_async_extent() local
394 async_extent = kmalloc(sizeof(*async_extent), GFP_NOFS); in add_async_extent()
395 BUG_ON(!async_extent); /* -ENOMEM */ in add_async_extent()
396 async_extent->start = start; in add_async_extent()
397 async_extent->ram_size = ram_size; in add_async_extent()
398 async_extent->compressed_size = compressed_size; in add_async_extent()
399 async_extent->pages = pages; in add_async_extent()
400 async_extent->nr_pages = nr_pages; in add_async_extent()
401 async_extent->compress_type = compress_type; in add_async_extent()
402 list_add_tail(&async_extent->list, &cow->extents); in add_async_extent()
744 static void free_async_extent_pages(struct async_extent *async_extent) in free_async_extent_pages() argument
748 if (!async_extent->pages) in free_async_extent_pages()
751 for (i = 0; i < async_extent->nr_pages; i++) { in free_async_extent_pages()
752 WARN_ON(async_extent->pages[i]->mapping); in free_async_extent_pages()
753 put_page(async_extent->pages[i]); in free_async_extent_pages()
755 kfree(async_extent->pages); in free_async_extent_pages()
756 async_extent->nr_pages = 0; in free_async_extent_pages()
757 async_extent->pages = NULL; in free_async_extent_pages()
770 struct async_extent *async_extent; in submit_compressed_extents() local
780 async_extent = list_entry(async_chunk->extents.next, in submit_compressed_extents()
781 struct async_extent, list); in submit_compressed_extents()
782 list_del(&async_extent->list); in submit_compressed_extents()
785 lock_extent(io_tree, async_extent->start, in submit_compressed_extents()
786 async_extent->start + async_extent->ram_size - 1); in submit_compressed_extents()
788 if (!async_extent->pages) { in submit_compressed_extents()
794 async_extent->start, in submit_compressed_extents()
795 async_extent->start + in submit_compressed_extents()
796 async_extent->ram_size - 1, in submit_compressed_extents()
809 async_extent->start, in submit_compressed_extents()
810 async_extent->start + in submit_compressed_extents()
811 async_extent->ram_size - 1, in submit_compressed_extents()
815 kfree(async_extent); in submit_compressed_extents()
820 ret = btrfs_reserve_extent(root, async_extent->ram_size, in submit_compressed_extents()
821 async_extent->compressed_size, in submit_compressed_extents()
822 async_extent->compressed_size, in submit_compressed_extents()
825 free_async_extent_pages(async_extent); in submit_compressed_extents()
828 unlock_extent(io_tree, async_extent->start, in submit_compressed_extents()
829 async_extent->start + in submit_compressed_extents()
830 async_extent->ram_size - 1); in submit_compressed_extents()
839 async_extent->start, in submit_compressed_extents()
840 async_extent->start + in submit_compressed_extents()
841 async_extent->ram_size - 1); in submit_compressed_extents()
851 em = create_io_em(inode, async_extent->start, in submit_compressed_extents()
852 async_extent->ram_size, /* len */ in submit_compressed_extents()
853 async_extent->start, /* orig_start */ in submit_compressed_extents()
857 async_extent->ram_size, /* ram_bytes */ in submit_compressed_extents()
858 async_extent->compress_type, in submit_compressed_extents()
866 async_extent->start, in submit_compressed_extents()
868 async_extent->ram_size, in submit_compressed_extents()
871 async_extent->compress_type); in submit_compressed_extents()
873 btrfs_drop_extent_cache(inode, async_extent->start, in submit_compressed_extents()
874 async_extent->start + in submit_compressed_extents()
875 async_extent->ram_size - 1, 0); in submit_compressed_extents()
883 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
884 async_extent->start + in submit_compressed_extents()
885 async_extent->ram_size - 1, in submit_compressed_extents()
889 if (btrfs_submit_compressed_write(inode, async_extent->start, in submit_compressed_extents()
890 async_extent->ram_size, in submit_compressed_extents()
892 ins.offset, async_extent->pages, in submit_compressed_extents()
893 async_extent->nr_pages, in submit_compressed_extents()
896 struct page *p = async_extent->pages[0]; in submit_compressed_extents()
897 const u64 start = async_extent->start; in submit_compressed_extents()
898 const u64 end = start + async_extent->ram_size - 1; in submit_compressed_extents()
907 free_async_extent_pages(async_extent); in submit_compressed_extents()
910 kfree(async_extent); in submit_compressed_extents()
918 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
919 async_extent->start + in submit_compressed_extents()
920 async_extent->ram_size - 1, in submit_compressed_extents()
927 free_async_extent_pages(async_extent); in submit_compressed_extents()
928 kfree(async_extent); in submit_compressed_extents()