public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 3/7] btrfs: add generic workspace manager initialization
Date: Mon, 18 Aug 2025 17:12:58 +0200	[thread overview]
Message-ID: <20250818151258.GM22430@twin.jikos.cz> (raw)
In-Reply-To: <d388ffd7cff17a0e6e62b7d24d218ec198efa010.1755148754.git.wqu@suse.com>

On Thu, Aug 14, 2025 at 03:03:22PM +0930, Qu Wenruo wrote:
> This involves:
> 
> - Add generic_(alloc|free)_workspace_manager helpers.
>   These are the helper to alloc/free workspace_manager structure, which
>   will allocate a workspace_manager structure, initialize it, and
>   pre-allocate one workspace for it.
> 
> - Call generic_alloc_workspace_manager() inside
>   btrfs_alloc_compress_wsm()
>   For none, zlib and lzo compression algorithms.
> 
> - Call generic_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>
> ---
>  fs/btrfs/compression.c | 66 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 66 insertions(+)
> 
> diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
> index 0ee8a17abc30..8a7b2b802ddd 100644
> --- a/fs/btrfs/compression.c
> +++ b/fs/btrfs/compression.c
> @@ -773,6 +773,40 @@ static void free_workspace(int type, struct list_head *ws)
>  	}
>  }
>  
> +static int generic_alloc_workspace_manager(struct btrfs_fs_info *fs_info,
> +					   enum btrfs_compression_type type)

The helpers are static so you may drop the "generic_" prefix, we have
other unprefixed helpers like alloc_workspace etc.

  reply	other threads:[~2025-08-18 15:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14  5:33 [PATCH 0/7] btrfs: per-fs compression workspace manager Qu Wenruo
2025-08-14  5:33 ` [PATCH 1/7] btrfs: add an fs_info parameter for " Qu Wenruo
2025-08-14  5:33 ` [PATCH 2/7] btrfs: add workspace manager initialization for zstd Qu Wenruo
2025-08-18 15:08   ` David Sterba
2025-08-18 22:14     ` Qu Wenruo
2025-08-14  5:33 ` [PATCH 3/7] btrfs: add generic workspace manager initialization Qu Wenruo
2025-08-18 15:12   ` David Sterba [this message]
2025-08-14  5:33 ` [PATCH 4/7] btrfs: migrate to use per-fs workspace manager Qu Wenruo
2025-08-14  5:33 ` [PATCH 5/7] btrfs: cleanup the per-module workspace managers Qu Wenruo
2025-08-14  5:33 ` [PATCH 6/7] btrfs: rename btrfs_compress_op to btrfs_compress_levels Qu Wenruo
2025-08-14  5:33 ` [PATCH 7/7] btrfs: reduce workspace buffer space to block size Qu Wenruo
2025-08-18 15:13 ` [PATCH 0/7] btrfs: per-fs compression workspace manager David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250818151258.GM22430@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox