Lines Matching refs:async_chunk

367 struct async_chunk {
382 struct async_chunk chunks[];
385 static noinline int add_async_extent(struct async_chunk *cow,
474 static noinline int compress_file_range(struct async_chunk *async_chunk)
476 struct inode *inode = async_chunk->inode;
479 u64 start = async_chunk->start;
480 u64 end = async_chunk->end;
688 add_async_extent(async_chunk, start, total_in,
728 if (async_chunk->locked_page &&
729 (page_offset(async_chunk->locked_page) >= start &&
730 page_offset(async_chunk->locked_page)) <= end) {
731 __set_page_dirty_nobuffers(async_chunk->locked_page);
737 add_async_extent(async_chunk, start, end - start + 1, 0, NULL, 0,
766 static noinline void submit_compressed_extents(struct async_chunk *async_chunk)
768 struct btrfs_inode *inode = BTRFS_I(async_chunk->inode);
779 while (!list_empty(&async_chunk->extents)) {
780 async_extent = list_entry(async_chunk->extents.next,
793 ret = cow_file_range(inode, async_chunk->locked_page,
813 else if (ret && async_chunk->locked_page)
814 unlock_page(async_chunk->locked_page);
894 async_chunk->write_flags,
895 async_chunk->blkcg_css)) {
1179 struct async_chunk *async_chunk;
1182 async_chunk = container_of(work, struct async_chunk, work);
1184 compressed_extents = compress_file_range(async_chunk);
1186 btrfs_add_delayed_iput(async_chunk->inode);
1187 async_chunk->inode = NULL;
1196 struct async_chunk *async_chunk = container_of(work, struct async_chunk,
1201 nr_pages = (async_chunk->end - async_chunk->start + PAGE_SIZE) >>
1210 if (async_chunk->inode)
1211 submit_compressed_extents(async_chunk);
1221 struct async_chunk *async_chunk;
1223 async_chunk = container_of(work, struct async_chunk, work);
1224 if (async_chunk->inode)
1225 btrfs_add_delayed_iput(async_chunk->inode);
1226 if (async_chunk->blkcg_css)
1227 css_put(async_chunk->blkcg_css);
1230 * async_chunk's, freeing it ensures the whole array has been freed.
1232 if (atomic_dec_and_test(async_chunk->pending))
1233 kvfree(async_chunk->pending);
1245 struct async_chunk *async_chunk;
1281 async_chunk = ctx->chunks;
1295 async_chunk[i].pending = &ctx->num_chunks;
1296 async_chunk[i].inode = &inode->vfs_inode;
1297 async_chunk[i].start = start;
1298 async_chunk[i].end = cur_end;
1299 async_chunk[i].write_flags = write_flags;
1300 INIT_LIST_HEAD(&async_chunk[i].extents);
1305 * this large delalloc region across multiple async_chunk
1323 async_chunk[i].locked_page = locked_page;
1326 async_chunk[i].locked_page = NULL;
1331 async_chunk[i].blkcg_css = blkcg_css;
1333 async_chunk[i].blkcg_css = NULL;
1336 btrfs_init_work(&async_chunk[i].work, async_cow_start,
1342 btrfs_queue_work(fs_info->delalloc_workers, &async_chunk[i].work);