Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5199695imu; Tue, 29 Jan 2019 14:45:59 -0800 (PST) X-Google-Smtp-Source: ALg8bN4zhYRhn6UZMsAjmZKnm8yq1NFS5jD2AM91eEMVUqzvc7ijElYAm8C+t4uit6ITwPScPAhT X-Received: by 2002:a17:902:fa2:: with SMTP id 31mr28070528plz.75.1548801959433; Tue, 29 Jan 2019 14:45:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548801959; cv=none; d=google.com; s=arc-20160816; b=O/gBplXF3BTYyXS6y1Mv09g4fhQLVSXfUWkPzhNvgZxOvg5YorOftOK0Ho/DqTAsdH 00txoZStX8UpCd+vM2EyZhmxFYOHO3Aqj8BzsqqyRlML4xnpRstBJtg4ciZHV26eFpxo 7w0ombWe60vHXKeSNk6NzPgXFcEhbUFyDV/r+Rtmy/cYf4DuL82DvvnZv2V0DLAUBbvQ PHc+We85262ZQ9AsSSFQd4bkqoQLAhnUGWtqRCohynzcv4C76OpK/vBkFa0aMQWalRkc W4wmRjkp1eLGFlAJahhFMFDT+7ziziNhs0NNuhub87ufS0q9zenlBncX0L4XkGwZ0JPF nCqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=fEJbE/ywGzh83Tzyph5e5xJGrSMLJvMydLxy61aXPL8=; b=rv5bFI2UUnb8jscydrGYrr6g7Tjwbhuro99fnFskCI9p9JyqmUpVS4unPhqCKVxBir t+VR1TE++1/wJpRxVcDSM5r/Wr61ZrPwDKo4tKCqHvUy9Do1U2tvoMB/Fc5b3hHcKJrF sZI9g3Tdf3VYXkY5in/EJTCw0LgB6vpYYJKvUzBjEq2OVsKB8Uqxm7KUQq7Esqv3a/cS UeZNMwUgi48d0rUQpsHVpdQ/kilVBpwq/1ZuUcepJmVKRW6ig1L/cXYhJKePLw/BVqQ6 /W0QE4d1frKdDNxoj2ikGBfrVnan7h1XJRMXoasdvtX61DVJpPzR1+31EVMJpke7Clyn 9YiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si23961479pfi.184.2019.01.29.14.45.43; Tue, 29 Jan 2019 14:45:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729632AbfA2Wne (ORCPT + 99 others); Tue, 29 Jan 2019 17:43:34 -0500 Received: from mail-yw1-f65.google.com ([209.85.161.65]:45490 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727332AbfA2Wne (ORCPT ); Tue, 29 Jan 2019 17:43:34 -0500 Received: by mail-yw1-f65.google.com with SMTP id d190so8854970ywd.12; Tue, 29 Jan 2019 14:43:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=fEJbE/ywGzh83Tzyph5e5xJGrSMLJvMydLxy61aXPL8=; b=Ib+bzy3R70eEUbilZmjTRMu/GkUisHTrQISmEuV82TfrIqL4yaxLqwO7v8kVbTUCD0 7tQKw0lvaIfg9NnmuUc56tUNkr/UuzIaaQP1WOdXLaxUvrpnfL5hfEpqMmJTQ8mTVSiw ODgAuAnYeBTK1X9PFIS9bK8q87BqjDO3KA7rNsCAoLl5xkn6C91YMMhgmZFc5ZuoQw6Y wD2BXcvaY3opope2gydw5pihDK2lptNwR5P4xZrb1QF+/dxmZ5TGRdShdWXN7kRrhioX +0ZKc9I/gH8xkJ3IMgsoQOY5D4WOM8kRD+6agHZ11+b3zilLzkfKD2M46odhUeB7p7bi e55w== X-Gm-Message-State: AJcUukdIKGQ4yNdf0q4ekUp5KEJmJeAGePAe6deXnwc8ysJ7WPHA9JC/ BaGClPYHmx3NOPhXrZFkN4M= X-Received: by 2002:a0d:d586:: with SMTP id x128mr27137899ywd.346.1548801813467; Tue, 29 Jan 2019 14:43:33 -0800 (PST) Received: from dennisz-mbp.dhcp.thefacebook.com ([2620:10d:c091:200::5:f5f4]) by smtp.gmail.com with ESMTPSA id n16sm18540726ywn.31.2019.01.29.14.43.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 14:43:32 -0800 (PST) Date: Tue, 29 Jan 2019 17:43:30 -0500 From: Dennis Zhou To: Nikolay Borisov Cc: Dennis Zhou , David Sterba , Josef Bacik , Chris Mason , Omar Sandoval , Nick Terrell , kernel-team@fb.com, linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 03/11] btrfs: manage heuristic workspace as index 0 Message-ID: <20190129224330.GA87266@dennisz-mbp.dhcp.thefacebook.com> References: <20190128212437.11597-1-dennis@kernel.org> <20190128212437.11597-4-dennis@kernel.org> <4bc26773-da13-3730-afda-78d672f348bc@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4bc26773-da13-3730-afda-78d672f348bc@suse.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 09:53:33AM +0200, Nikolay Borisov wrote: > > > On 28.01.19 г. 23:24 ч., Dennis Zhou wrote: > > While the heuristic workspaces aren't really compression workspaces, > > they use the same interface for managing them. So rather than branching, > > let's just handle them once again as the index 0 compression type. > > > > Signed-off-by: Dennis Zhou > > Reviewed-by: Nikolay Borisov albeit one minor nit > below. > > --- > > fs/btrfs/compression.c | 107 +++++++++++----------------------------- > > fs/btrfs/compression.h | 3 +- > > fs/btrfs/ioctl.c | 2 +- > > fs/btrfs/tree-checker.c | 4 +- > > 4 files changed, 33 insertions(+), 83 deletions(-) > > > > diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c > > index aced261984e2..bda7e8d2cbc7 100644 > > --- a/fs/btrfs/compression.c > > +++ b/fs/btrfs/compression.c > > @@ -37,6 +37,8 @@ const char* btrfs_compress_type2str(enum btrfs_compression_type type) > > case BTRFS_COMPRESS_ZSTD: > > case BTRFS_COMPRESS_NONE: > > return btrfs_compress_types[type]; > > + default: > > + return NULL; > > nit: With this change... > > > } > > > > return NULL; > > This becomes redundant. I doubt the compiler will issue a warning since > it should be clever enough to figure we will never exit the switch() > construct. > Ah yes. I've removed it for v2. Thanks, Dennis