Commit 0cf25213 authored by David Sterba's avatar David Sterba

btrfs: compression: remove ops pointer from workspace_manager

We can infer the ops from the type that is now passed to all functions
that would need it, this makes workspace_manager::ops redundant and can
be removed.
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1e002351
...@@ -956,12 +956,10 @@ static void free_workspace(int type, struct list_head *ws) ...@@ -956,12 +956,10 @@ static void free_workspace(int type, struct list_head *ws)
static void btrfs_init_workspace_manager(int type) static void btrfs_init_workspace_manager(int type)
{ {
const struct btrfs_compress_op *ops = btrfs_compress_op[type]; struct workspace_manager *wsm;
struct workspace_manager *wsm = ops->workspace_manager;
struct list_head *workspace; struct list_head *workspace;
wsm->ops = ops; wsm = btrfs_compress_op[type]->workspace_manager;
INIT_LIST_HEAD(&wsm->idle_ws); INIT_LIST_HEAD(&wsm->idle_ws);
spin_lock_init(&wsm->ws_lock); spin_lock_init(&wsm->ws_lock);
atomic_set(&wsm->total_ws, 0); atomic_set(&wsm->total_ws, 0);
......
...@@ -109,7 +109,6 @@ enum btrfs_compression_type { ...@@ -109,7 +109,6 @@ enum btrfs_compression_type {
}; };
struct workspace_manager { struct workspace_manager {
const struct btrfs_compress_op *ops;
struct list_head idle_ws; struct list_head idle_ws;
spinlock_t ws_lock; spinlock_t ws_lock;
/* Number of free workspaces */ /* Number of free workspaces */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment