]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: compression: remove ops pointer from workspace_manager
authorDavid Sterba <dsterba@suse.com>
Fri, 4 Oct 2019 01:09:55 +0000 (03:09 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 11:46:59 +0000 (12:46 +0100)
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: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/compression.c
fs/btrfs/compression.h

index b2342f99b093e3652d65959b0b9f39c8fbae261a..53aee0db9d7135e949765d45185fb3fb9457280d 100644 (file)
@@ -956,12 +956,10 @@ static void free_workspace(int type, struct list_head *ws)
 
 static 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 workspace_manager *wsm;
        struct list_head *workspace;
 
-       wsm->ops = ops;
-
+       wsm = btrfs_compress_op[type]->workspace_manager;
        INIT_LIST_HEAD(&wsm->idle_ws);
        spin_lock_init(&wsm->ws_lock);
        atomic_set(&wsm->total_ws, 0);
index 14057498dcbb4c01a1cd5ef633d1b5f0e6c5cb5e..d253f7aa8ed5f7a0bb690684c8eeb2ac423829c0 100644 (file)
@@ -109,7 +109,6 @@ enum btrfs_compression_type {
 };
 
 struct workspace_manager {
-       const struct btrfs_compress_op *ops;
        struct list_head idle_ws;
        spinlock_t ws_lock;
        /* Number of free workspaces */