Lines Matching refs:async_extent
318 struct async_extent { struct
345 struct async_extent *async_extent; in add_async_extent() argument
347 async_extent = kmalloc(sizeof(*async_extent), GFP_NOFS); in add_async_extent()
348 BUG_ON(!async_extent); /* -ENOMEM */ in add_async_extent()
349 async_extent->start = start; in add_async_extent()
350 async_extent->ram_size = ram_size; in add_async_extent()
351 async_extent->compressed_size = compressed_size; in add_async_extent()
352 async_extent->pages = pages; in add_async_extent()
353 async_extent->nr_pages = nr_pages; in add_async_extent()
354 async_extent->compress_type = compress_type; in add_async_extent()
355 list_add_tail(&async_extent->list, &cow->extents); in add_async_extent()
645 static void free_async_extent_pages(struct async_extent *async_extent) in free_async_extent_pages() argument
649 if (!async_extent->pages) in free_async_extent_pages()
652 for (i = 0; i < async_extent->nr_pages; i++) { in free_async_extent_pages()
653 WARN_ON(async_extent->pages[i]->mapping); in free_async_extent_pages()
654 page_cache_release(async_extent->pages[i]); in free_async_extent_pages()
656 kfree(async_extent->pages); in free_async_extent_pages()
657 async_extent->nr_pages = 0; in free_async_extent_pages()
658 async_extent->pages = NULL; in free_async_extent_pages()
670 struct async_extent *async_extent; in submit_compressed_extents() local
681 async_extent = list_entry(async_cow->extents.next, in submit_compressed_extents()
682 struct async_extent, list); in submit_compressed_extents()
683 list_del(&async_extent->list); in submit_compressed_extents()
689 if (!async_extent->pages) { in submit_compressed_extents()
693 lock_extent(io_tree, async_extent->start, in submit_compressed_extents()
694 async_extent->start + in submit_compressed_extents()
695 async_extent->ram_size - 1); in submit_compressed_extents()
699 async_extent->start, in submit_compressed_extents()
700 async_extent->start + in submit_compressed_extents()
701 async_extent->ram_size - 1, in submit_compressed_extents()
714 inode, async_extent->start, in submit_compressed_extents()
715 async_extent->start + in submit_compressed_extents()
716 async_extent->ram_size - 1, in submit_compressed_extents()
721 kfree(async_extent); in submit_compressed_extents()
726 lock_extent(io_tree, async_extent->start, in submit_compressed_extents()
727 async_extent->start + async_extent->ram_size - 1); in submit_compressed_extents()
730 async_extent->compressed_size, in submit_compressed_extents()
731 async_extent->compressed_size, in submit_compressed_extents()
734 free_async_extent_pages(async_extent); in submit_compressed_extents()
737 unlock_extent(io_tree, async_extent->start, in submit_compressed_extents()
738 async_extent->start + in submit_compressed_extents()
739 async_extent->ram_size - 1); in submit_compressed_extents()
748 async_extent->start, in submit_compressed_extents()
749 async_extent->start + in submit_compressed_extents()
750 async_extent->ram_size - 1); in submit_compressed_extents()
760 btrfs_drop_extent_cache(inode, async_extent->start, in submit_compressed_extents()
761 async_extent->start + in submit_compressed_extents()
762 async_extent->ram_size - 1, 0); in submit_compressed_extents()
769 em->start = async_extent->start; in submit_compressed_extents()
770 em->len = async_extent->ram_size; in submit_compressed_extents()
778 em->ram_bytes = async_extent->ram_size; in submit_compressed_extents()
780 em->compress_type = async_extent->compress_type; in submit_compressed_extents()
793 btrfs_drop_extent_cache(inode, async_extent->start, in submit_compressed_extents()
794 async_extent->start + in submit_compressed_extents()
795 async_extent->ram_size - 1, 0); in submit_compressed_extents()
802 async_extent->start, in submit_compressed_extents()
804 async_extent->ram_size, in submit_compressed_extents()
807 async_extent->compress_type); in submit_compressed_extents()
809 btrfs_drop_extent_cache(inode, async_extent->start, in submit_compressed_extents()
810 async_extent->start + in submit_compressed_extents()
811 async_extent->ram_size - 1, 0); in submit_compressed_extents()
818 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
819 async_extent->start + in submit_compressed_extents()
820 async_extent->ram_size - 1, in submit_compressed_extents()
825 async_extent->start, in submit_compressed_extents()
826 async_extent->ram_size, in submit_compressed_extents()
828 ins.offset, async_extent->pages, in submit_compressed_extents()
829 async_extent->nr_pages); in submit_compressed_extents()
832 struct page *p = async_extent->pages[0]; in submit_compressed_extents()
833 const u64 start = async_extent->start; in submit_compressed_extents()
834 const u64 end = start + async_extent->ram_size - 1; in submit_compressed_extents()
843 free_async_extent_pages(async_extent); in submit_compressed_extents()
846 kfree(async_extent); in submit_compressed_extents()
853 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
854 async_extent->start + in submit_compressed_extents()
855 async_extent->ram_size - 1, in submit_compressed_extents()
861 free_async_extent_pages(async_extent); in submit_compressed_extents()
862 kfree(async_extent); in submit_compressed_extents()