Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1296108ima; Wed, 24 Oct 2018 18:47:51 -0700 (PDT) X-Google-Smtp-Source: AJdET5fRPr9YusfMoLXWpauCYUawBOcHvLQGDdIFcxJKbU9Xfwm3OXzQZ0xwFQMSXknOk4xnmJC8 X-Received: by 2002:a63:d945:: with SMTP id e5-v6mr4794480pgj.24.1540432071353; Wed, 24 Oct 2018 18:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540432071; cv=none; d=google.com; s=arc-20160816; b=bFJldluAEyFYn7mhpfQ2HzAdIF8odN4PqcZw+ZUiXZ1WnS7C1l6zGfWjeKiHNCaKRq ReM23u++LQvrKhb5x1GYs24X8RTQ71NOXVFrwAV9LXoletseOS1Z3rDCCxVPXOktaIR+ WBQMv99KZ2eDos9SnsB19LDcckAbXwfrGue2F4krU9DK2Z/3khcmsGlgM1FMJ76NQ5aU JaI/Lwb/pa1MdYcXy2ojzTq97J3RYN0WwWQy7UwKcGgtL6raHOEInlAZNTjcJUgJQBKc 5Ls8kYTm5t/1C51jN/4Q7avDunYWEzM8RlTC6ZKOkPr8xOpl99Mjqd8SuIaUyFUb35YC HncQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1uUUXd8fGrzJTMxtR1886EqwLqN4lkdYqw3oE7X5nsQ=; b=g9uRegmmeP54uN+FAPX68KHe4OU8lsRj25U0rucHWE0PkxzFcg5pPtqd1UHffRShVa ndfiiXw52sUX8bc9/rWryfyD8Giy7mPzZYRmeyn//jKSHpdNyg+ko1SNYtv/t7x+o2rc mNyWZ477QU3XveZMWTOW/q5hjgdyGh8d/sAXEw/4gd+ggcERYOLcIsDSES6sgtfC5gQg 2d+IUgI3RrwT5SRluRLsgH0MvdAiWU4PJc1+X+tsMh5oiVvixPP0p7G36SHmnxXHUk8U Yn/+lVNuyAPa/2yi66ThSApPB+PqlM5QFblC2z7tLhfQqcxkPXhE5TclLlq0ksU2tQvJ BJVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15-v6si4586764pgv.437.2018.10.24.18.47.32; Wed, 24 Oct 2018 18:47:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726465AbeJYKRc (ORCPT + 99 others); Thu, 25 Oct 2018 06:17:32 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52127 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726204AbeJYKRc (ORCPT ); Thu, 25 Oct 2018 06:17:32 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id F3C86E5250499; Thu, 25 Oct 2018 09:46:57 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.408.0; Thu, 25 Oct 2018 09:46:50 +0800 Subject: Re: [PATCH] f2fs: change segment to section in f2fs_ioc_gc_range To: Yunlong Song , , , CC: , , , , , References: <1540391736-20714-1-git-send-email-yunlong.song@huawei.com> From: Chao Yu Message-ID: <1dedda7c-edf5-82ae-787b-c2276e7c7275@huawei.com> Date: Thu, 25 Oct 2018 09:46:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1540391736-20714-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/10/24 22:35, Yunlong Song wrote: > f2fs_ioc_gc_range skips blocks_per_seg each time, however, f2fs_gc moves > blocks of section each time, so fix it from segment to section. I'm okay with this change, BTW, I notice that I need to change it to use sbi->blocks_per_seg * sbi->migration_granularity in my patchset if this patch being merged firstly. > > Signed-off-by: Yunlong Song > --- > fs/f2fs/file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > index 88b1246..8c06724 100644 > --- a/fs/f2fs/file.c > +++ b/fs/f2fs/file.c > @@ -2155,7 +2155,7 @@ static int f2fs_ioc_gc_range(struct file *filp, unsigned long arg) > } > > ret = f2fs_gc(sbi, range.sync, true, GET_SEGNO(sbi, range.start)); > - range.start += sbi->blocks_per_seg; > + range.start += sbi->blocks_per_seg * sbi->segs_per_sec; use BLKS_PER_SEC() for cleanup? > if (range.start <= end) > goto do_more; > out: >