Message ID | 20221205185433.3479699-1-jaegeuk@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2422534wrr; Mon, 5 Dec 2022 10:59:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf4fknugvc+jcvXhFbHlmzjSaU6udVkku/URW6XEhhHnYrGa/pduj89rp+OGoI/tcJIwyIkz X-Received: by 2002:a05:6402:124a:b0:46b:8e9e:876 with SMTP id l10-20020a056402124a00b0046b8e9e0876mr24601434edw.232.1670266744675; Mon, 05 Dec 2022 10:59:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670266744; cv=none; d=google.com; s=arc-20160816; b=H1C19rhkPdLfFX18EUqszuZD+hdnpPWtWMbM3bkNJX0vggxxNDhqJ56SHazTnNoOoI fF0ObRCG25OObR0fej4XzGHG2uKkv50iF7La4+CTT1nRe9vKcSwxTQYNzfpQzD21wg1l WuUiGJ4JfGw68zjYWpQp+NBGsNqyPL4YVrPfnf8GB1nRjmIWXhDbkkMadrJrHVy5j5Bz lsrLGECKBnZkP0zw1SZPZxZYAJ0HhJKKL65SnpbPrATtxGkc3wMfIw54a5mNRN6abgVY mnzfEgyrc2Y+31PWioJP38/Mpf1MyTWa8VGfq8vZ1L8Ym27MF/C6x4TDYbahDBbHm2KS xk2Q== 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:dkim-signature; bh=S+ftk/33ak27DCJeAb7bFFnQxlJ+JQ5N6OYVqUQ/seU=; b=b2xQOzDAAQvGIrAENzizmiM8KxsTqy1Zm/RnyP4Hu0Fp+xQ+UcHzIt/r5Eg0DtXYPd +PUweoPphSCBHiHvF/A98u1xnk/mocyoveCM6KuWWy2HUR2dAUaDKFE0/p13KKC4a5/6 wryWUjWwImlcPCIT3SAXYwB4e6wKIhO/+nvhsJKD/uIVJgK+ZmhX4TyYPng/nxIOCmeO MANx0yYUWrrYyKzrcsgsvVP86rw7QTXJc3+KxCRiDTSs5Cdr/A/eJu/PlgJ7HLXwqBh9 0YqxAMdR5LTieD4mtqu+t6uxgoJRZIpUxAZ+STxHONwBtgSNA9DPxfKjXZbmtxkwX4Ca XDZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cI/goZ3A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020aa7d74a000000b0046b1abd7884si212747eds.108.2022.12.05.10.58.41; Mon, 05 Dec 2022 10:59:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="cI/goZ3A"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231722AbiLESy5 (ORCPT <rfc822;jaysivo@gmail.com> + 99 others); Mon, 5 Dec 2022 13:54:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232429AbiLESyy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 5 Dec 2022 13:54:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F175C205C5 for <linux-kernel@vger.kernel.org>; Mon, 5 Dec 2022 10:54:50 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7E5EF612FC for <linux-kernel@vger.kernel.org>; Mon, 5 Dec 2022 18:54:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9807C433D6; Mon, 5 Dec 2022 18:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670266489; bh=437LbcUfnuo/BgLD2e3LaAiMFiUyT2NdfywCgO5SUQs=; h=From:To:Cc:Subject:Date:From; b=cI/goZ3A7Tzy6BdhQQRpTHIYhI2d92B1t/MiFVRHE/wtRMdX+sKSaCHGfwVBCCKGB iSejFMdEMy1AdBdR1O6WQti2IOAvXi/YhugtZ8bmSgw22SyOGqsN/njKqe7aTC9eJP r4V7mMQKshBmbVRai/0KJMU1W1j0cbypJlQ2jnWQUZUn+62A/qXtVAKcGi6XUoSJ2Y 9jdbIBfDprimvW07uhmHGJq4Rb57dJrkmwKmhEAi7ukRM7uKiCMex0PZHtvAeHAIk/ rKkUV7oEkfHyMHmoYjJaqO+Nnc7w6oDXJyGl0ceQiGyysK5xIhaO1g60qxhysmjA7x csQoVJk2vYSVg== From: Jaegeuk Kim <jaegeuk@kernel.org> To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim <jaegeuk@kernel.org> Subject: [PATCH 1/6] f2fs: specify extent cache for read explicitly Date: Mon, 5 Dec 2022 10:54:28 -0800 Message-Id: <20221205185433.3479699-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.39.0.rc0.267.gcb52ba06e7-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751401621801776914?= X-GMAIL-MSGID: =?utf-8?q?1751401621801776914?= |
Series |
[1/6] f2fs: specify extent cache for read explicitly
|
|
Commit Message
Jaegeuk Kim
Dec. 5, 2022, 6:54 p.m. UTC
Let's descrbie it's read extent cache.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/extent_cache.c | 4 ++--
fs/f2fs/f2fs.h | 10 +++++-----
fs/f2fs/inode.c | 2 +-
fs/f2fs/node.c | 2 +-
fs/f2fs/node.h | 2 +-
fs/f2fs/segment.c | 4 ++--
fs/f2fs/super.c | 16 ++++++++--------
7 files changed, 20 insertions(+), 20 deletions(-)
Comments
On 2022/12/6 2:54, Jaegeuk Kim wrote: > Let's descrbie it's read extent cache. > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> > --- > fs/f2fs/extent_cache.c | 4 ++-- > fs/f2fs/f2fs.h | 10 +++++----- > fs/f2fs/inode.c | 2 +- > fs/f2fs/node.c | 2 +- > fs/f2fs/node.h | 2 +- > fs/f2fs/segment.c | 4 ++-- > fs/f2fs/super.c | 16 ++++++++-------- > 7 files changed, 20 insertions(+), 20 deletions(-) > > diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c > index 932c070173b9..8cd87aee0292 100644 > --- a/fs/f2fs/extent_cache.c > +++ b/fs/f2fs/extent_cache.c > @@ -383,7 +383,7 @@ static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage) > if (!i_ext || !i_ext->len) > return; > > - get_extent_info(&ei, i_ext); > + get_read_extent_info(&ei, i_ext); > > write_lock(&et->lock); > if (atomic_read(&et->node_cnt)) > @@ -710,7 +710,7 @@ unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink) > unsigned int node_cnt = 0, tree_cnt = 0; > int remained; > > - if (!test_opt(sbi, EXTENT_CACHE)) > + if (!test_opt(sbi, READ_EXTENT_CACHE)) > return 0; > > if (!atomic_read(&sbi->total_zombie_tree)) > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > index eb8c27c4e5fc..1c39f8145b61 100644 > --- a/fs/f2fs/f2fs.h > +++ b/fs/f2fs/f2fs.h > @@ -92,7 +92,7 @@ extern const char *f2fs_fault_name[FAULT_MAX]; > #define F2FS_MOUNT_FLUSH_MERGE 0x00000400 > #define F2FS_MOUNT_NOBARRIER 0x00000800 > #define F2FS_MOUNT_FASTBOOT 0x00001000 > -#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 > +#define F2FS_MOUNT_READ_EXTENT_CACHE 0x00002000 > #define F2FS_MOUNT_DATA_FLUSH 0x00008000 > #define F2FS_MOUNT_FAULT_INJECTION 0x00010000 > #define F2FS_MOUNT_USRQUOTA 0x00080000 > @@ -600,7 +600,7 @@ enum { > #define F2FS_MIN_EXTENT_LEN 64 /* minimum extent length */ > > /* number of extent info in extent cache we try to shrink */ > -#define EXTENT_CACHE_SHRINK_NUMBER 128 > +#define READ_EXTENT_CACHE_SHRINK_NUMBER 128 > > #define RECOVERY_MAX_RA_BLOCKS BIO_MAX_VECS > #define RECOVERY_MIN_RA_BLOCKS 1 > @@ -830,7 +830,7 @@ struct f2fs_inode_info { > loff_t original_i_size; /* original i_size before atomic write */ > }; > > -static inline void get_extent_info(struct extent_info *ext, > +static inline void get_read_extent_info(struct extent_info *ext, > struct f2fs_extent *i_ext) > { > ext->fofs = le32_to_cpu(i_ext->fofs); > @@ -838,7 +838,7 @@ static inline void get_extent_info(struct extent_info *ext, > ext->len = le32_to_cpu(i_ext->len); > } > > -static inline void set_raw_extent(struct extent_info *ext, > +static inline void set_raw_read_extent(struct extent_info *ext, > struct f2fs_extent *i_ext) > { > i_ext->fofs = cpu_to_le32(ext->fofs); > @@ -4407,7 +4407,7 @@ static inline bool f2fs_may_extent_tree(struct inode *inode) > { > struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > > - if (!test_opt(sbi, EXTENT_CACHE) || > + if (!test_opt(sbi, READ_EXTENT_CACHE) || > is_inode_flag_set(inode, FI_NO_EXTENT) || > (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && > !f2fs_sb_has_readonly(sbi))) > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > index 577f109b4e1d..2c705c60019b 100644 > --- a/fs/f2fs/inode.c > +++ b/fs/f2fs/inode.c > @@ -629,7 +629,7 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) > > if (et) { > read_lock(&et->lock); > - set_raw_extent(&et->largest, &ri->i_ext); > + set_raw_read_extent(&et->largest, &ri->i_ext); > read_unlock(&et->lock); > } else { > memset(&ri->i_ext, 0, sizeof(ri->i_ext)); > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > index b9ee5a1176a0..84b147966080 100644 > --- a/fs/f2fs/node.c > +++ b/fs/f2fs/node.c > @@ -85,7 +85,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type) > sizeof(struct ino_entry); > mem_size >>= PAGE_SHIFT; > res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1); > - } else if (type == EXTENT_CACHE) { > + } else if (type == READ_EXTENT_CACHE) { > mem_size = (atomic_read(&sbi->total_ext_tree) * > sizeof(struct extent_tree) + > atomic_read(&sbi->total_ext_node) * > diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h > index 3c09cae058b0..0aa48704c77a 100644 > --- a/fs/f2fs/node.h > +++ b/fs/f2fs/node.h > @@ -146,7 +146,7 @@ enum mem_type { > NAT_ENTRIES, /* indicates the cached nat entry */ > DIRTY_DENTS, /* indicates dirty dentry pages */ > INO_ENTRIES, /* indicates inode entries */ > - EXTENT_CACHE, /* indicates extent cache */ > + READ_EXTENT_CACHE, /* indicates read extent cache */ > DISCARD_CACHE, /* indicates memory of cached discard cmds */ > COMPRESS_PAGE, /* indicates memory of cached compressed pages */ > BASE_CHECK, /* check kernel status */ > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 9486ca49ecb1..51de358bc452 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -449,8 +449,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg) > return; > > /* try to shrink extent cache when there is no enough memory */ > - if (!f2fs_available_free_memory(sbi, EXTENT_CACHE)) > - f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER); > + if (!f2fs_available_free_memory(sbi, READ_EXTENT_CACHE)) > + f2fs_shrink_extent_tree(sbi, READ_EXTENT_CACHE_SHRINK_NUMBER); > > /* check the # of cached NAT entries */ > if (!f2fs_available_free_memory(sbi, NAT_ENTRIES)) > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > index 79bf1faf4161..10bd03bbefec 100644 > --- a/fs/f2fs/super.c > +++ b/fs/f2fs/super.c > @@ -814,10 +814,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) > set_opt(sbi, FASTBOOT); > break; > case Opt_extent_cache: > - set_opt(sbi, EXTENT_CACHE); > + set_opt(sbi, READ_EXTENT_CACHE); > break; > case Opt_noextent_cache: > - clear_opt(sbi, EXTENT_CACHE); > + clear_opt(sbi, READ_EXTENT_CACHE); > break; > case Opt_noinline_data: > clear_opt(sbi, INLINE_DATA); > @@ -1954,10 +1954,10 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) > seq_puts(seq, ",barrier"); > if (test_opt(sbi, FASTBOOT)) > seq_puts(seq, ",fastboot"); > - if (test_opt(sbi, EXTENT_CACHE)) > - seq_puts(seq, ",extent_cache"); > + if (test_opt(sbi, READ_EXTENT_CACHE)) > + seq_puts(seq, ",read_extent_cache"); How about keeping consistent w/ description of f2fs.rst? > else > - seq_puts(seq, ",noextent_cache"); > + seq_puts(seq, ",no_read_extent_cache"); Ditto, Thanks, > if (test_opt(sbi, DATA_FLUSH)) > seq_puts(seq, ",data_flush"); > > @@ -2076,7 +2076,7 @@ static void default_options(struct f2fs_sb_info *sbi) > set_opt(sbi, INLINE_XATTR); > set_opt(sbi, INLINE_DATA); > set_opt(sbi, INLINE_DENTRY); > - set_opt(sbi, EXTENT_CACHE); > + set_opt(sbi, READ_EXTENT_CACHE); > set_opt(sbi, NOHEAP); > clear_opt(sbi, DISABLE_CHECKPOINT); > set_opt(sbi, MERGE_CHECKPOINT); > @@ -2218,7 +2218,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) > bool need_restart_ckpt = false, need_stop_ckpt = false; > bool need_restart_flush = false, need_stop_flush = false; > bool need_restart_discard = false, need_stop_discard = false; > - bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE); > + bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE); > bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT); > bool no_io_align = !F2FS_IO_ALIGNED(sbi); > bool no_atgc = !test_opt(sbi, ATGC); > @@ -2308,7 +2308,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) > } > > /* disallow enable/disable extent_cache dynamically */ > - if (no_extent_cache == !!test_opt(sbi, EXTENT_CACHE)) { > + if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) { > err = -EINVAL; > f2fs_warn(sbi, "switch extent_cache option is not allowed"); > goto restore_opts;
On 12/08, Chao Yu wrote: > On 2022/12/6 2:54, Jaegeuk Kim wrote: > > Let's descrbie it's read extent cache. > > > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> > > --- > > fs/f2fs/extent_cache.c | 4 ++-- > > fs/f2fs/f2fs.h | 10 +++++----- > > fs/f2fs/inode.c | 2 +- > > fs/f2fs/node.c | 2 +- > > fs/f2fs/node.h | 2 +- > > fs/f2fs/segment.c | 4 ++-- > > fs/f2fs/super.c | 16 ++++++++-------- > > 7 files changed, 20 insertions(+), 20 deletions(-) > > > > diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c > > index 932c070173b9..8cd87aee0292 100644 > > --- a/fs/f2fs/extent_cache.c > > +++ b/fs/f2fs/extent_cache.c > > @@ -383,7 +383,7 @@ static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage) > > if (!i_ext || !i_ext->len) > > return; > > - get_extent_info(&ei, i_ext); > > + get_read_extent_info(&ei, i_ext); > > write_lock(&et->lock); > > if (atomic_read(&et->node_cnt)) > > @@ -710,7 +710,7 @@ unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink) > > unsigned int node_cnt = 0, tree_cnt = 0; > > int remained; > > - if (!test_opt(sbi, EXTENT_CACHE)) > > + if (!test_opt(sbi, READ_EXTENT_CACHE)) > > return 0; > > if (!atomic_read(&sbi->total_zombie_tree)) > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > > index eb8c27c4e5fc..1c39f8145b61 100644 > > --- a/fs/f2fs/f2fs.h > > +++ b/fs/f2fs/f2fs.h > > @@ -92,7 +92,7 @@ extern const char *f2fs_fault_name[FAULT_MAX]; > > #define F2FS_MOUNT_FLUSH_MERGE 0x00000400 > > #define F2FS_MOUNT_NOBARRIER 0x00000800 > > #define F2FS_MOUNT_FASTBOOT 0x00001000 > > -#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 > > +#define F2FS_MOUNT_READ_EXTENT_CACHE 0x00002000 > > #define F2FS_MOUNT_DATA_FLUSH 0x00008000 > > #define F2FS_MOUNT_FAULT_INJECTION 0x00010000 > > #define F2FS_MOUNT_USRQUOTA 0x00080000 > > @@ -600,7 +600,7 @@ enum { > > #define F2FS_MIN_EXTENT_LEN 64 /* minimum extent length */ > > /* number of extent info in extent cache we try to shrink */ > > -#define EXTENT_CACHE_SHRINK_NUMBER 128 > > +#define READ_EXTENT_CACHE_SHRINK_NUMBER 128 > > #define RECOVERY_MAX_RA_BLOCKS BIO_MAX_VECS > > #define RECOVERY_MIN_RA_BLOCKS 1 > > @@ -830,7 +830,7 @@ struct f2fs_inode_info { > > loff_t original_i_size; /* original i_size before atomic write */ > > }; > > -static inline void get_extent_info(struct extent_info *ext, > > +static inline void get_read_extent_info(struct extent_info *ext, > > struct f2fs_extent *i_ext) > > { > > ext->fofs = le32_to_cpu(i_ext->fofs); > > @@ -838,7 +838,7 @@ static inline void get_extent_info(struct extent_info *ext, > > ext->len = le32_to_cpu(i_ext->len); > > } > > -static inline void set_raw_extent(struct extent_info *ext, > > +static inline void set_raw_read_extent(struct extent_info *ext, > > struct f2fs_extent *i_ext) > > { > > i_ext->fofs = cpu_to_le32(ext->fofs); > > @@ -4407,7 +4407,7 @@ static inline bool f2fs_may_extent_tree(struct inode *inode) > > { > > struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > > - if (!test_opt(sbi, EXTENT_CACHE) || > > + if (!test_opt(sbi, READ_EXTENT_CACHE) || > > is_inode_flag_set(inode, FI_NO_EXTENT) || > > (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && > > !f2fs_sb_has_readonly(sbi))) > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > index 577f109b4e1d..2c705c60019b 100644 > > --- a/fs/f2fs/inode.c > > +++ b/fs/f2fs/inode.c > > @@ -629,7 +629,7 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) > > if (et) { > > read_lock(&et->lock); > > - set_raw_extent(&et->largest, &ri->i_ext); > > + set_raw_read_extent(&et->largest, &ri->i_ext); > > read_unlock(&et->lock); > > } else { > > memset(&ri->i_ext, 0, sizeof(ri->i_ext)); > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > > index b9ee5a1176a0..84b147966080 100644 > > --- a/fs/f2fs/node.c > > +++ b/fs/f2fs/node.c > > @@ -85,7 +85,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type) > > sizeof(struct ino_entry); > > mem_size >>= PAGE_SHIFT; > > res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1); > > - } else if (type == EXTENT_CACHE) { > > + } else if (type == READ_EXTENT_CACHE) { > > mem_size = (atomic_read(&sbi->total_ext_tree) * > > sizeof(struct extent_tree) + > > atomic_read(&sbi->total_ext_node) * > > diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h > > index 3c09cae058b0..0aa48704c77a 100644 > > --- a/fs/f2fs/node.h > > +++ b/fs/f2fs/node.h > > @@ -146,7 +146,7 @@ enum mem_type { > > NAT_ENTRIES, /* indicates the cached nat entry */ > > DIRTY_DENTS, /* indicates dirty dentry pages */ > > INO_ENTRIES, /* indicates inode entries */ > > - EXTENT_CACHE, /* indicates extent cache */ > > + READ_EXTENT_CACHE, /* indicates read extent cache */ > > DISCARD_CACHE, /* indicates memory of cached discard cmds */ > > COMPRESS_PAGE, /* indicates memory of cached compressed pages */ > > BASE_CHECK, /* check kernel status */ > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > > index 9486ca49ecb1..51de358bc452 100644 > > --- a/fs/f2fs/segment.c > > +++ b/fs/f2fs/segment.c > > @@ -449,8 +449,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg) > > return; > > /* try to shrink extent cache when there is no enough memory */ > > - if (!f2fs_available_free_memory(sbi, EXTENT_CACHE)) > > - f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER); > > + if (!f2fs_available_free_memory(sbi, READ_EXTENT_CACHE)) > > + f2fs_shrink_extent_tree(sbi, READ_EXTENT_CACHE_SHRINK_NUMBER); > > /* check the # of cached NAT entries */ > > if (!f2fs_available_free_memory(sbi, NAT_ENTRIES)) > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > > index 79bf1faf4161..10bd03bbefec 100644 > > --- a/fs/f2fs/super.c > > +++ b/fs/f2fs/super.c > > @@ -814,10 +814,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) > > set_opt(sbi, FASTBOOT); > > break; > > case Opt_extent_cache: > > - set_opt(sbi, EXTENT_CACHE); > > + set_opt(sbi, READ_EXTENT_CACHE); > > break; > > case Opt_noextent_cache: > > - clear_opt(sbi, EXTENT_CACHE); > > + clear_opt(sbi, READ_EXTENT_CACHE); > > break; > > case Opt_noinline_data: > > clear_opt(sbi, INLINE_DATA); > > @@ -1954,10 +1954,10 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) > > seq_puts(seq, ",barrier"); > > if (test_opt(sbi, FASTBOOT)) > > seq_puts(seq, ",fastboot"); > > - if (test_opt(sbi, EXTENT_CACHE)) > > - seq_puts(seq, ",extent_cache"); > > + if (test_opt(sbi, READ_EXTENT_CACHE)) > > + seq_puts(seq, ",read_extent_cache"); > > How about keeping consistent w/ description of f2fs.rst? This doesn't change the mount options, but do show the exact name which would be better to say what's going on. > > > else > > - seq_puts(seq, ",noextent_cache"); > > + seq_puts(seq, ",no_read_extent_cache"); > > Ditto, > > Thanks, > > > if (test_opt(sbi, DATA_FLUSH)) > > seq_puts(seq, ",data_flush"); > > @@ -2076,7 +2076,7 @@ static void default_options(struct f2fs_sb_info *sbi) > > set_opt(sbi, INLINE_XATTR); > > set_opt(sbi, INLINE_DATA); > > set_opt(sbi, INLINE_DENTRY); > > - set_opt(sbi, EXTENT_CACHE); > > + set_opt(sbi, READ_EXTENT_CACHE); > > set_opt(sbi, NOHEAP); > > clear_opt(sbi, DISABLE_CHECKPOINT); > > set_opt(sbi, MERGE_CHECKPOINT); > > @@ -2218,7 +2218,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) > > bool need_restart_ckpt = false, need_stop_ckpt = false; > > bool need_restart_flush = false, need_stop_flush = false; > > bool need_restart_discard = false, need_stop_discard = false; > > - bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE); > > + bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE); > > bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT); > > bool no_io_align = !F2FS_IO_ALIGNED(sbi); > > bool no_atgc = !test_opt(sbi, ATGC); > > @@ -2308,7 +2308,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) > > } > > /* disallow enable/disable extent_cache dynamically */ > > - if (no_extent_cache == !!test_opt(sbi, EXTENT_CACHE)) { > > + if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) { > > err = -EINVAL; > > f2fs_warn(sbi, "switch extent_cache option is not allowed"); > > goto restore_opts;
On 2022/12/9 1:29, Jaegeuk Kim wrote: > On 12/08, Chao Yu wrote: >> On 2022/12/6 2:54, Jaegeuk Kim wrote: >>> Let's descrbie it's read extent cache. >>> >>> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> >>> --- >>> fs/f2fs/extent_cache.c | 4 ++-- >>> fs/f2fs/f2fs.h | 10 +++++----- >>> fs/f2fs/inode.c | 2 +- >>> fs/f2fs/node.c | 2 +- >>> fs/f2fs/node.h | 2 +- >>> fs/f2fs/segment.c | 4 ++-- >>> fs/f2fs/super.c | 16 ++++++++-------- >>> 7 files changed, 20 insertions(+), 20 deletions(-) >>> >>> diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c >>> index 932c070173b9..8cd87aee0292 100644 >>> --- a/fs/f2fs/extent_cache.c >>> +++ b/fs/f2fs/extent_cache.c >>> @@ -383,7 +383,7 @@ static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage) >>> if (!i_ext || !i_ext->len) >>> return; >>> - get_extent_info(&ei, i_ext); >>> + get_read_extent_info(&ei, i_ext); >>> write_lock(&et->lock); >>> if (atomic_read(&et->node_cnt)) >>> @@ -710,7 +710,7 @@ unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink) >>> unsigned int node_cnt = 0, tree_cnt = 0; >>> int remained; >>> - if (!test_opt(sbi, EXTENT_CACHE)) >>> + if (!test_opt(sbi, READ_EXTENT_CACHE)) >>> return 0; >>> if (!atomic_read(&sbi->total_zombie_tree)) >>> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h >>> index eb8c27c4e5fc..1c39f8145b61 100644 >>> --- a/fs/f2fs/f2fs.h >>> +++ b/fs/f2fs/f2fs.h >>> @@ -92,7 +92,7 @@ extern const char *f2fs_fault_name[FAULT_MAX]; >>> #define F2FS_MOUNT_FLUSH_MERGE 0x00000400 >>> #define F2FS_MOUNT_NOBARRIER 0x00000800 >>> #define F2FS_MOUNT_FASTBOOT 0x00001000 >>> -#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 >>> +#define F2FS_MOUNT_READ_EXTENT_CACHE 0x00002000 >>> #define F2FS_MOUNT_DATA_FLUSH 0x00008000 >>> #define F2FS_MOUNT_FAULT_INJECTION 0x00010000 >>> #define F2FS_MOUNT_USRQUOTA 0x00080000 >>> @@ -600,7 +600,7 @@ enum { >>> #define F2FS_MIN_EXTENT_LEN 64 /* minimum extent length */ >>> /* number of extent info in extent cache we try to shrink */ >>> -#define EXTENT_CACHE_SHRINK_NUMBER 128 >>> +#define READ_EXTENT_CACHE_SHRINK_NUMBER 128 >>> #define RECOVERY_MAX_RA_BLOCKS BIO_MAX_VECS >>> #define RECOVERY_MIN_RA_BLOCKS 1 >>> @@ -830,7 +830,7 @@ struct f2fs_inode_info { >>> loff_t original_i_size; /* original i_size before atomic write */ >>> }; >>> -static inline void get_extent_info(struct extent_info *ext, >>> +static inline void get_read_extent_info(struct extent_info *ext, >>> struct f2fs_extent *i_ext) >>> { >>> ext->fofs = le32_to_cpu(i_ext->fofs); >>> @@ -838,7 +838,7 @@ static inline void get_extent_info(struct extent_info *ext, >>> ext->len = le32_to_cpu(i_ext->len); >>> } >>> -static inline void set_raw_extent(struct extent_info *ext, >>> +static inline void set_raw_read_extent(struct extent_info *ext, >>> struct f2fs_extent *i_ext) >>> { >>> i_ext->fofs = cpu_to_le32(ext->fofs); >>> @@ -4407,7 +4407,7 @@ static inline bool f2fs_may_extent_tree(struct inode *inode) >>> { >>> struct f2fs_sb_info *sbi = F2FS_I_SB(inode); >>> - if (!test_opt(sbi, EXTENT_CACHE) || >>> + if (!test_opt(sbi, READ_EXTENT_CACHE) || >>> is_inode_flag_set(inode, FI_NO_EXTENT) || >>> (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && >>> !f2fs_sb_has_readonly(sbi))) >>> diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c >>> index 577f109b4e1d..2c705c60019b 100644 >>> --- a/fs/f2fs/inode.c >>> +++ b/fs/f2fs/inode.c >>> @@ -629,7 +629,7 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) >>> if (et) { >>> read_lock(&et->lock); >>> - set_raw_extent(&et->largest, &ri->i_ext); >>> + set_raw_read_extent(&et->largest, &ri->i_ext); >>> read_unlock(&et->lock); >>> } else { >>> memset(&ri->i_ext, 0, sizeof(ri->i_ext)); >>> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c >>> index b9ee5a1176a0..84b147966080 100644 >>> --- a/fs/f2fs/node.c >>> +++ b/fs/f2fs/node.c >>> @@ -85,7 +85,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type) >>> sizeof(struct ino_entry); >>> mem_size >>= PAGE_SHIFT; >>> res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1); >>> - } else if (type == EXTENT_CACHE) { >>> + } else if (type == READ_EXTENT_CACHE) { >>> mem_size = (atomic_read(&sbi->total_ext_tree) * >>> sizeof(struct extent_tree) + >>> atomic_read(&sbi->total_ext_node) * >>> diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h >>> index 3c09cae058b0..0aa48704c77a 100644 >>> --- a/fs/f2fs/node.h >>> +++ b/fs/f2fs/node.h >>> @@ -146,7 +146,7 @@ enum mem_type { >>> NAT_ENTRIES, /* indicates the cached nat entry */ >>> DIRTY_DENTS, /* indicates dirty dentry pages */ >>> INO_ENTRIES, /* indicates inode entries */ >>> - EXTENT_CACHE, /* indicates extent cache */ >>> + READ_EXTENT_CACHE, /* indicates read extent cache */ >>> DISCARD_CACHE, /* indicates memory of cached discard cmds */ >>> COMPRESS_PAGE, /* indicates memory of cached compressed pages */ >>> BASE_CHECK, /* check kernel status */ >>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c >>> index 9486ca49ecb1..51de358bc452 100644 >>> --- a/fs/f2fs/segment.c >>> +++ b/fs/f2fs/segment.c >>> @@ -449,8 +449,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg) >>> return; >>> /* try to shrink extent cache when there is no enough memory */ >>> - if (!f2fs_available_free_memory(sbi, EXTENT_CACHE)) >>> - f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER); >>> + if (!f2fs_available_free_memory(sbi, READ_EXTENT_CACHE)) >>> + f2fs_shrink_extent_tree(sbi, READ_EXTENT_CACHE_SHRINK_NUMBER); >>> /* check the # of cached NAT entries */ >>> if (!f2fs_available_free_memory(sbi, NAT_ENTRIES)) >>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c >>> index 79bf1faf4161..10bd03bbefec 100644 >>> --- a/fs/f2fs/super.c >>> +++ b/fs/f2fs/super.c >>> @@ -814,10 +814,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) >>> set_opt(sbi, FASTBOOT); >>> break; >>> case Opt_extent_cache: >>> - set_opt(sbi, EXTENT_CACHE); >>> + set_opt(sbi, READ_EXTENT_CACHE); >>> break; >>> case Opt_noextent_cache: >>> - clear_opt(sbi, EXTENT_CACHE); >>> + clear_opt(sbi, READ_EXTENT_CACHE); >>> break; >>> case Opt_noinline_data: >>> clear_opt(sbi, INLINE_DATA); >>> @@ -1954,10 +1954,10 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) >>> seq_puts(seq, ",barrier"); >>> if (test_opt(sbi, FASTBOOT)) >>> seq_puts(seq, ",fastboot"); >>> - if (test_opt(sbi, EXTENT_CACHE)) >>> - seq_puts(seq, ",extent_cache"); >>> + if (test_opt(sbi, READ_EXTENT_CACHE)) >>> + seq_puts(seq, ",read_extent_cache"); >> >> How about keeping consistent w/ description of f2fs.rst? > > This doesn't change the mount options, but do show the exact name which > would be better to say what's going on. mount -t f2fs /dev/vda /mnt/f2fs mount|grep f2fs /dev/vda on /mnt/f2fs type f2fs (rw,relatime,lazytime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,barrier,read_extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,check) mount -t f2fs -o remount /mnt/f2fs/ [ 63.142480] F2FS-fs (vda): Unrecognized mount option "read_extent_cache" or missing value Quoted from manual of mount "mount -o remount,rw /dir After this call, mount reads fstab and merges these options with the options from the command line (-o). If no mountpoint is found in fstab, then a remount with unspecified source is allowed." I guess above command tries to use previous mountoptions which were read via .show_options(). Thanks, > >> >>> else >>> - seq_puts(seq, ",noextent_cache"); >>> + seq_puts(seq, ",no_read_extent_cache"); >> >> Ditto, >> >> Thanks, >> >>> if (test_opt(sbi, DATA_FLUSH)) >>> seq_puts(seq, ",data_flush"); >>> @@ -2076,7 +2076,7 @@ static void default_options(struct f2fs_sb_info *sbi) >>> set_opt(sbi, INLINE_XATTR); >>> set_opt(sbi, INLINE_DATA); >>> set_opt(sbi, INLINE_DENTRY); >>> - set_opt(sbi, EXTENT_CACHE); >>> + set_opt(sbi, READ_EXTENT_CACHE); >>> set_opt(sbi, NOHEAP); >>> clear_opt(sbi, DISABLE_CHECKPOINT); >>> set_opt(sbi, MERGE_CHECKPOINT); >>> @@ -2218,7 +2218,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) >>> bool need_restart_ckpt = false, need_stop_ckpt = false; >>> bool need_restart_flush = false, need_stop_flush = false; >>> bool need_restart_discard = false, need_stop_discard = false; >>> - bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE); >>> + bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE); >>> bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT); >>> bool no_io_align = !F2FS_IO_ALIGNED(sbi); >>> bool no_atgc = !test_opt(sbi, ATGC); >>> @@ -2308,7 +2308,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) >>> } >>> /* disallow enable/disable extent_cache dynamically */ >>> - if (no_extent_cache == !!test_opt(sbi, EXTENT_CACHE)) { >>> + if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) { >>> err = -EINVAL; >>> f2fs_warn(sbi, "switch extent_cache option is not allowed"); >>> goto restore_opts;
On 12/09, Chao Yu wrote: > On 2022/12/9 1:29, Jaegeuk Kim wrote: > > On 12/08, Chao Yu wrote: > > > On 2022/12/6 2:54, Jaegeuk Kim wrote: > > > > Let's descrbie it's read extent cache. > > > > > > > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> > > > > --- > > > > fs/f2fs/extent_cache.c | 4 ++-- > > > > fs/f2fs/f2fs.h | 10 +++++----- > > > > fs/f2fs/inode.c | 2 +- > > > > fs/f2fs/node.c | 2 +- > > > > fs/f2fs/node.h | 2 +- > > > > fs/f2fs/segment.c | 4 ++-- > > > > fs/f2fs/super.c | 16 ++++++++-------- > > > > 7 files changed, 20 insertions(+), 20 deletions(-) > > > > > > > > diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c > > > > index 932c070173b9..8cd87aee0292 100644 > > > > --- a/fs/f2fs/extent_cache.c > > > > +++ b/fs/f2fs/extent_cache.c > > > > @@ -383,7 +383,7 @@ static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage) > > > > if (!i_ext || !i_ext->len) > > > > return; > > > > - get_extent_info(&ei, i_ext); > > > > + get_read_extent_info(&ei, i_ext); > > > > write_lock(&et->lock); > > > > if (atomic_read(&et->node_cnt)) > > > > @@ -710,7 +710,7 @@ unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink) > > > > unsigned int node_cnt = 0, tree_cnt = 0; > > > > int remained; > > > > - if (!test_opt(sbi, EXTENT_CACHE)) > > > > + if (!test_opt(sbi, READ_EXTENT_CACHE)) > > > > return 0; > > > > if (!atomic_read(&sbi->total_zombie_tree)) > > > > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h > > > > index eb8c27c4e5fc..1c39f8145b61 100644 > > > > --- a/fs/f2fs/f2fs.h > > > > +++ b/fs/f2fs/f2fs.h > > > > @@ -92,7 +92,7 @@ extern const char *f2fs_fault_name[FAULT_MAX]; > > > > #define F2FS_MOUNT_FLUSH_MERGE 0x00000400 > > > > #define F2FS_MOUNT_NOBARRIER 0x00000800 > > > > #define F2FS_MOUNT_FASTBOOT 0x00001000 > > > > -#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 > > > > +#define F2FS_MOUNT_READ_EXTENT_CACHE 0x00002000 > > > > #define F2FS_MOUNT_DATA_FLUSH 0x00008000 > > > > #define F2FS_MOUNT_FAULT_INJECTION 0x00010000 > > > > #define F2FS_MOUNT_USRQUOTA 0x00080000 > > > > @@ -600,7 +600,7 @@ enum { > > > > #define F2FS_MIN_EXTENT_LEN 64 /* minimum extent length */ > > > > /* number of extent info in extent cache we try to shrink */ > > > > -#define EXTENT_CACHE_SHRINK_NUMBER 128 > > > > +#define READ_EXTENT_CACHE_SHRINK_NUMBER 128 > > > > #define RECOVERY_MAX_RA_BLOCKS BIO_MAX_VECS > > > > #define RECOVERY_MIN_RA_BLOCKS 1 > > > > @@ -830,7 +830,7 @@ struct f2fs_inode_info { > > > > loff_t original_i_size; /* original i_size before atomic write */ > > > > }; > > > > -static inline void get_extent_info(struct extent_info *ext, > > > > +static inline void get_read_extent_info(struct extent_info *ext, > > > > struct f2fs_extent *i_ext) > > > > { > > > > ext->fofs = le32_to_cpu(i_ext->fofs); > > > > @@ -838,7 +838,7 @@ static inline void get_extent_info(struct extent_info *ext, > > > > ext->len = le32_to_cpu(i_ext->len); > > > > } > > > > -static inline void set_raw_extent(struct extent_info *ext, > > > > +static inline void set_raw_read_extent(struct extent_info *ext, > > > > struct f2fs_extent *i_ext) > > > > { > > > > i_ext->fofs = cpu_to_le32(ext->fofs); > > > > @@ -4407,7 +4407,7 @@ static inline bool f2fs_may_extent_tree(struct inode *inode) > > > > { > > > > struct f2fs_sb_info *sbi = F2FS_I_SB(inode); > > > > - if (!test_opt(sbi, EXTENT_CACHE) || > > > > + if (!test_opt(sbi, READ_EXTENT_CACHE) || > > > > is_inode_flag_set(inode, FI_NO_EXTENT) || > > > > (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && > > > > !f2fs_sb_has_readonly(sbi))) > > > > diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c > > > > index 577f109b4e1d..2c705c60019b 100644 > > > > --- a/fs/f2fs/inode.c > > > > +++ b/fs/f2fs/inode.c > > > > @@ -629,7 +629,7 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) > > > > if (et) { > > > > read_lock(&et->lock); > > > > - set_raw_extent(&et->largest, &ri->i_ext); > > > > + set_raw_read_extent(&et->largest, &ri->i_ext); > > > > read_unlock(&et->lock); > > > > } else { > > > > memset(&ri->i_ext, 0, sizeof(ri->i_ext)); > > > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > > > > index b9ee5a1176a0..84b147966080 100644 > > > > --- a/fs/f2fs/node.c > > > > +++ b/fs/f2fs/node.c > > > > @@ -85,7 +85,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type) > > > > sizeof(struct ino_entry); > > > > mem_size >>= PAGE_SHIFT; > > > > res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1); > > > > - } else if (type == EXTENT_CACHE) { > > > > + } else if (type == READ_EXTENT_CACHE) { > > > > mem_size = (atomic_read(&sbi->total_ext_tree) * > > > > sizeof(struct extent_tree) + > > > > atomic_read(&sbi->total_ext_node) * > > > > diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h > > > > index 3c09cae058b0..0aa48704c77a 100644 > > > > --- a/fs/f2fs/node.h > > > > +++ b/fs/f2fs/node.h > > > > @@ -146,7 +146,7 @@ enum mem_type { > > > > NAT_ENTRIES, /* indicates the cached nat entry */ > > > > DIRTY_DENTS, /* indicates dirty dentry pages */ > > > > INO_ENTRIES, /* indicates inode entries */ > > > > - EXTENT_CACHE, /* indicates extent cache */ > > > > + READ_EXTENT_CACHE, /* indicates read extent cache */ > > > > DISCARD_CACHE, /* indicates memory of cached discard cmds */ > > > > COMPRESS_PAGE, /* indicates memory of cached compressed pages */ > > > > BASE_CHECK, /* check kernel status */ > > > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > > > > index 9486ca49ecb1..51de358bc452 100644 > > > > --- a/fs/f2fs/segment.c > > > > +++ b/fs/f2fs/segment.c > > > > @@ -449,8 +449,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg) > > > > return; > > > > /* try to shrink extent cache when there is no enough memory */ > > > > - if (!f2fs_available_free_memory(sbi, EXTENT_CACHE)) > > > > - f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER); > > > > + if (!f2fs_available_free_memory(sbi, READ_EXTENT_CACHE)) > > > > + f2fs_shrink_extent_tree(sbi, READ_EXTENT_CACHE_SHRINK_NUMBER); > > > > /* check the # of cached NAT entries */ > > > > if (!f2fs_available_free_memory(sbi, NAT_ENTRIES)) > > > > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c > > > > index 79bf1faf4161..10bd03bbefec 100644 > > > > --- a/fs/f2fs/super.c > > > > +++ b/fs/f2fs/super.c > > > > @@ -814,10 +814,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) > > > > set_opt(sbi, FASTBOOT); > > > > break; > > > > case Opt_extent_cache: > > > > - set_opt(sbi, EXTENT_CACHE); > > > > + set_opt(sbi, READ_EXTENT_CACHE); > > > > break; > > > > case Opt_noextent_cache: > > > > - clear_opt(sbi, EXTENT_CACHE); > > > > + clear_opt(sbi, READ_EXTENT_CACHE); > > > > break; > > > > case Opt_noinline_data: > > > > clear_opt(sbi, INLINE_DATA); > > > > @@ -1954,10 +1954,10 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) > > > > seq_puts(seq, ",barrier"); > > > > if (test_opt(sbi, FASTBOOT)) > > > > seq_puts(seq, ",fastboot"); > > > > - if (test_opt(sbi, EXTENT_CACHE)) > > > > - seq_puts(seq, ",extent_cache"); > > > > + if (test_opt(sbi, READ_EXTENT_CACHE)) > > > > + seq_puts(seq, ",read_extent_cache"); > > > > > > How about keeping consistent w/ description of f2fs.rst? > > > > This doesn't change the mount options, but do show the exact name which > > would be better to say what's going on. > > mount -t f2fs /dev/vda /mnt/f2fs > mount|grep f2fs > /dev/vda on /mnt/f2fs type f2fs (rw,relatime,lazytime,background_gc=on,discard,no_heap,user_xattr,inline_xattr,acl,inline_data,inline_dentry,flush_merge,barrier,read_extent_cache,mode=adaptive,active_logs=6,alloc_mode=reuse,check) > > mount -t f2fs -o remount /mnt/f2fs/ > [ 63.142480] F2FS-fs (vda): Unrecognized mount option "read_extent_cache" or missing value > > Quoted from manual of mount > > "mount -o remount,rw /dir > > After this call, mount reads fstab and merges these options with the options > from the command line (-o). If no mountpoint is found in fstab, then a > remount with unspecified source is allowed." > > I guess above command tries to use previous mountoptions which were read > via .show_options(). Oh, great. Let me fix this. > > Thanks, > > > > > > > > > > else > > > > - seq_puts(seq, ",noextent_cache"); > > > > + seq_puts(seq, ",no_read_extent_cache"); > > > > > > Ditto, > > > > > > Thanks, > > > > > > > if (test_opt(sbi, DATA_FLUSH)) > > > > seq_puts(seq, ",data_flush"); > > > > @@ -2076,7 +2076,7 @@ static void default_options(struct f2fs_sb_info *sbi) > > > > set_opt(sbi, INLINE_XATTR); > > > > set_opt(sbi, INLINE_DATA); > > > > set_opt(sbi, INLINE_DENTRY); > > > > - set_opt(sbi, EXTENT_CACHE); > > > > + set_opt(sbi, READ_EXTENT_CACHE); > > > > set_opt(sbi, NOHEAP); > > > > clear_opt(sbi, DISABLE_CHECKPOINT); > > > > set_opt(sbi, MERGE_CHECKPOINT); > > > > @@ -2218,7 +2218,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) > > > > bool need_restart_ckpt = false, need_stop_ckpt = false; > > > > bool need_restart_flush = false, need_stop_flush = false; > > > > bool need_restart_discard = false, need_stop_discard = false; > > > > - bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE); > > > > + bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE); > > > > bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT); > > > > bool no_io_align = !F2FS_IO_ALIGNED(sbi); > > > > bool no_atgc = !test_opt(sbi, ATGC); > > > > @@ -2308,7 +2308,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) > > > > } > > > > /* disallow enable/disable extent_cache dynamically */ > > > > - if (no_extent_cache == !!test_opt(sbi, EXTENT_CACHE)) { > > > > + if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) { > > > > err = -EINVAL; > > > > f2fs_warn(sbi, "switch extent_cache option is not allowed"); > > > > goto restore_opts;
Let's descrbie it's read extent cache.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
Change log from v1:
- keep showing the mount option
fs/f2fs/extent_cache.c | 4 ++--
fs/f2fs/f2fs.h | 10 +++++-----
fs/f2fs/inode.c | 2 +-
fs/f2fs/node.c | 2 +-
fs/f2fs/node.h | 2 +-
fs/f2fs/segment.c | 4 ++--
fs/f2fs/super.c | 12 ++++++------
7 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c
index 932c070173b9..8cd87aee0292 100644
--- a/fs/f2fs/extent_cache.c
+++ b/fs/f2fs/extent_cache.c
@@ -383,7 +383,7 @@ static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage)
if (!i_ext || !i_ext->len)
return;
- get_extent_info(&ei, i_ext);
+ get_read_extent_info(&ei, i_ext);
write_lock(&et->lock);
if (atomic_read(&et->node_cnt))
@@ -710,7 +710,7 @@ unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink)
unsigned int node_cnt = 0, tree_cnt = 0;
int remained;
- if (!test_opt(sbi, EXTENT_CACHE))
+ if (!test_opt(sbi, READ_EXTENT_CACHE))
return 0;
if (!atomic_read(&sbi->total_zombie_tree))
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index eb8c27c4e5fc..1c39f8145b61 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -92,7 +92,7 @@ extern const char *f2fs_fault_name[FAULT_MAX];
#define F2FS_MOUNT_FLUSH_MERGE 0x00000400
#define F2FS_MOUNT_NOBARRIER 0x00000800
#define F2FS_MOUNT_FASTBOOT 0x00001000
-#define F2FS_MOUNT_EXTENT_CACHE 0x00002000
+#define F2FS_MOUNT_READ_EXTENT_CACHE 0x00002000
#define F2FS_MOUNT_DATA_FLUSH 0x00008000
#define F2FS_MOUNT_FAULT_INJECTION 0x00010000
#define F2FS_MOUNT_USRQUOTA 0x00080000
@@ -600,7 +600,7 @@ enum {
#define F2FS_MIN_EXTENT_LEN 64 /* minimum extent length */
/* number of extent info in extent cache we try to shrink */
-#define EXTENT_CACHE_SHRINK_NUMBER 128
+#define READ_EXTENT_CACHE_SHRINK_NUMBER 128
#define RECOVERY_MAX_RA_BLOCKS BIO_MAX_VECS
#define RECOVERY_MIN_RA_BLOCKS 1
@@ -830,7 +830,7 @@ struct f2fs_inode_info {
loff_t original_i_size; /* original i_size before atomic write */
};
-static inline void get_extent_info(struct extent_info *ext,
+static inline void get_read_extent_info(struct extent_info *ext,
struct f2fs_extent *i_ext)
{
ext->fofs = le32_to_cpu(i_ext->fofs);
@@ -838,7 +838,7 @@ static inline void get_extent_info(struct extent_info *ext,
ext->len = le32_to_cpu(i_ext->len);
}
-static inline void set_raw_extent(struct extent_info *ext,
+static inline void set_raw_read_extent(struct extent_info *ext,
struct f2fs_extent *i_ext)
{
i_ext->fofs = cpu_to_le32(ext->fofs);
@@ -4407,7 +4407,7 @@ static inline bool f2fs_may_extent_tree(struct inode *inode)
{
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
- if (!test_opt(sbi, EXTENT_CACHE) ||
+ if (!test_opt(sbi, READ_EXTENT_CACHE) ||
is_inode_flag_set(inode, FI_NO_EXTENT) ||
(is_inode_flag_set(inode, FI_COMPRESSED_FILE) &&
!f2fs_sb_has_readonly(sbi)))
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 577f109b4e1d..2c705c60019b 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -629,7 +629,7 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page)
if (et) {
read_lock(&et->lock);
- set_raw_extent(&et->largest, &ri->i_ext);
+ set_raw_read_extent(&et->largest, &ri->i_ext);
read_unlock(&et->lock);
} else {
memset(&ri->i_ext, 0, sizeof(ri->i_ext));
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index b9ee5a1176a0..84b147966080 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -85,7 +85,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type)
sizeof(struct ino_entry);
mem_size >>= PAGE_SHIFT;
res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1);
- } else if (type == EXTENT_CACHE) {
+ } else if (type == READ_EXTENT_CACHE) {
mem_size = (atomic_read(&sbi->total_ext_tree) *
sizeof(struct extent_tree) +
atomic_read(&sbi->total_ext_node) *
diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h
index 3c09cae058b0..0aa48704c77a 100644
--- a/fs/f2fs/node.h
+++ b/fs/f2fs/node.h
@@ -146,7 +146,7 @@ enum mem_type {
NAT_ENTRIES, /* indicates the cached nat entry */
DIRTY_DENTS, /* indicates dirty dentry pages */
INO_ENTRIES, /* indicates inode entries */
- EXTENT_CACHE, /* indicates extent cache */
+ READ_EXTENT_CACHE, /* indicates read extent cache */
DISCARD_CACHE, /* indicates memory of cached discard cmds */
COMPRESS_PAGE, /* indicates memory of cached compressed pages */
BASE_CHECK, /* check kernel status */
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 9486ca49ecb1..51de358bc452 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -449,8 +449,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg)
return;
/* try to shrink extent cache when there is no enough memory */
- if (!f2fs_available_free_memory(sbi, EXTENT_CACHE))
- f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER);
+ if (!f2fs_available_free_memory(sbi, READ_EXTENT_CACHE))
+ f2fs_shrink_extent_tree(sbi, READ_EXTENT_CACHE_SHRINK_NUMBER);
/* check the # of cached NAT entries */
if (!f2fs_available_free_memory(sbi, NAT_ENTRIES))
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 79bf1faf4161..412c2e7352c0 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -814,10 +814,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount)
set_opt(sbi, FASTBOOT);
break;
case Opt_extent_cache:
- set_opt(sbi, EXTENT_CACHE);
+ set_opt(sbi, READ_EXTENT_CACHE);
break;
case Opt_noextent_cache:
- clear_opt(sbi, EXTENT_CACHE);
+ clear_opt(sbi, READ_EXTENT_CACHE);
break;
case Opt_noinline_data:
clear_opt(sbi, INLINE_DATA);
@@ -1954,7 +1954,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
seq_puts(seq, ",barrier");
if (test_opt(sbi, FASTBOOT))
seq_puts(seq, ",fastboot");
- if (test_opt(sbi, EXTENT_CACHE))
+ if (test_opt(sbi, READ_EXTENT_CACHE))
seq_puts(seq, ",extent_cache");
else
seq_puts(seq, ",noextent_cache");
@@ -2076,7 +2076,7 @@ static void default_options(struct f2fs_sb_info *sbi)
set_opt(sbi, INLINE_XATTR);
set_opt(sbi, INLINE_DATA);
set_opt(sbi, INLINE_DENTRY);
- set_opt(sbi, EXTENT_CACHE);
+ set_opt(sbi, READ_EXTENT_CACHE);
set_opt(sbi, NOHEAP);
clear_opt(sbi, DISABLE_CHECKPOINT);
set_opt(sbi, MERGE_CHECKPOINT);
@@ -2218,7 +2218,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
bool need_restart_ckpt = false, need_stop_ckpt = false;
bool need_restart_flush = false, need_stop_flush = false;
bool need_restart_discard = false, need_stop_discard = false;
- bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE);
+ bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE);
bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT);
bool no_io_align = !F2FS_IO_ALIGNED(sbi);
bool no_atgc = !test_opt(sbi, ATGC);
@@ -2308,7 +2308,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
}
/* disallow enable/disable extent_cache dynamically */
- if (no_extent_cache == !!test_opt(sbi, EXTENT_CACHE)) {
+ if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) {
err = -EINVAL;
f2fs_warn(sbi, "switch extent_cache option is not allowed");
goto restore_opts;
On 2022/12/10 3:40, Jaegeuk Kim wrote: > Let's descrbie it's read extent cache. > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c index 932c070173b9..8cd87aee0292 100644 --- a/fs/f2fs/extent_cache.c +++ b/fs/f2fs/extent_cache.c @@ -383,7 +383,7 @@ static void __f2fs_init_extent_tree(struct inode *inode, struct page *ipage) if (!i_ext || !i_ext->len) return; - get_extent_info(&ei, i_ext); + get_read_extent_info(&ei, i_ext); write_lock(&et->lock); if (atomic_read(&et->node_cnt)) @@ -710,7 +710,7 @@ unsigned int f2fs_shrink_extent_tree(struct f2fs_sb_info *sbi, int nr_shrink) unsigned int node_cnt = 0, tree_cnt = 0; int remained; - if (!test_opt(sbi, EXTENT_CACHE)) + if (!test_opt(sbi, READ_EXTENT_CACHE)) return 0; if (!atomic_read(&sbi->total_zombie_tree)) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index eb8c27c4e5fc..1c39f8145b61 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -92,7 +92,7 @@ extern const char *f2fs_fault_name[FAULT_MAX]; #define F2FS_MOUNT_FLUSH_MERGE 0x00000400 #define F2FS_MOUNT_NOBARRIER 0x00000800 #define F2FS_MOUNT_FASTBOOT 0x00001000 -#define F2FS_MOUNT_EXTENT_CACHE 0x00002000 +#define F2FS_MOUNT_READ_EXTENT_CACHE 0x00002000 #define F2FS_MOUNT_DATA_FLUSH 0x00008000 #define F2FS_MOUNT_FAULT_INJECTION 0x00010000 #define F2FS_MOUNT_USRQUOTA 0x00080000 @@ -600,7 +600,7 @@ enum { #define F2FS_MIN_EXTENT_LEN 64 /* minimum extent length */ /* number of extent info in extent cache we try to shrink */ -#define EXTENT_CACHE_SHRINK_NUMBER 128 +#define READ_EXTENT_CACHE_SHRINK_NUMBER 128 #define RECOVERY_MAX_RA_BLOCKS BIO_MAX_VECS #define RECOVERY_MIN_RA_BLOCKS 1 @@ -830,7 +830,7 @@ struct f2fs_inode_info { loff_t original_i_size; /* original i_size before atomic write */ }; -static inline void get_extent_info(struct extent_info *ext, +static inline void get_read_extent_info(struct extent_info *ext, struct f2fs_extent *i_ext) { ext->fofs = le32_to_cpu(i_ext->fofs); @@ -838,7 +838,7 @@ static inline void get_extent_info(struct extent_info *ext, ext->len = le32_to_cpu(i_ext->len); } -static inline void set_raw_extent(struct extent_info *ext, +static inline void set_raw_read_extent(struct extent_info *ext, struct f2fs_extent *i_ext) { i_ext->fofs = cpu_to_le32(ext->fofs); @@ -4407,7 +4407,7 @@ static inline bool f2fs_may_extent_tree(struct inode *inode) { struct f2fs_sb_info *sbi = F2FS_I_SB(inode); - if (!test_opt(sbi, EXTENT_CACHE) || + if (!test_opt(sbi, READ_EXTENT_CACHE) || is_inode_flag_set(inode, FI_NO_EXTENT) || (is_inode_flag_set(inode, FI_COMPRESSED_FILE) && !f2fs_sb_has_readonly(sbi))) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 577f109b4e1d..2c705c60019b 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -629,7 +629,7 @@ void f2fs_update_inode(struct inode *inode, struct page *node_page) if (et) { read_lock(&et->lock); - set_raw_extent(&et->largest, &ri->i_ext); + set_raw_read_extent(&et->largest, &ri->i_ext); read_unlock(&et->lock); } else { memset(&ri->i_ext, 0, sizeof(ri->i_ext)); diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index b9ee5a1176a0..84b147966080 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -85,7 +85,7 @@ bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type) sizeof(struct ino_entry); mem_size >>= PAGE_SHIFT; res = mem_size < ((avail_ram * nm_i->ram_thresh / 100) >> 1); - } else if (type == EXTENT_CACHE) { + } else if (type == READ_EXTENT_CACHE) { mem_size = (atomic_read(&sbi->total_ext_tree) * sizeof(struct extent_tree) + atomic_read(&sbi->total_ext_node) * diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h index 3c09cae058b0..0aa48704c77a 100644 --- a/fs/f2fs/node.h +++ b/fs/f2fs/node.h @@ -146,7 +146,7 @@ enum mem_type { NAT_ENTRIES, /* indicates the cached nat entry */ DIRTY_DENTS, /* indicates dirty dentry pages */ INO_ENTRIES, /* indicates inode entries */ - EXTENT_CACHE, /* indicates extent cache */ + READ_EXTENT_CACHE, /* indicates read extent cache */ DISCARD_CACHE, /* indicates memory of cached discard cmds */ COMPRESS_PAGE, /* indicates memory of cached compressed pages */ BASE_CHECK, /* check kernel status */ diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 9486ca49ecb1..51de358bc452 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -449,8 +449,8 @@ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi, bool from_bg) return; /* try to shrink extent cache when there is no enough memory */ - if (!f2fs_available_free_memory(sbi, EXTENT_CACHE)) - f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER); + if (!f2fs_available_free_memory(sbi, READ_EXTENT_CACHE)) + f2fs_shrink_extent_tree(sbi, READ_EXTENT_CACHE_SHRINK_NUMBER); /* check the # of cached NAT entries */ if (!f2fs_available_free_memory(sbi, NAT_ENTRIES)) diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 79bf1faf4161..10bd03bbefec 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -814,10 +814,10 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) set_opt(sbi, FASTBOOT); break; case Opt_extent_cache: - set_opt(sbi, EXTENT_CACHE); + set_opt(sbi, READ_EXTENT_CACHE); break; case Opt_noextent_cache: - clear_opt(sbi, EXTENT_CACHE); + clear_opt(sbi, READ_EXTENT_CACHE); break; case Opt_noinline_data: clear_opt(sbi, INLINE_DATA); @@ -1954,10 +1954,10 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) seq_puts(seq, ",barrier"); if (test_opt(sbi, FASTBOOT)) seq_puts(seq, ",fastboot"); - if (test_opt(sbi, EXTENT_CACHE)) - seq_puts(seq, ",extent_cache"); + if (test_opt(sbi, READ_EXTENT_CACHE)) + seq_puts(seq, ",read_extent_cache"); else - seq_puts(seq, ",noextent_cache"); + seq_puts(seq, ",no_read_extent_cache"); if (test_opt(sbi, DATA_FLUSH)) seq_puts(seq, ",data_flush"); @@ -2076,7 +2076,7 @@ static void default_options(struct f2fs_sb_info *sbi) set_opt(sbi, INLINE_XATTR); set_opt(sbi, INLINE_DATA); set_opt(sbi, INLINE_DENTRY); - set_opt(sbi, EXTENT_CACHE); + set_opt(sbi, READ_EXTENT_CACHE); set_opt(sbi, NOHEAP); clear_opt(sbi, DISABLE_CHECKPOINT); set_opt(sbi, MERGE_CHECKPOINT); @@ -2218,7 +2218,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) bool need_restart_ckpt = false, need_stop_ckpt = false; bool need_restart_flush = false, need_stop_flush = false; bool need_restart_discard = false, need_stop_discard = false; - bool no_extent_cache = !test_opt(sbi, EXTENT_CACHE); + bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE); bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT); bool no_io_align = !F2FS_IO_ALIGNED(sbi); bool no_atgc = !test_opt(sbi, ATGC); @@ -2308,7 +2308,7 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) } /* disallow enable/disable extent_cache dynamically */ - if (no_extent_cache == !!test_opt(sbi, EXTENT_CACHE)) { + if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) { err = -EINVAL; f2fs_warn(sbi, "switch extent_cache option is not allowed"); goto restore_opts;