All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 15/15] btrfs: compression: remove ops pointer from workspace_manager
Date: Mon, 14 Oct 2019 14:22:57 +0200	[thread overview]
Message-ID: <7fe1018a3a18485a0d3eeab1be89fd84603e46ea.1571054758.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1571054758.git.dsterba@suse.com>

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.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/compression.c | 6 ++----
 fs/btrfs/compression.h | 1 -
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index b2342f99b093..53aee0db9d71 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -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);
diff --git a/fs/btrfs/compression.h b/fs/btrfs/compression.h
index 14057498dcbb..d253f7aa8ed5 100644
--- a/fs/btrfs/compression.h
+++ b/fs/btrfs/compression.h
@@ -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 */
-- 
2.23.0


  parent reply	other threads:[~2019-10-14 12:22 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 12:22 [PATCH 00/15] Remove callback indirections in compression code David Sterba
2019-10-14 12:22 ` [PATCH 01/15] btrfs: export compression and decompression callbacks David Sterba
2019-10-17  9:39   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 02/15] btrfs: switch compression callbacks to direct calls David Sterba
2019-10-17  9:42   ` Johannes Thumshirn
2019-10-17 11:24     ` David Sterba
2019-10-14 12:22 ` [PATCH 03/15] btrfs: compression: attach workspace manager to the ops David Sterba
2019-10-17 11:08   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 04/15] btrfs: compression: let workspace manager init take only the type David Sterba
2019-10-17 11:03   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 05/15] btrfs: compression: inline init_workspace_manager David Sterba
2019-10-17 11:06   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 06/15] btrfs: compression: let workspace manager cleanup take only the type David Sterba
2019-10-17 11:10   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 07/15] btrfs: compression: inline cleanup_workspace_manager David Sterba
2019-10-17 11:31   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 08/15] btrfs: compression: export alloc/free/get/put callbacks of all algos David Sterba
2019-10-17 11:44   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 09/15] btrfs: compression: inline get_workspace David Sterba
2019-10-17 11:46   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 10/15] btrfs: compression: inline put_workspace David Sterba
2019-10-17 11:49   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 11/15] btrfs: compression: pass type to btrfs_get_workspace David Sterba
2019-10-17 11:53   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 12/15] btrfs: compression: inline alloc_workspace David Sterba
2019-10-17 11:56   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 13/15] btrfs: compression: pass type to btrfs_put_workspace David Sterba
2019-10-17 11:57   ` Johannes Thumshirn
2019-10-14 12:22 ` [PATCH 14/15] btrfs: compression: inline free_workspace David Sterba
2019-10-17 11:58   ` Johannes Thumshirn
2019-10-14 12:22 ` David Sterba [this message]
2019-10-17 11:59   ` [PATCH 15/15] btrfs: compression: remove ops pointer from workspace_manager Johannes Thumshirn
2019-10-17 15:02 ` [PATCH 00/15] Remove callback indirections in compression code Nikolay Borisov
2019-10-17 18:19 ` 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=7fe1018a3a18485a0d3eeab1be89fd84603e46ea.1571054758.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.