Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp761116pxb; Mon, 16 Aug 2021 17:32:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWlsjVyfaREax+xwORNfkbVVqPQVuA4rE2H+iVsZgf1TeK1C/+d00FrK52kPeaP9RrSxf3 X-Received: by 2002:a05:6402:2288:: with SMTP id cw8mr933082edb.216.1629160337563; Mon, 16 Aug 2021 17:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629160337; cv=none; d=google.com; s=arc-20160816; b=Dz9HzYeM8skbtwENlp5a+Uy4GaN2AZ0nJna/ROao6fJ9sIM9puCZxe4yGQ5iwBRva9 JNonecBIKFX7m+gar4eNCMR/U2Wo3c/3PVZUOCuCWj3t8YC6uItk7HZpxayANTwMXO3I X8Bdu6iHwapzRkP0uTkjK93krMvnrRO2hZoZBnfpV0pr3C5jVl+aXH3Pn063cMDRR/pZ lpmm3ohO5TN7RacBPY75pkYeHfXzWiGjPuf9HqsJjrN7gk6fCoj9FmM4Zx+gsh6EUOSe FmdVJluNbj26QI1f6whPqQjMsRAnNAbEwZlyoIwusEc1oPvW/2UXiMAtNVqsXWgx5sVu UVNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ya6KEcdSssDZpWElAyiyUytq5C1C9xEq3lsR6omHcgY=; b=qdET3yxfdfdc1l8gSI1DWfNfJ1K73sYMr/a+22tMNj4USzOFbUyN6Q96ljHr+JKX/e y3pI9/NyNvaQAhugoQ3iWQh24wPQClmjAe53/x5Sv7Q+9eLD32ebOolDvchIebNn9UMP U7MwLTswpCTLtSF6ja4xQlSJ1UKfcyWyuDHfSwjGJSWrm9UQP699Qv3+kaunV9ndl1cj 1e6dgSzYtRDlDG+CfGIN6T/95FaH/pvkHqV9KOhUfqiH/EmLm48e+Rj3eqNvsdvcmHw9 OqWJOnxwDoAqgKReHWGh8BxWIJQmq9ffDtEwWyUoqaf1d8qKDxcuEzpQKhJ+VBUziZA1 Tjcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Z/OxiQOp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k20si487120edq.36.2021.08.16.17.31.51; Mon, 16 Aug 2021 17:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=k20201202 header.b="Z/OxiQOp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233129AbhHQAbI (ORCPT + 99 others); Mon, 16 Aug 2021 20:31:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:60156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232929AbhHQAbH (ORCPT ); Mon, 16 Aug 2021 20:31:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 58C5E60F55; Tue, 17 Aug 2021 00:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629160235; bh=EdCrxzsMmkwYwBRpv9mB8ATfiVlhXsxkIRGxlrChfes=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z/OxiQOpk/MWnSzb7t+AfFk4DY6FTSC86PcX4E1IpF6EPejYKZGilb1Oc5Ps47w0+ k0MxtsE0IMhDy+yXcdlPk8m5eIKDvFYQRdK7ugBmZvUB47HnWNoqx3Xw7KLNSKzRWd S2wnX2hYQEH54X3y/J7tZD0XJGq6SEmod1F5EmFbZtb9M/kEm6XNfQlSaH+riw10ah 7aq7u7Uwywk838nIPspwgOwx4sah0Su+by2w7kBqnY2UWx+FnNCroH1X/042ubLLy5 9xBYNN53s6Vx494pOZiOrYXtiw+a6uMzvSti1Hh06XYG7ZoNPNJ3W2rxHw2osh3OIZ Df+/idgGiHQYw== Date: Mon, 16 Aug 2021 17:30:33 -0700 From: Jaegeuk Kim To: Yangtao Li Cc: chao@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: change value of recovery to bool Message-ID: References: <20210816122807.71400-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210816122807.71400-1-frank.li@vivo.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hmm, I don't see a great benefit of this patch. Do we have a chance to use integer to get more specifics of the recovery reason in future? On 08/16, Yangtao Li wrote: > Recovery has only two values, 0 and 1, let's change it to bool type. > > Signed-off-by: Yangtao Li > --- > fs/f2fs/super.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 8fecd3050ccd..98727e04d271 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -3541,7 +3541,7 @@ static int init_blkz_info(struct f2fs_sb_info *sbi, int devi) > */ > static int read_raw_super_block(struct f2fs_sb_info *sbi, > struct f2fs_super_block **raw_super, > - int *valid_super_block, int *recovery) > + int *valid_super_block, bool *recovery) > { > struct super_block *sb = sbi->sb; > int block; > @@ -3559,7 +3559,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, > f2fs_err(sbi, "Unable to read %dth superblock", > block + 1); > err = -EIO; > - *recovery = 1; > + *recovery = true; > continue; > } > > @@ -3569,7 +3569,7 @@ static int read_raw_super_block(struct f2fs_sb_info *sbi, > f2fs_err(sbi, "Can't find valid F2FS filesystem in %dth superblock", > block + 1); > brelse(bh); > - *recovery = 1; > + *recovery = true; > continue; > } > > @@ -3784,15 +3784,16 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) > int err; > bool skip_recovery = false, need_fsck = false; > char *options = NULL; > - int recovery, i, valid_super_block; > + int i, valid_super_block; > struct curseg_info *seg_i; > int retry_cnt = 1; > + bool recovery; > > try_onemore: > err = -EINVAL; > raw_super = NULL; > valid_super_block = -1; > - recovery = 0; > + recovery = false; > > /* allocate memory for f2fs-specific super block info */ > sbi = kzalloc(sizeof(struct f2fs_sb_info), GFP_KERNEL); > -- > 2.32.0