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 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19471C433FE for ; Wed, 23 Nov 2022 18:32:48 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1oxuY9-00077J-P5; Wed, 23 Nov 2022 18:32:45 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oxuY6-000778-EC for linux-f2fs-devel@lists.sourceforge.net; Wed, 23 Nov 2022 18:32:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AIH1A5u+z6seLqd1JfAfRblb2Kbzo4oXSpalYFJfBs8=; b=f604jtaPYq7tTOjDk7llTOik3K rJGJYbrJbSUWz6Pwkt91vl+LrKi5HyLHz+xIOKGeHbrgUfy2FaMHTJnYGrfRkiMIxliQNtTvd0zje YZjq5rKTuAZ6YML+Z5Ok45y9CLRZf4kpt9F6/u/8Ah3OPQaBnJ6Hb6evmqDpIZMLKwSg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AIH1A5u+z6seLqd1JfAfRblb2Kbzo4oXSpalYFJfBs8=; b=Is0WmC93b1abUSlnuQ7oI2abzv 9SLoGTTEahAnM4pjzW/UWd9C/U1tE6disKZDFwm4YmC8lJSwxMXV/oavb2/LyD22iF/hzZlFTleWU yuADVDb0Jv04hlIjVQzg70zlKI6glRS+i3Y9mZg3F4xO4NlsxCrFm4f9UOxudDuC2A7Y=; Received: from ams.source.kernel.org ([145.40.68.75]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1oxuY5-0001pO-P9 for linux-f2fs-devel@lists.sourceforge.net; Wed, 23 Nov 2022 18:32:42 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 81CFAB821F1; Wed, 23 Nov 2022 18:32:35 +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 Message-ID: References: <20221123170153.15888-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221123170153.15888-1-frank.li@vivo.com> X-Headers-End: 1oxuY5-0001pO-P9 Subject: Re: [f2fs-dev] [PATCH] f2fs: introduce f2fs_is_readonly() for readability X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jaegeuk@kernel.org, linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4F71C4332F for ; Wed, 23 Nov 2022 18:33:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239706AbiKWSdf (ORCPT ); Wed, 23 Nov 2022 13:33:35 -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> 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