Received: by 10.223.176.5 with SMTP id f5csp2391289wra; Sun, 28 Jan 2018 19:38:59 -0800 (PST) X-Google-Smtp-Source: AH8x227Y0t+4ioZJWBtH+5GrvjsMeikr5IlxbcJ/sJYpY0lbtDflozT0JpDoEWrP0npeh/ENlUT2 X-Received: by 10.99.126.22 with SMTP id z22mr20308162pgc.231.1517197139391; Sun, 28 Jan 2018 19:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517197139; cv=none; d=google.com; s=arc-20160816; b=Gk2gIT9cxCYoctBh8E0wBjfAw+AYVgYQmRf2yjUoImszL2HONtJHAqfrDz0S+1j9yz Gyf0/pzajmLrSAjt3s7fpePFa746gjcjOIgF4MMPfVNdluw7oAEjBFdC7SobAPJCHEm3 2bbOh4U95HZfc5s13rUT70oxmzWaxdcEhuvbdyf/nbZONNaXhlgVftEK3dKiHm0rKy0r aX/T7e9yomZ6dm0Hs73ffOQt/qZPecQwuQwaejMMwDTtEZTWyZCM+CcQIwgyKgNiER7g /G6Jqrwlyise6OBir78UXRmYVDAAYn4I5txoEP8s3FEn6j5ch4Z5vyrUPJS6E9Jkx738 If7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=EmequUMeitGVvPkcywoIGqx9VgnG0knUQ9ZbbmXq3TQ=; b=cVclpmEn9QWsE06YWCzkqasSbojQ8HFsLfRYRXdlJmytUfvCYu2j4A8qKgdIvhrlvh CDjx7JtkR/k3mnpC5KBIrTNMIREnr7JZW4/ef9aktNlRbschVNQVvDDjjpt/ZE+oKjzs 7uemX3Y1MXqG7/QnZ2d2XGZlFM7OiESv0YPKCXgQznairBdC8vvmVF4WjI5OLMH4iBce zv5Zsh9KEph8rHnrLXadrNaklnQeIWaOUcUY2vEnpHl3WKhS27IupWAQ+k4JT5YT2xyr DfNcnbtiO8aFhfjZNzpGOzts7nEL90U9rq7AJHnkWVXc9ojd1AWL62JTc0pNIb9CApyx l0HQ== 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 u64si3592932pfk.340.2018.01.28.19.38.45; Sun, 28 Jan 2018 19:38:59 -0800 (PST) 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 S1751428AbeA2DiC (ORCPT + 99 others); Sun, 28 Jan 2018 22:38:02 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:42300 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750771AbeA2DiB (ORCPT ); Sun, 28 Jan 2018 22:38:01 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 49A47A44D408C; Mon, 29 Jan 2018 11:37:57 +0800 (CST) Received: from huawei.com (10.107.193.250) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.361.1; Mon, 29 Jan 2018 11:37:52 +0800 From: Yunlong Song To: , , , , CC: , , , , , , Subject: [PATCH] f2fs: fix heap mode to reset it back Date: Mon, 29 Jan 2018 11:37:45 +0800 Message-ID: <1517197065-156255-1-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 7a20b8a61eff81bdb7097a578752a74860e9d142 ("f2fs: allocate node and hot data in the beginning of partition") introduces another mount option, heap, to reset it back. But it does not do anything for heap mode, so fix it. Signed-off-by: Yunlong Song --- fs/f2fs/gc.c | 5 +++-- fs/f2fs/segment.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index aa720cc..b9d93fd 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -191,8 +191,9 @@ static void select_policy(struct f2fs_sb_info *sbi, int gc_type, if (gc_type != FG_GC && p->max_search > sbi->max_victim_search) p->max_search = sbi->max_victim_search; - /* let's select beginning hot/small space first */ - if (type == CURSEG_HOT_DATA || IS_NODESEG(type)) + /* let's select beginning hot/small space first in no_heap mode*/ + if (test_opt(sbi, NOHEAP) && + (type == CURSEG_HOT_DATA || IS_NODESEG(type))) p->offset = 0; else p->offset = SIT_I(sbi)->last_victim[p->gc_mode]; diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index e5739ce..77a48c4 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2167,7 +2167,8 @@ static unsigned int __get_next_segno(struct f2fs_sb_info *sbi, int type) if (sbi->segs_per_sec != 1) return CURSEG_I(sbi, type)->segno; - if (type == CURSEG_HOT_DATA || IS_NODESEG(type)) + if (test_opt(sbi, NOHEAP) && + (type == CURSEG_HOT_DATA || IS_NODESEG(type))) return 0; if (SIT_I(sbi)->last_victim[ALLOC_NEXT]) -- 1.8.5.2