Lines Matching refs:workspace
58 struct workspace { struct
69 struct workspace *workspace = list_entry(ws, struct workspace, list); in lzo_free_workspace() argument
71 kvfree(workspace->buf); in lzo_free_workspace()
72 kvfree(workspace->cbuf); in lzo_free_workspace()
73 kvfree(workspace->mem); in lzo_free_workspace()
74 kfree(workspace); in lzo_free_workspace()
79 struct workspace *workspace; in lzo_alloc_workspace() local
81 workspace = kzalloc(sizeof(*workspace), GFP_KERNEL); in lzo_alloc_workspace()
82 if (!workspace) in lzo_alloc_workspace()
85 workspace->mem = kvmalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL); in lzo_alloc_workspace()
86 workspace->buf = kvmalloc(lzo1x_worst_compress(PAGE_SIZE), GFP_KERNEL); in lzo_alloc_workspace()
87 workspace->cbuf = kvmalloc(lzo1x_worst_compress(PAGE_SIZE), GFP_KERNEL); in lzo_alloc_workspace()
88 if (!workspace->mem || !workspace->buf || !workspace->cbuf) in lzo_alloc_workspace()
91 INIT_LIST_HEAD(&workspace->list); in lzo_alloc_workspace()
93 return &workspace->list; in lzo_alloc_workspace()
95 lzo_free_workspace(&workspace->list); in lzo_alloc_workspace()
210 struct workspace *workspace = list_entry(ws, struct workspace, list); in lzo_compress_pages() local
251 workspace->cbuf, &out_len, in lzo_compress_pages()
252 workspace->mem); in lzo_compress_pages()
260 ret = copy_compressed_data_to_page(workspace->cbuf, out_len, in lzo_compress_pages()
330 struct workspace *workspace = list_entry(ws, struct workspace, list); in lzo_decompress_bio() local
384 copy_compressed_segment(cb, workspace->cbuf, seg_len, &cur_in); in lzo_decompress_bio()
387 ret = lzo1x_decompress_safe(workspace->cbuf, seg_len, in lzo_decompress_bio()
388 workspace->buf, &out_len); in lzo_decompress_bio()
396 ret = btrfs_decompress_buf2page(workspace->buf, out_len, cb, cur_out); in lzo_decompress_bio()
422 struct workspace *workspace = list_entry(ws, struct workspace, list); in lzo_decompress() local
446 ret = lzo1x_decompress_safe(data_in, in_len, workspace->buf, &out_len); in lzo_decompress()
466 memcpy(kaddr, workspace->buf + start_byte, bytes); in lzo_decompress()