Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp65451pxk; Tue, 15 Sep 2020 20:45:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0k22byH46Uv6hH04cgnxFU7LGerRmbjY1t/I8y16eLKkGQlLCKMidWvSz4pYdgWdpWUTC X-Received: by 2002:a50:8306:: with SMTP id 6mr24642117edh.340.1600227945448; Tue, 15 Sep 2020 20:45:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600227945; cv=none; d=google.com; s=arc-20160816; b=eVOP/rdwYH5ZxuD/BBgzJGmAJdAnsdgvltkXg2jf8jo/GMwhF/p/MInho/l4g1CMk7 UI9PUgHspwYgxzJsruvHi+WtxKtelgvRKphDe3ouap5Uv0gkKxHKEW17V1d+fqXO5HVo trXySg58JeTeuf3c941D+KTUG+mz/4EKNOOWFATBMuh5ze9NH0OWMdkSPuoyFe3JUd0T D+QxJssM2Gsm/UxuXPJItYQR6QoUmnXW6CXPtT1azmDSNQzkZ9CDsI8gePGF8hf/iWfx +w/c+tS86BONOqTmtHxTOtCJNMngSgkzuK9xwEjlKDKTbmpgZybDHT+VxodqZBUgP9+k qr+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=290Bo0sJTh/t678nA8yWOfHRoSh5E7Ekj1ME0hd0Klk=; b=krYX9h6KXrZP2ANWdNP4vYFmSuv8MougXjTr5JJK3YAfo65Q4EBJqp7eRtpYCPTC2n hhuB3wfHx9ocGage+2cDFzE8h+SCttJ59ZilmDkCSSpVQ20UO5EkhN46BkzcnPNAvEB9 Qa8XTZAibLabVzPVWGcFPuMCaFlauUmbkfRbQUcjGOBAX9NxYBYh1vlZvaMONCqocOi+ cHdCxKJmS0SKUY5crC2cLNHOfqTRMfMRl0iaatwqiItTWUHt+FSPJDCWySmyJPuy9N7M tW1ZpHpIFKO4J49zd/xTOdGrJ6/iUhavfycwi14BAu2yYZzwukWigB0QgU7XzixTOejV ATzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KEm0UVHF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si11514498ejs.91.2020.09.15.20.45.20; Tue, 15 Sep 2020 20:45:45 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KEm0UVHF; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726155AbgIPDoS (ORCPT + 99 others); Tue, 15 Sep 2020 23:44:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbgIPDnR (ORCPT ); Tue, 15 Sep 2020 23:43:17 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C78FCC061351; Tue, 15 Sep 2020 20:43:13 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id d13so3118404pgl.6; Tue, 15 Sep 2020 20:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=290Bo0sJTh/t678nA8yWOfHRoSh5E7Ekj1ME0hd0Klk=; b=KEm0UVHF1Z/Vd0ckYj7yXuuG2AXFzwVDsLdcdoVQhNvG6DuSNx/aQJ6PPeHhVcQSuZ u2VxPlPV30RHTwhHAM5T8aC/Mftiyqsy8vGBRLuXefq5lF0QCKk6+2e7BbkPxBsgv74a BCBCLAHFqhCI4dTN3g5qGZlL3bUQSf/I/eHUoF+SImgPfbAC2vfI3b+1Dr9PgEbJzJz8 6Pee+NmrM9WC0Cms5Zua+0mBnMCugV6xej/EplN3TrcJayU/UwLp+pdqpCgHSNMZvWOK Y+lDOzxqJeud3zPIRok5iX50CwArL4vaEJsMzHCme7lPl5RigPxKb/V8y7XCvaDFJri2 mY+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=290Bo0sJTh/t678nA8yWOfHRoSh5E7Ekj1ME0hd0Klk=; b=RAn11rJsHuoLA8u+7kcHHTrt7t7xxRJNLna6OjpmFxh7/IhaMJaI5B8Ik+S/DYyuGF lgWXWkrRLLN0VC0AjQgDHwcpHUg5JhuYSNkSa+tweJmly6r3aBG0mKIxtoGfr/87o8oE yGeUgWE9e/YGzzhikyQdEzi6p4v1zBGt361sZfvavIZonUF1sHkS2zUlVcy09IOoHepN 1CqEkU1yjXr2jrYnB9eVBhSuUvO6K5U7AcSDkkCRZDBWdg3AYvxovhdFvPJi0e/QKrbk rtgMetpeDL+K+k/aclW5OdrHkMs/sJGjpTjfJyFgaHhN90FwsW3Domb6HhU86ynoK0V7 tyXg== X-Gm-Message-State: AOAM530vUfXmFkS17RsxFdXkJmu/yUdtvlu7fqlRPTqfVdtCY+auwKW/ lRgS6dphIu8eeG8YlRFYZjI= X-Received: by 2002:aa7:948d:0:b029:13e:cb8d:60e0 with SMTP id z13-20020aa7948d0000b029013ecb8d60e0mr21545205pfk.9.1600227792869; Tue, 15 Sep 2020 20:43:12 -0700 (PDT) Received: from nickserv.localdomain (c-98-33-101-203.hsd1.ca.comcast.net. [98.33.101.203]) by smtp.gmail.com with ESMTPSA id i20sm12856635pgk.77.2020.09.15.20.43.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 20:43:12 -0700 (PDT) From: Nick Terrell To: Herbert Xu Cc: 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 , Nick Terrell , Chris Mason , Petr Malat , Johannes Weiner , Niket Agarwal , Yann Collet Subject: [PATCH 7/9] squashfs: zstd: Switch to the zstd-1.4.6 API Date: Tue, 15 Sep 2020 20:43:03 -0700 Message-Id: <20200916034307.2092020-11-nickrterrell@gmail.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916034307.2092020-1-nickrterrell@gmail.com> References: <20200916034307.2092020-1-nickrterrell@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Nick Terrell Move away from the compatibility wrapper to the zstd-1.4.6 API. This code is functionally equivalent. Signed-off-by: Nick Terrell --- fs/squashfs/zstd_wrapper.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/squashfs/zstd_wrapper.c b/fs/squashfs/zstd_wrapper.c index f8c512a6204e..add582409866 100644 --- a/fs/squashfs/zstd_wrapper.c +++ b/fs/squashfs/zstd_wrapper.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include "squashfs_fs.h" @@ -34,7 +34,7 @@ static void *zstd_init(struct squashfs_sb_info *msblk, void *buff) goto failed; wksp->window_size = max_t(size_t, msblk->block_size, SQUASHFS_METADATA_SIZE); - wksp->mem_size = ZSTD_DStreamWorkspaceBound(wksp->window_size); + wksp->mem_size = ZSTD_estimateDStreamSize(wksp->window_size); wksp->mem = vmalloc(wksp->mem_size); if (wksp->mem == NULL) goto failed; @@ -71,7 +71,7 @@ static int zstd_uncompress(struct squashfs_sb_info *msblk, void *strm, struct bvec_iter_all iter_all = {}; struct bio_vec *bvec = bvec_init_iter_all(&iter_all); - stream = ZSTD_initDStream(wksp->window_size, wksp->mem, wksp->mem_size); + stream = ZSTD_initStaticDStream(wksp->mem, wksp->mem_size); if (!stream) { ERROR("Failed to initialize zstd decompressor\n"); @@ -122,8 +122,7 @@ static int zstd_uncompress(struct squashfs_sb_info *msblk, void *strm, break; if (ZSTD_isError(zstd_err)) { - ERROR("zstd decompression error: %d\n", - (int)ZSTD_getErrorCode(zstd_err)); + ERROR("zstd decompression error: %s\n", ZSTD_getErrorName(zstd_err)); error = -EIO; break; } -- 2.28.0