]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: add generic workspace manager initialization
authorQu Wenruo <wqu@suse.com>
Wed, 13 Aug 2025 07:06:57 +0000 (16:36 +0930)
committerDavid Sterba <dsterba@suse.com>
Tue, 23 Sep 2025 06:49:15 +0000 (08:49 +0200)
commit6f9c3f48acffaffe7bb643b3bc04f8a99021179a
treefd8468dddbb574c7eebd6e58a7e3391567be66e8
parent330f02b136a8c2e025548683c265fc2be844614c
btrfs: add generic workspace manager initialization

This involves:

- Add (alloc|free)_workspace_manager helpers.
  These are the helper to alloc/free workspace_manager structure.

  The allocator will allocate a workspace_manager structure, initialize
  it, and pre-allocate one workspace for it.

  The freer will do the cleanup and set the manager pointer to NULL.

- Call alloc_workspace_manager() inside btrfs_alloc_compress_wsm()
- Call alloc_workspace_manager() inside btrfs_free_compress_wsm()
  For none, zlib and lzo compression algorithms.

For now the generic per-fs workspace managers won't really have any effect,
and all compression is still going through the global workspace manager.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c