btrfs: compression: let workspace manager init take only the type

With the access to the workspace structures, we can look it up together
with the compression ops inside the workspace manager init helper.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba
2019-10-04 01:40:58 +02:00
parent be95104531
commit 975db48330
4 changed files with 7 additions and 7 deletions

View File

@@ -862,7 +862,7 @@ static struct workspace_manager heuristic_wsm;
static void heuristic_init_workspace_manager(void)
{
btrfs_init_workspace_manager(&heuristic_wsm, &btrfs_heuristic_compress);
btrfs_init_workspace_manager(BTRFS_COMPRESS_NONE);
}
static void heuristic_cleanup_workspace_manager(void)
@@ -937,9 +937,10 @@ static const struct btrfs_compress_op * const btrfs_compress_op[] = {
&btrfs_zstd_compress,
};
void btrfs_init_workspace_manager(struct workspace_manager *wsm,
const struct btrfs_compress_op *ops)
void btrfs_init_workspace_manager(int type)
{
const struct btrfs_compress_op *ops = btrfs_compress_op[type];
struct workspace_manager *wsm = ops->workspace_manager;
struct list_head *workspace;
wsm->ops = ops;