Lines Matching refs:async_chunk

367 struct async_chunk {  struct
382 struct async_chunk chunks[]; argument
385 static noinline int add_async_extent(struct async_chunk *cow, in add_async_extent()
474 static noinline int compress_file_range(struct async_chunk *async_chunk) in compress_file_range() argument
476 struct inode *inode = async_chunk->inode; in compress_file_range()
479 u64 start = async_chunk->start; in compress_file_range()
480 u64 end = async_chunk->end; in compress_file_range()
688 add_async_extent(async_chunk, start, total_in, in compress_file_range()
728 if (async_chunk->locked_page && in compress_file_range()
729 (page_offset(async_chunk->locked_page) >= start && in compress_file_range()
730 page_offset(async_chunk->locked_page)) <= end) { in compress_file_range()
731 __set_page_dirty_nobuffers(async_chunk->locked_page); in compress_file_range()
737 add_async_extent(async_chunk, start, end - start + 1, 0, NULL, 0, in compress_file_range()
766 static noinline void submit_compressed_extents(struct async_chunk *async_chunk) in submit_compressed_extents() argument
768 struct btrfs_inode *inode = BTRFS_I(async_chunk->inode); in submit_compressed_extents()
779 while (!list_empty(&async_chunk->extents)) { in submit_compressed_extents()
780 async_extent = list_entry(async_chunk->extents.next, in submit_compressed_extents()
793 ret = cow_file_range(inode, async_chunk->locked_page, in submit_compressed_extents()
813 else if (ret && async_chunk->locked_page) in submit_compressed_extents()
814 unlock_page(async_chunk->locked_page); in submit_compressed_extents()
894 async_chunk->write_flags, in submit_compressed_extents()
895 async_chunk->blkcg_css)) { in submit_compressed_extents()
1180 struct async_chunk *async_chunk; in async_cow_start() local
1183 async_chunk = container_of(work, struct async_chunk, work); in async_cow_start()
1185 compressed_extents = compress_file_range(async_chunk); in async_cow_start()
1187 btrfs_add_delayed_iput(async_chunk->inode); in async_cow_start()
1188 async_chunk->inode = NULL; in async_cow_start()
1197 struct async_chunk *async_chunk = container_of(work, struct async_chunk, in async_cow_submit() local
1202 nr_pages = (async_chunk->end - async_chunk->start + PAGE_SIZE) >> in async_cow_submit()
1216 if (async_chunk->inode) in async_cow_submit()
1217 submit_compressed_extents(async_chunk); in async_cow_submit()
1222 struct async_chunk *async_chunk; in async_cow_free() local
1224 async_chunk = container_of(work, struct async_chunk, work); in async_cow_free()
1225 if (async_chunk->inode) in async_cow_free()
1226 btrfs_add_delayed_iput(async_chunk->inode); in async_cow_free()
1227 if (async_chunk->blkcg_css) in async_cow_free()
1228 css_put(async_chunk->blkcg_css); in async_cow_free()
1233 if (atomic_dec_and_test(async_chunk->pending)) in async_cow_free()
1234 kvfree(async_chunk->pending); in async_cow_free()
1246 struct async_chunk *async_chunk; in cow_file_range_async() local
1282 async_chunk = ctx->chunks; in cow_file_range_async()
1296 async_chunk[i].pending = &ctx->num_chunks; in cow_file_range_async()
1297 async_chunk[i].inode = &inode->vfs_inode; in cow_file_range_async()
1298 async_chunk[i].start = start; in cow_file_range_async()
1299 async_chunk[i].end = cur_end; in cow_file_range_async()
1300 async_chunk[i].write_flags = write_flags; in cow_file_range_async()
1301 INIT_LIST_HEAD(&async_chunk[i].extents); in cow_file_range_async()
1324 async_chunk[i].locked_page = locked_page; in cow_file_range_async()
1327 async_chunk[i].locked_page = NULL; in cow_file_range_async()
1332 async_chunk[i].blkcg_css = blkcg_css; in cow_file_range_async()
1334 async_chunk[i].blkcg_css = NULL; in cow_file_range_async()
1337 btrfs_init_work(&async_chunk[i].work, async_cow_start, in cow_file_range_async()
1343 btrfs_queue_work(fs_info->delalloc_workers, &async_chunk[i].work); in cow_file_range_async()