Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp7708239pxu; Sat, 26 Dec 2020 02:12:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyc5hJxZmDXOCNgWd0csTPWePbVo4r95AEt+Y2UnhB492CV7YaseQ4w9HOnv63qClspY5eX X-Received: by 2002:a17:906:144e:: with SMTP id q14mr33603133ejc.150.1608977528946; Sat, 26 Dec 2020 02:12:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608977528; cv=none; d=google.com; s=arc-20160816; b=XrilNogxMRsITsnHVSSE2vyisO4DU+PZ9DNWJKRf083wbJvyXGsvA045LruI1/csv3 ERagP9hE/waYFWua8Uop6Ht/WPl8U5xxmvzWgpBHLvJrBzpXEdozx0NVcUZYjVyanT7K 7DyjRmV6qJpFEkLJvSPeC+zIQmrzcDRkFSjLqtzMBy81ZEOu8e+7fXm+a6YlGKg2yOZz oKYlHMt2FpklXtW5XsYTh4LR06IlcvAFZINteR6HuVY493Ejxl8wlqX3gcn0GeLs8UV1 GCxv2fcUrhy699el1bq0voqImo0migbPpeuWmhigTOs0M+Tvd2ZA9MwURIHjslRWvlK8 CleQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=VZ+O1CD7fnCsE/avWhN+qGIPpixMWkXQWuNKHB4Jb4A=; b=kT/PpkFX7AVGgjgcor0WNcP9CSXIU9dtORguGHSoQTi67l59EJI430v1xhh6fLfjwb B1hOyV2CnOtuGnbf2Xkd7wwVzANqcwfjla1k+tyV8Yz1gZDQ4v8gsdSNqFOEWAHqLayi 1V9KgTPntvU3o3Qh1In0JtIJpdxodKZi5lza/3KMPlOzFrP6Y3rscQvXbvkbXAHuwz4O /t6PSFZ3+9VOaLmTkRcbZ6D3Dns6rCduqbX0Mi5sJ8DuJpK6XrxphTWzMZ9+6axBtPHN 6HpU/Hs+BGlm5Dr4+F7XxeAwNo1QxWo5BB1Oe0WP2CQF6gpjjgvSwoex1DGy4bwAZBZO ewwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si20611481edu.567.2020.12.26.02.11.46; Sat, 26 Dec 2020 02:12:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726066AbgLZKIg (ORCPT + 99 others); Sat, 26 Dec 2020 05:08:36 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9996 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbgLZKIg (ORCPT ); Sat, 26 Dec 2020 05:08:36 -0500 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4D2zxl62b9zhvX6; Sat, 26 Dec 2020 18:07:07 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Sat, 26 Dec 2020 18:07:47 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH] f2fs: relocate f2fs_precache_extents() Date: Sat, 26 Dec 2020 18:07:41 +0800 Message-ID: <20201226100741.30307-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Relocate f2fs_precache_extents() in prior to check_swap_activate(), then extent cache can be enabled before its use. Signed-off-by: Chao Yu --- fs/f2fs/data.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index baa9ccf84e2c..3a6d848b7e38 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -4129,12 +4129,13 @@ static int f2fs_swap_activate(struct swap_info_struct *sis, struct file *file, if (!f2fs_disable_compressed_file(inode)) return -EINVAL; + f2fs_precache_extents(inode); + ret = check_swap_activate(sis, file, span); if (ret < 0) return ret; set_inode_flag(inode, FI_PIN_FILE); - f2fs_precache_extents(inode); f2fs_update_time(F2FS_I_SB(inode), REQ_TIME); return ret; } -- 2.29.2