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=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 55E18C4338F for ; Wed, 11 Aug 2021 07:16:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3632860FC0 for ; Wed, 11 Aug 2021 07:16:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235264AbhHKHQ0 (ORCPT ); Wed, 11 Aug 2021 03:16:26 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:43794 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235506AbhHKHQZ (ORCPT ); Wed, 11 Aug 2021 03:16:25 -0400 Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id F004E22152; Wed, 11 Aug 2021 07:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1628666160; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qyWkzhkMRSgA+eWCQNd7a3Ian7Q0bInWBZgjohbmGDI=; b=f68l+6NvcnzCWyCOYNN1wHRJDR+h9Le3mDGMvBUOKOlaJm6HYiyPuD/017gxeOtWwIkIAr j12IrJiYr1RPuze/kCungdZr0Q/VYbmA97Sn/W6Y4usqXad2dGVROqJOYTKwTt/oBI5kyJ X5jFNPN7HGTzKrUaW6+mo1yDgAlzNtw= Received: from imap1.suse-dmz.suse.de (imap1.suse-dmz.suse.de [192.168.254.73]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap1.suse-dmz.suse.de (Postfix) with ESMTPS id C5C33137FE; Wed, 11 Aug 2021 07:16:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap1.suse-dmz.suse.de with ESMTPSA id 7B69JTB5E2GcXQAAGKfGzw (envelope-from ); Wed, 11 Aug 2021 07:16:00 +0000 Subject: Re: [PATCH] btrfs: reduce return argument of btrfs_chunk_readonly To: Anand Jain , linux-btrfs@vger.kernel.org References: <32a8d585312548c69ca242c6fd671755f78ddace.1628609924.git.anand.jain@oracle.com> From: Nikolay Borisov Message-ID: Date: Wed, 11 Aug 2021 10:15:59 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <32a8d585312548c69ca242c6fd671755f78ddace.1628609924.git.anand.jain@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On 10.08.21 г. 18:48, Anand Jain wrote: > btrfs_chunk_readonly() checks if the given chunk is writeable. It returns > 1 for readonly, and 0 for writeable. So the return argument type bool > shall suffice instead of the current type int. > > Also, rename btrfs_chunk_readonly() to btrfs_chunk_writeable() as we check > if the bg is writeable, and helps to keep the logic at the parent function > simpler. I don't see how the logic is kept simpler, given that you just invert it. IMO changing the argument to bool without renaming the function is a sufficient change and it will result in a lot smaller diff.