Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4658642imd; Tue, 30 Oct 2018 05:39:04 -0700 (PDT) X-Google-Smtp-Source: AJdET5druSIyI2QQhGaVlUuz0JKsqRw2u6yAaaqIfdCnIGMmdn+NrncDDcaxRuFmDhsqqY+oMDD2 X-Received: by 2002:a63:fb0b:: with SMTP id o11mr17803660pgh.211.1540903144329; Tue, 30 Oct 2018 05:39:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540903144; cv=none; d=google.com; s=arc-20160816; b=kwBoujN+fQrXJCSjGU2xTSdHoCkwjo3ER4yQn2Qzf9wauBivVocjMgw6Uk4E2/u2OC VRYU0hJKkHFXqCKbn1/Ayk003hL6L0THShkDZnAERy32JYSlGucyCMG2D74qLrXi+Ohn tgfRGsSTlF6ID6bjqtb3vzja/3EPdkly3Podpz1RaiBseTRv7BfDaTrK1cjRK6Qi0T6y VWsuHVhUrroIH6qbrRC6sFFeHSa3azIwlzd2MgsD6lqTblQRbbIpStuGWns4juYeLP0J KyKizEyLv7N/3q3RT0i7a5/yNTrK2mC5UmjP4pGvEY9F9Rs6X7JuYzgHZTx1nF8y+Prr YCDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=DQm7xX7Dc+uy5IO1UgsctZsJ3sCv4cti/ywGwK3Qg6M=; b=I8WATvOdjZNnQ/Rsy+FsBbqzyfwAx093Rh3lyiGXPYVb54fmSytB/vvepoe0+BksXS a2qwvrDQg4zuGAhDeQde6Z4BF0BiK5bsZjEWMqQRDphEKK53L+ct5aXnYKwd8iVtIj5j omJf5LV7aiggs0nESlus/GT01Tj4/tWVM9C1YCvOtu0y74dVPy4ehRdXX9BclPQQNAVi gNDrLF5hnGdk0dktOAEmYfFDbGdO61EWWmrkRLzXjWx2VV5ao7r9mUFBNDqi3cbMl9AD oEKevJP3EQJtHrB1n63mPVRTmBjV4GGTPTBsPS9L5Q8NZyz95FWLIeSSKkOaq1YAW+Jd uy8A== 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 y8-v6si21905332plt.271.2018.10.30.05.38.48; Tue, 30 Oct 2018 05:39:04 -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 S1727841AbeJ3Vba (ORCPT + 99 others); Tue, 30 Oct 2018 17:31:30 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:54830 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726135AbeJ3Vb3 (ORCPT ); Tue, 30 Oct 2018 17:31:29 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 1912BE998C72E; Tue, 30 Oct 2018 20:38:10 +0800 (CST) Received: from huawei.com (10.113.189.234) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Tue, 30 Oct 2018 20:38:01 +0800 From: Yunlong Song To: , , , , CC: , , , , , Subject: [PATCH v2] f2fs: change segment to section in f2fs_ioc_gc_range Date: Tue, 30 Oct 2018 20:37:55 +0800 Message-ID: <1540903075-62916-1-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1540391736-20714-1-git-send-email-yunlong.song@huawei.com> References: <1540391736-20714-1-git-send-email-yunlong.song@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.113.189.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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..f981b6c 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 += BLKS_PER_SEC(sbi); if (range.start <= end) goto do_more; out: -- 1.8.5.2