From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01FB4C388F7 for ; Tue, 10 Nov 2020 15:27:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A11BE20797 for ; Tue, 10 Nov 2020 15:27:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731313AbgKJP1Y (ORCPT ); Tue, 10 Nov 2020 10:27:24 -0500 Received: from mx2.suse.de ([195.135.220.15]:60552 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730231AbgKJP1Y (ORCPT ); Tue, 10 Nov 2020 10:27:24 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id DBFC2ABD1; Tue, 10 Nov 2020 15:27:22 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 7255CDA7D7; Tue, 10 Nov 2020 16:25:41 +0100 (CET) Date: Tue, 10 Nov 2020 16:25:41 +0100 From: David Sterba To: Chris Mason Cc: Christoph Hellwig , Nick Terrell , Herbert Xu , linux-crypto@vger.kernel.org, linux-btrfs@vger.kernel.org, squashfs-devel@lists.sourceforge.net, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Kernel Team , Nick Terrell , Petr Malat , Johannes Weiner , Niket Agarwal , Yann Collet , Greg Kroah-Hartman Subject: Re: [PATCH v5 1/9] lib: zstd: Add zstd compatibility wrapper Message-ID: <20201110152541.GK6756@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Chris Mason , Christoph Hellwig , Nick Terrell , Herbert Xu , linux-crypto@vger.kernel.org, linux-btrfs@vger.kernel.org, squashfs-devel@lists.sourceforge.net, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Kernel Team , Nick Terrell , Petr Malat , Johannes Weiner , Niket Agarwal , Yann Collet , Greg Kroah-Hartman References: <20201103060535.8460-1-nickrterrell@gmail.com> <20201103060535.8460-2-nickrterrell@gmail.com> <20201106183846.GA28005@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Mon, Nov 09, 2020 at 02:01:41PM -0500, Chris Mason wrote: > On 6 Nov 2020, at 13:38, Christoph Hellwig wrote: > > You just keep resedning this crap, don't you? Haven't you been told > > multiple times to provide a proper kernel API by now? > > You do consistently ask for a shim layer, but you haven’t explained > what we gain by diverging from the documented and tested API of the > upstream zstd project. It’s an important discussion given that we > hope to regularly update the kernel side as they make improvements in > zstd. > > The only benefit described so far seems to be camelcase related, but if > there are problems in the API beyond that, I haven’t seen you describe > them. I don’t think the camelcase alone justifies the added costs of > the shim. The API change in this patchset is adding churn that wouldn't be necessary if there were an upstream<->kernel API from the beginning. The patch 5/9 is almost entirely renaming just some internal identifiers - ZSTD_CStreamWorkspaceBound(params.cParams), - ZSTD_DStreamWorkspaceBound(ZSTD_BTRFS_MAX_INPUT)); + ZSTD_estimateCStreamSize_usingCParams(params.cParams), + ZSTD_estimateDStreamSize(ZSTD_BTRFS_MAX_INPUT)); plus updating the names in the error strings. The compression API that filesystems need is simple: - set up workspace and parameters - compress buffer - decompress buffer We really should not care if upstream has 3 functions for initializing stream (ZSTD_initCStream/ZSTD_initStaticCStream/ZSTD_initCStream_advanced), or if the name changes again in the future. This should not require explicit explanation, this should be a natural requirement especially for separate projects that don't share the same coding style but have to be integrated in some way.