From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chao Yu Subject: Re: [PATCH] f2fs: save a multiplication for last_nid calculation Date: Thu, 2 Nov 2017 21:57:41 +0800 Message-ID: <61f32d13-3e39-afcb-752f-90740c765a65@kernel.org> References: <000101d35387$2dec7d40$89c577c0$@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.89) (envelope-from ) id 1eAG0e-0002w1-V3 for linux-f2fs-devel@lists.sourceforge.net; Thu, 02 Nov 2017 13:58:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by sog-mx-4.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1eAG0d-0002y4-W8 for linux-f2fs-devel@lists.sourceforge.net; Thu, 02 Nov 2017 13:58:16 +0000 In-Reply-To: <000101d35387$2dec7d40$89c577c0$@samsung.com> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Fan Li , 'Jaegeuk Kim' Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net On 2017/11/2 11:02, Fan Li wrote: > Use a slightly easier way to calculate last_nid. > > Signed-off-by: Fan li Reviewed-by: Chao Yu Thanks, > --- > fs/f2fs/node.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > index 7834097..55ab330 100644 > --- a/fs/f2fs/node.c > +++ b/fs/f2fs/node.c > @@ -2642,7 +2642,7 @@ static inline void load_free_nid_bitmap(struct f2fs_sb_info *sbi) > __set_bit_le(i, nm_i->nat_block_bitmap); > > nid = i * NAT_ENTRY_PER_BLOCK; > - last_nid = (i + 1) * NAT_ENTRY_PER_BLOCK; > + last_nid = nid + NAT_ENTRY_PER_BLOCK; > > spin_lock(&NM_I(sbi)->nid_list_lock); > for (; nid < last_nid; nid++) > -- > 2.7.4 > ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot