mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hongbo Li <lihongbo22@huawei.com>
To: Hongzhen Luo <hongzhen@linux.alibaba.com>,
	<linux-erofs@lists.ozlabs.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH v6 1/7] erofs: move `struct erofs_anon_fs_type` to super.c
Date: Sat, 22 Mar 2025 08:54:00 +0800	[thread overview]
Message-ID: <b235f795-3e1d-4a91-88dd-651bf9d75a17@huawei.com> (raw)
In-Reply-To: <20250301145002.2420830-2-hongzhen@linux.alibaba.com>



On 2025/3/1 22:49, Hongzhen Luo wrote:
> Move the `struct erofs_anon_fs_type` to the super.c and
> expose it in preparation for the upcoming page cache share
> feature.
> 
> Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>

Looks good. Feel free to add:

Reviewed-by: Hongbo Li <lihongbo22@huawei.com>

> ---
>   fs/erofs/fscache.c  | 13 -------------
>   fs/erofs/internal.h |  2 ++
>   fs/erofs/super.c    | 13 +++++++++++++
>   3 files changed, 15 insertions(+), 13 deletions(-)
> 
> diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c
> index ce3d8737df85..ae7bd9ebff38 100644
> --- a/fs/erofs/fscache.c
> +++ b/fs/erofs/fscache.c
> @@ -3,7 +3,6 @@
>    * Copyright (C) 2022, Alibaba Cloud
>    * Copyright (C) 2022, Bytedance Inc. All rights reserved.
>    */
> -#include <linux/pseudo_fs.h>
>   #include <linux/fscache.h>
>   #include "internal.h"
>   
> @@ -13,18 +12,6 @@ static LIST_HEAD(erofs_domain_list);
>   static LIST_HEAD(erofs_domain_cookies_list);
>   static struct vfsmount *erofs_pseudo_mnt;
>   
> -static int erofs_anon_init_fs_context(struct fs_context *fc)
> -{
> -	return init_pseudo(fc, EROFS_SUPER_MAGIC) ? 0 : -ENOMEM;
> -}
> -
> -static struct file_system_type erofs_anon_fs_type = {
> -	.owner		= THIS_MODULE,
> -	.name           = "pseudo_erofs",
> -	.init_fs_context = erofs_anon_init_fs_context,
> -	.kill_sb        = kill_anon_super,
> -};
> -
>   struct erofs_fscache_io {
>   	struct netfs_cache_resources cres;
>   	struct iov_iter		iter;
> diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
> index 686d835eb533..47004eb89838 100644
> --- a/fs/erofs/internal.h
> +++ b/fs/erofs/internal.h
> @@ -379,6 +379,8 @@ extern const struct file_operations erofs_dir_fops;
>   
>   extern const struct iomap_ops z_erofs_iomap_report_ops;
>   
> +extern struct file_system_type erofs_anon_fs_type;
> +
>   /* flags for erofs_fscache_register_cookie() */
>   #define EROFS_REG_COOKIE_SHARE		0x0001
>   #define EROFS_REG_COOKIE_NEED_NOEXIST	0x0002
> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
> index 827b62665649..eb052a770088 100644
> --- a/fs/erofs/super.c
> +++ b/fs/erofs/super.c
> @@ -11,6 +11,7 @@
>   #include <linux/fs_parser.h>
>   #include <linux/exportfs.h>
>   #include <linux/backing-dev.h>
> +#include <linux/pseudo_fs.h>
>   #include "xattr.h"
>   
>   #define CREATE_TRACE_POINTS
> @@ -850,6 +851,18 @@ static struct file_system_type erofs_fs_type = {
>   };
>   MODULE_ALIAS_FS("erofs");
>   
> +static int erofs_anon_init_fs_context(struct fs_context *fc)
> +{
> +	return init_pseudo(fc, EROFS_SUPER_MAGIC) ? 0 : -ENOMEM;
> +}
> +
> +struct file_system_type erofs_anon_fs_type = {
> +	.owner		= THIS_MODULE,
> +	.name           = "pseudo_erofs",
> +	.init_fs_context = erofs_anon_init_fs_context,
> +	.kill_sb        = kill_anon_super,
> +};
> +
>   static int __init erofs_module_init(void)
>   {
>   	int err;

  reply	other threads:[~2025-03-22  0:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01 14:49 [RFC PATCH v6 0/7] erofs: inode page cache share feature Hongzhen Luo
2025-03-01 14:49 ` [RFC PATCH v6 1/7] erofs: move `struct erofs_anon_fs_type` to super.c Hongzhen Luo
2025-03-22  0:54   ` Hongbo Li [this message]
2025-03-01 14:49 ` [RFC PATCH v6 2/7] erofs: support user-defined fingerprint name Hongzhen Luo
2025-03-01 14:49 ` [RFC PATCH v6 3/7] erofs: support domain-specific page cache share Hongzhen Luo
2025-03-01 14:49 ` [RFC PATCH v6 4/7] erofs: introduce the page cache share feature Hongzhen Luo
2025-03-01 14:49 ` [RFC PATCH v6 5/7] erofs: support unencoded inodes for page cache share Hongzhen Luo
2025-03-01 14:49 ` [RFC PATCH v6 6/7] erofs: support compressed " Hongzhen Luo
2025-03-01 14:49 ` [RFC PATCH v6 7/7] erofs: implement .fadvise " Hongzhen Luo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b235f795-3e1d-4a91-88dd-651bf9d75a17@huawei.com \
    --to=lihongbo22@huawei.com \
    --cc=hongzhen@linux.alibaba.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®