Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4078782pxb; Tue, 10 Nov 2020 07:28:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJxddXeeTl0hAC7O87u/KoAYJ8xfbhBU0btxDXbLx154+FF+CWrTmSytvC8XOkBjoOuESrLa X-Received: by 2002:a17:906:6d13:: with SMTP id m19mr20623892ejr.345.1605022086735; Tue, 10 Nov 2020 07:28:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605022086; cv=none; d=google.com; s=arc-20160816; b=Q8wQtpdLu44ev0W3Y9icKgXW4Aj8kqmNa3wC47Q3g3YVcIgP7uS46tt72aq1/Oyo1Z SQC0Guaf5qVuU2Ai5V9lOQfDkSdx9lmspQRFaDjGZXQMFK/ajzKyDv+WFzQyni9t6uij NDzfal7nLZ+CEWq7Pc3sTCQrnyBPPncxyXxkSJ+jZdqACWtloyz7FYa8WOE8dd6kWr2f ym9m+JlB3tm/JA0WsWXp4UEWOQ/gES8ZaVw5q5oqP6mTrxXOCXFu57VlTw9xWPbgvvC/ bb6hdYNCym9eaE0XuihKbxo6PXMc/36q7J19D8a7FH0HbqxQNnzH7+n5oBpxByT9DwMM Uveg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:mail-followup-to :reply-to:message-id:subject:cc:to:from:date; bh=nLFmoa0aloAZvgnWh5K26JQfxjzsuVMDGq8sXagZeog=; b=mUKleUTHm++p2sTJ6Oc17qXhoDVrx9B9pYu0cooQ0TGwcgmRz02BpCdkqTCHFoKLaB QH7i4ORo25meHy3aweX9ZpuvrZNm8ahJKRreEJ27lOdpmjkJHAwC3aC8tdPrTb2GODoi nKZHCDwtAwr0F191kW6hdNdrMBWOfpTbvxM0d7O5QCifhObLqOiuR8mN7QcAeWqQEbjI BjlWsnhoAzRmJMe175R7PIzrsOc9I1RATxmWW8BFkNup4RtXZtySqnAPooHGnQ7aGN5C jbAwZPPpPaaptPba6QuYeTQImt+BfIhFsd3oTrYsv06b2RJX7gVVEkHgqJO5M3XTbc83 dCxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ga18si9289121ejc.519.2020.11.10.07.27.29; Tue, 10 Nov 2020 07:28:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730968AbgKJP1Y (ORCPT + 99 others); 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-crypto@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.