On 28.01.19 г. 23:24 ч., Dennis Zhou wrote: > The previous patch added generic helpers for get_workspace() and > put_workspace(). Now, we can migrate ownership of the workspace_manager > to be in the compression type code as the compression code itself > doesn't care beyond being able to get a workspace. The init/cleanup > and get/put methods are abstracted so each compression algorithm can > decide how they want to manage their workspaces. > > Signed-off-by: Dennis Zhou <den...@kernel.org> TBH I can't really see the value in this patch. IMO it doesn't make the code more readable, on the contrary, you create algorithm-specific wrappers over the generic function, where the sole specialization is in the arguments passed to the generic functions. You introduce 4 more function pointers and this affects performance negatively (albeit can't say to what extent) due to spectre mitigations (retpolines). I also read the follow up patches with the hopes of seeing how the code becomes cleaner to no avail. At this point I'm really not in favor of this particular patch.
- [PATCH 09/11] btrfs: change set_level() to bound the level... Dennis Zhou
- Re: [PATCH 09/11] btrfs: change set_level() to bound ... Nikolay Borisov
- [PATCH 10/11] btrfs: zstd use the passed through level ins... Dennis Zhou
- Re: [PATCH 10/11] btrfs: zstd use the passed through ... Nikolay Borisov
- [PATCH 08/11] btrfs: plumb level through the compression i... Dennis Zhou
- Re: [PATCH 08/11] btrfs: plumb level through the comp... Nikolay Borisov
- Re: [PATCH 08/11] btrfs: plumb level through the comp... Josef Bacik
- [PATCH 06/11] btrfs: add compression interface in (get/put... Dennis Zhou
- [PATCH 07/11] btrfs: move to fn pointers for get/put works... Dennis Zhou
- Re: [PATCH 07/11] btrfs: move to fn pointers for get/... Nikolay Borisov
- Re: [PATCH 07/11] btrfs: move to fn pointers for get/... Josef Bacik
- [PATCH 05/11] btrfs: add helper methods for workspace mana... Dennis Zhou
- Re: [PATCH 05/11] btrfs: add helper methods for works... Nikolay Borisov
- Re: [PATCH 05/11] btrfs: add helper methods for works... Josef Bacik
- [PATCH 04/11] btrfs: unify compression ops with workspace_... Dennis Zhou
- Re: [PATCH 04/11] btrfs: unify compression ops with w... Nikolay Borisov
- Re: [PATCH 04/11] btrfs: unify compression ops with w... Josef Bacik
- [PATCH 03/11] btrfs: manage heuristic workspace as index 0 Dennis Zhou