Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7846010rwb; Wed, 23 Nov 2022 11:32:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf75rejfgN4AlRrrl9VrpwOU8yR+sl9hfWBmZvVUHmBNftS/OIuvXWHxKmIe6sYSxPi1+oBH X-Received: by 2002:a63:1601:0:b0:46f:9193:467d with SMTP id w1-20020a631601000000b0046f9193467dmr18856734pgl.479.1669231943617; Wed, 23 Nov 2022 11:32:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669231943; cv=none; d=google.com; s=arc-20160816; b=U/vimDmAo6tBUU08ZFMxoU+qc4Ui+Kwocr3MkJEhZ1pZpLzU+b3J0XFVRPG/cpOPEN g35I8PQPK7yLxOb6oXRR53Hcco1QTzd95uxfFB83JFbQQT9WMw9mzFi8BLnFsDJQjsHX AEyuAiqY9oaTgSgZa/WUZfrc8SbVSmOkmpOW83AZAhhCPFu8Wr2y3AAVWhAcf41wPuyQ YUI4BJj5CWqhrhS8d3IgJYf431ggFzQ6r3Zr2vUYCEyJIrcyvuBoS2E7AdgdtFjcqdaR 9D14l0bPuBR4nUUp0ZbbUP3BGvttckyGWsTB0qvJikSrQYgn3CWFToP4RQwoZXr8LXVW aVDg== 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=AIH1A5u+z6seLqd1JfAfRblb2Kbzo4oXSpalYFJfBs8=; b=M4hoZ+U5YNE4AI+3hFGtJoj4RoxRYeN4y7Xj4yS2D8mI1k2XJLjCOKzKg4lzITqOM0 P9D1HcUOMuySqcg6MyD0dkQSYYiRWZm9M5z0B1Mu6XCiSVmlphtJuVmseo0J2JkBWcFM vtcaypoxS6OOmEAfoato+Lkoqx/piJAp6LnfmR2o4IIQF+q14Xbx2tIiATyDBh+gIapu KznGOQNAdPOc93lJ4PSwme6XF7ljYj5ljZ6j+W9xYoH7gJlsy3v3ohg6pnxb9rWCSbLD KnFLY/gvTGAIeMaue/tEiuLneHeLc9SaVuxfArUM0BCTJ9KEqMf5Syq+NESO9e4mEuLw yt6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="U4/2ZFeV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a056a00174d00b0056dc342ea54si18269262pfc.206.2022.11.23.11.32.12; Wed, 23 Nov 2022 11:32:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="U4/2ZFeV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S239766AbiKWSde (ORCPT + 88 others); Wed, 23 Nov 2022 13:33:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239527AbiKWScg (ORCPT ); Wed, 23 Nov 2022 13:32:36 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DFB2C771 for ; Wed, 23 Nov 2022 10:32:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D676D61E50 for ; Wed, 23 Nov 2022 18:32:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E0D6C433C1; Wed, 23 Nov 2022 18:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669228354; bh=AYGlvKt7YQZqa65l3Od2pD7Mak2sH6QY21MH6d1v69g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U4/2ZFeVg8PW9hGT8u5EsP81jLTaArTBB5I3qjZ50OZDoicQcEpQvvgMDEzc35TjK Gk/4Yr22sxtpwie2fDWGbmo4AjpODfXvgCxUSZWSNPlp6SY6iTPeRs0uOmARm0o8c+ ZJLC6n5mr328mQ9MeF9z4KSs4OBwugFFOL+f2dcGvUL0SKcrsAEEsNVCZAb0DxyREy ZI3rEHJb6Cb0C4jZIw5TKvSR+DymO+rZhgXVcLdylssIKqa81dQqPBcNnCcHhVdlIU bMw+Oek5pqBHhNmpxcyQ4ovwoaNtonWecfUdNWHl1TSBtvHbrERp6nInwquQtwD+Mm mG+2cvbTj8pSw== Date: Wed, 23 Nov 2022 18:32:32 +0000 From: Eric Biggers To: Yangtao Li Cc: jaegeuk@kernel.org, chao@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH] f2fs: introduce f2fs_is_readonly() for readability Message-ID: References: <20221123170153.15888-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221123170153.15888-1-frank.li@vivo.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 24, 2022 at 01:01:53AM +0800, Yangtao Li via Linux-f2fs-devel wrote: > Introduce f2fs_is_readonly() and use it to simplify code. > > Signed-off-by: Yangtao Li > --- > fs/f2fs/f2fs.h | 5 +++++ > fs/f2fs/super.c | 5 ++--- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index f0833638f59e..efc9d6d7b506 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -4576,6 +4576,11 @@ static inline void f2fs_handle_page_eio(struct f2fs_sb_info *sbi, pgoff_t ofs, > } > } > > +static inline bool f2fs_is_readonly(struct f2fs_sb_info *sbi) > +{ > + return !!f2fs_sb_has_readonly(sbi) || f2fs_readonly(sbi->sb); > +} There is no need for the !! here. - Eric