From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E67BFC4332F for ; Thu, 8 Dec 2022 17:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbiLHRaA (ORCPT ); Thu, 8 Dec 2022 12:30:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229593AbiLHR36 (ORCPT ); Thu, 8 Dec 2022 12:29:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B17AE9857F for ; Thu, 8 Dec 2022 09:29:57 -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 4DBCD60EA0 for ; Thu, 8 Dec 2022 17:29:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D757C433D2; Thu, 8 Dec 2022 17:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670520596; bh=qSA198bplUrIbdYGyPLtvL7kzzxiHPcIk4XswMN9Yzw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Iq8KU0WtPwZOWPLaGlHsBYp1bdGrxduZAK3WjPnKrnWMq2VsZfh7HHk2AephyDpYd EjsN1X+EKfJL+mEswxNpxPclz5TOg9x18ub0geFbEHOQgBsojIK6pIPylDjT5AAhcN NrJ65WHYNStknY4ZgXmWgkAT76w5i1LPyIpjanTudixDXJvUa49uIS4zXQ7mHrG0Vk uN1msctRq5OI8/lAqWTT+wuNjb/1qCM3LFGVZduWqWZlN/4eZIBXqQ9JwrtwsMmVLC RWwA0PGHKl3XX6oZfMv3zmoDycgUUtTyKOuVoOHuqp1q1H//9ibvqYtsEvOCHJLB7o /c8zwNFTF2Waw== Date: Thu, 8 Dec 2022 09:29:54 -0800 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH 1/6] f2fs: specify extent cache for read explicitly Message-ID: References: <20221205185433.3479699-1-jaegeuk@kernel.org> <8ffb43dd-3887-aa56-6f0a-1fb6ff0e191e@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ffb43dd-3887-aa56-6f0a-1fb6ff0e191e@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > --- > > 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; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C532BC4332F for ; Thu, 8 Dec 2022 17:30:28 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1p3Kj4-0007Fn-54; Thu, 08 Dec 2022 17:30:26 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p3Kii-0007FC-CE for linux-f2fs-devel@lists.sourceforge.net; Thu, 08 Dec 2022 17:30:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uZYSg+hVaTx2jNrt03k0iNmlHJoda16uqdaj7wlGZ3E=; b=TR4J7OBfmvc8AmILWhW7c0t9bp lbQ+FPnBfAMuvs75aegzsnFfsZMUOL6BEpQT0HKWR6lspQdkVRiMdQbD1r6C+zPWq83e8++SEHJi0 9ykXkx5rfcVX0vYGzeYkrKenXSto95ssAvsGzq0H/jo8HAkdy1W37jbDeU/MzXennELk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=uZYSg+hVaTx2jNrt03k0iNmlHJoda16uqdaj7wlGZ3E=; b=m2/0gSKMMZWo9gNcVpOV5bHKsc GuL0xFKIU6hBM8jOBfCHanS+Reu68xu9+da9T/OrP3aHh/2kEhK26x1SGEUiok/ac0mfPD4SwRxNx AwaXpZKis9Xro8+pGW0ngdXULH/y8vesLqclLUnz01VhjxKNxA/uXJ7t+JwPXbAjhIqU=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1p3Kih-00ARUy-FJ for linux-f2fs-devel@lists.sourceforge.net; Thu, 08 Dec 2022 17:30:04 +0000 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 452AF61F5B for ; Thu, 8 Dec 2022 17:29:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D757C433D2; Thu, 8 Dec 2022 17:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670520596; bh=qSA198bplUrIbdYGyPLtvL7kzzxiHPcIk4XswMN9Yzw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Iq8KU0WtPwZOWPLaGlHsBYp1bdGrxduZAK3WjPnKrnWMq2VsZfh7HHk2AephyDpYd EjsN1X+EKfJL+mEswxNpxPclz5TOg9x18ub0geFbEHOQgBsojIK6pIPylDjT5AAhcN NrJ65WHYNStknY4ZgXmWgkAT76w5i1LPyIpjanTudixDXJvUa49uIS4zXQ7mHrG0Vk uN1msctRq5OI8/lAqWTT+wuNjb/1qCM3LFGVZduWqWZlN/4eZIBXqQ9JwrtwsMmVLC RWwA0PGHKl3XX6oZfMv3zmoDycgUUtTyKOuVoOHuqp1q1H//9ibvqYtsEvOCHJLB7o /c8zwNFTF2Waw== Date: Thu, 8 Dec 2022 09:29:54 -0800 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20221205185433.3479699-1-jaegeuk@kernel.org> <8ffb43dd-3887-aa56-6f0a-1fb6ff0e191e@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <8ffb43dd-3887-aa56-6f0a-1fb6ff0e191e@kernel.org> X-Headers-End: 1p3Kih-00ARUy-FJ Subject: Re: [f2fs-dev] [PATCH 1/6] f2fs: specify extent cache for read explicitly X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 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 > > --- > > 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; _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel