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=-10.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 B21F4C4361B for ; Thu, 17 Dec 2020 14:45:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 755A822E02 for ; Thu, 17 Dec 2020 14:45:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728068AbgLQOpN (ORCPT ); Thu, 17 Dec 2020 09:45:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbgLQOpM (ORCPT ); Thu, 17 Dec 2020 09:45:12 -0500 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6AF4C061794 for ; Thu, 17 Dec 2020 06:44:32 -0800 (PST) Received: by mail-qk1-x732.google.com with SMTP id i67so18998738qkf.11 for ; Thu, 17 Dec 2020 06:44:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=dRjS/SzPBIxFE+JBd6voANsrrjtdQyCItcADll1H0Zw=; b=AO7PNY3yz9QtqInMET7uOq1e6fwlv5tdXdUf1UimRYCczdJ96V7EI9Sq9Q6HpU69Ez 89z1LTSlAmvUqvWsDYAMogIxWe3ql262cilH99uDKpGCEtxkkEVn/ZZ2nxU9S2CxcDyZ G5YK0tFCISSvYqbq9g99UwWm3ltP96mVmCQSzUnZsQaK7+U9DaWzKXRAXrAe7QVvZP53 +KU1p/9Ss2Rys9i62rYPVpoNmiX1xCkBQ3UxGOP7SLR2uisD9ufheEZkWFvtVTkHWr3H +VDp/XAAj9ruaK9Ovk5ECSqPeVDK6E45LVw/8+vTNpEN9dH/rt7LAwXZfRrPxfvtUgdF E0MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dRjS/SzPBIxFE+JBd6voANsrrjtdQyCItcADll1H0Zw=; b=hoxGyP6fPJMmMFIzi9xc/ynd3LqVw57TCBZ10nucNI7avht10bX6389SYYOHVxY5rV HLNRoMbFioC1XFmoXIvqHHqXkr3spbyjeH8T2nF6Q+WdHx8tefwAnOFBWLl+uOFnhWF4 r3v4rahbYk+bpLa66PhMlvEEu2I87XeE1YnFPDohqZfF6VvsFpXITJOuuoRYAALBcdge 021W9WxryXBkdIwG6b6wCuXbTe3lEiUZzxjJcSKycfSL3CqisU9eMaHxK60lffJ8Jrtg /czNTB+XxNmaLYu9zTm479JqKwYL35huC9yf4duIereAyBhPkga6sKhflQqhEBwbfcVq c6iw== X-Gm-Message-State: AOAM531oO7YI9oafedXfuAC6tE+VblnkhU0BXz0mc2iQqaLkIYeSgE2R nnndxVf2qaSOqxOOlAMlYkpXSkOj4WE1r+mh X-Google-Smtp-Source: ABdhPJyQtq0XhtnZgXgVqnJEOFKQ9OdV7+r3JaOKDX2wmf2Y+bRLG62O6DBajQxa2eKSnRqXxS3c+g== X-Received: by 2002:a37:6c03:: with SMTP id h3mr50065162qkc.219.1608216271620; Thu, 17 Dec 2020 06:44:31 -0800 (PST) Received: from [192.168.1.45] (cpe-174-109-172-136.nc.res.rr.com. [174.109.172.136]) by smtp.gmail.com with ESMTPSA id z26sm3236073qki.40.2020.12.17.06.44.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Dec 2020 06:44:31 -0800 (PST) Subject: Re: [PATCH] btrfs: Consolidate btrfs_previous_item ret val handling in btrfs_shrink_device To: Nikolay Borisov , linux-btrfs@vger.kernel.org References: <20201217132116.328291-1-nborisov@suse.com> From: Josef Bacik Message-ID: <911d913e-fa0e-e98c-8a34-50aace475b7a@toxicpanda.com> Date: Thu, 17 Dec 2020 09:44:29 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20201217132116.328291-1-nborisov@suse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 12/17/20 8:21 AM, Nikolay Borisov wrote: > Instead of having 3 'if' to handle non-null return value consolidate > this in 1 'if (ret)'. That way the code is more obvious: > > - Always drop dlete_unused_bgs_mutex if ret is non null > - If ret is negative -> goto done > - If it's 1 -> reset ret to 0, release the path and finish the loop. > > Signed-off-by: Nikolay Borisov Reviewed-by: Josef Bacik Thanks, Josef