Lines Matching refs:async_extent

354 struct async_extent {  struct
388 struct async_extent *async_extent; in add_async_extent() local
390 async_extent = kmalloc(sizeof(*async_extent), GFP_NOFS); in add_async_extent()
391 BUG_ON(!async_extent); /* -ENOMEM */ in add_async_extent()
392 async_extent->start = start; in add_async_extent()
393 async_extent->ram_size = ram_size; in add_async_extent()
394 async_extent->compressed_size = compressed_size; in add_async_extent()
395 async_extent->pages = pages; in add_async_extent()
396 async_extent->nr_pages = nr_pages; in add_async_extent()
397 async_extent->compress_type = compress_type; in add_async_extent()
398 list_add_tail(&async_extent->list, &cow->extents); in add_async_extent()
729 static void free_async_extent_pages(struct async_extent *async_extent) in free_async_extent_pages() argument
733 if (!async_extent->pages) in free_async_extent_pages()
736 for (i = 0; i < async_extent->nr_pages; i++) { in free_async_extent_pages()
737 WARN_ON(async_extent->pages[i]->mapping); in free_async_extent_pages()
738 put_page(async_extent->pages[i]); in free_async_extent_pages()
740 kfree(async_extent->pages); in free_async_extent_pages()
741 async_extent->nr_pages = 0; in free_async_extent_pages()
742 async_extent->pages = NULL; in free_async_extent_pages()
755 struct async_extent *async_extent; in submit_compressed_extents() local
765 async_extent = list_entry(async_chunk->extents.next, in submit_compressed_extents()
766 struct async_extent, list); in submit_compressed_extents()
767 list_del(&async_extent->list); in submit_compressed_extents()
770 lock_extent(io_tree, async_extent->start, in submit_compressed_extents()
771 async_extent->start + async_extent->ram_size - 1); in submit_compressed_extents()
773 if (!async_extent->pages) { in submit_compressed_extents()
779 async_extent->start, in submit_compressed_extents()
780 async_extent->start + in submit_compressed_extents()
781 async_extent->ram_size - 1, 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()
800 kfree(async_extent); in submit_compressed_extents()
805 ret = btrfs_reserve_extent(root, async_extent->ram_size, in submit_compressed_extents()
806 async_extent->compressed_size, in submit_compressed_extents()
807 async_extent->compressed_size, in submit_compressed_extents()
810 free_async_extent_pages(async_extent); in submit_compressed_extents()
813 unlock_extent(io_tree, async_extent->start, in submit_compressed_extents()
814 async_extent->start + in submit_compressed_extents()
815 async_extent->ram_size - 1); in submit_compressed_extents()
824 async_extent->start, in submit_compressed_extents()
825 async_extent->start + in submit_compressed_extents()
826 async_extent->ram_size - 1); in submit_compressed_extents()
836 em = create_io_em(inode, async_extent->start, in submit_compressed_extents()
837 async_extent->ram_size, /* len */ in submit_compressed_extents()
838 async_extent->start, /* orig_start */ in submit_compressed_extents()
842 async_extent->ram_size, /* ram_bytes */ in submit_compressed_extents()
843 async_extent->compress_type, in submit_compressed_extents()
851 async_extent->start, in submit_compressed_extents()
853 async_extent->ram_size, in submit_compressed_extents()
856 async_extent->compress_type); in submit_compressed_extents()
859 async_extent->start, in submit_compressed_extents()
860 async_extent->start + in submit_compressed_extents()
861 async_extent->ram_size - 1, 0); in submit_compressed_extents()
869 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
870 async_extent->start + in submit_compressed_extents()
871 async_extent->ram_size - 1, in submit_compressed_extents()
876 async_extent->start, in submit_compressed_extents()
877 async_extent->ram_size, in submit_compressed_extents()
879 ins.offset, async_extent->pages, in submit_compressed_extents()
880 async_extent->nr_pages, in submit_compressed_extents()
882 struct page *p = async_extent->pages[0]; in submit_compressed_extents()
883 const u64 start = async_extent->start; in submit_compressed_extents()
884 const u64 end = start + async_extent->ram_size - 1; in submit_compressed_extents()
894 free_async_extent_pages(async_extent); in submit_compressed_extents()
897 kfree(async_extent); in submit_compressed_extents()
905 extent_clear_unlock_delalloc(inode, async_extent->start, in submit_compressed_extents()
906 async_extent->start + in submit_compressed_extents()
907 async_extent->ram_size - 1, in submit_compressed_extents()
914 free_async_extent_pages(async_extent); in submit_compressed_extents()
915 kfree(async_extent); in submit_compressed_extents()