Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753159AbdHODdB (ORCPT ); Mon, 14 Aug 2017 23:33:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:52926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222AbdHODc7 (ORCPT ); Mon, 14 Aug 2017 23:32:59 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D58322B55 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jaegeuk@kernel.org Date: Mon, 14 Aug 2017 20:32:58 -0700 From: Jaegeuk Kim To: Yunlong Song Cc: chao@kernel.org, yuchao0@huawei.com, yunlong.song@icloud.com, miaoxie@huawei.com, bintian.wang@huawei.com, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: free_user_blocks should use reserved_segments instead Message-ID: <20170815033258.GD91145@jaegeuk-macbookpro.roam.corp.google.com> References: <1502702552-78497-1-git-send-email-yunlong.song@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1502702552-78497-1-git-send-email-yunlong.song@huawei.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 959 Lines: 32 On 08/14, Yunlong Song wrote: > The part (overprovision_segments - reserved_segments) can still be used for LFS, > so free_use_blocks should use reserved_segments instead, rather than use > overprovision_segments. > > Signed-off-by: Yunlong Song > --- > fs/f2fs/gc.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/gc.h b/fs/f2fs/gc.h > index 9325191..6258305 100644 > --- a/fs/f2fs/gc.h > +++ b/fs/f2fs/gc.h > @@ -49,10 +49,10 @@ struct gc_inode_list { > */ > static inline block_t free_user_blocks(struct f2fs_sb_info *sbi) NAK. This gives user-visible block count. > { > - if (free_segments(sbi) < overprovision_segments(sbi)) > + if (free_segments(sbi) < reserved_segments(sbi)) > return 0; > else > - return (free_segments(sbi) - overprovision_segments(sbi)) > + return (free_segments(sbi) - reserved_segments(sbi)) > << sbi->log_blocks_per_seg; > } > > -- > 1.8.5.2