mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hongzhen Luo <hongzhen@linux.alibaba.com>
To: linux-erofs@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org, Hongzhen Luo <hongzhen@linux.alibaba.com>
Subject: [RFC PATCH v6 3/7] erofs: support domain-specific page cache share
Date: Sat,  1 Mar 2025 22:49:40 +0800	[thread overview]
Message-ID: <20250301145002.2420830-4-hongzhen@linux.alibaba.com> (raw)
In-Reply-To: <20250301145002.2420830-1-hongzhen@linux.alibaba.com>

Only files in the same domain will share the page cache. Also modify
the sysfs related content in preparation for the upcoming page cache
share feature.

Signed-off-by: Hongzhen Luo <hongzhen@linux.alibaba.com>
---
 fs/erofs/super.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 6af02cc8b8c6..ceab0c29b061 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -489,6 +489,8 @@ static int erofs_fc_parse_param(struct fs_context *fc,
 		if (!sbi->fsid)
 			return -ENOMEM;
 		break;
+#endif
+#if defined(CONFIG_EROFS_FS_ONDEMAND) || defined(CONFIG_EROFS_FS_INODE_SHARE)
 	case Opt_domain_id:
 		kfree(sbi->domain_id);
 		sbi->domain_id = kstrdup(param->string, GFP_KERNEL);
@@ -558,16 +560,16 @@ static void erofs_set_sysfs_name(struct super_block *sb)
 {
 	struct erofs_sb_info *sbi = EROFS_SB(sb);
 
-	if (sbi->domain_id)
+	if (sbi->domain_id && !sbi->ishare_key)
 		super_set_sysfs_name_generic(sb, "%s,%s", sbi->domain_id,
 					     sbi->fsid);
 	else if (sbi->fsid)
 		super_set_sysfs_name_generic(sb, "%s", sbi->fsid);
-	else if (erofs_is_fileio_mode(sbi))
+	else if (!sb->s_bdi || !sb->s_bdi->dev)
+		super_set_sysfs_name_id(sb);
+	else
 		super_set_sysfs_name_generic(sb, "%s",
 					     bdi_dev_name(sb->s_bdi));
-	else
-		super_set_sysfs_name_id(sb);
 }
 
 static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
@@ -965,6 +967,8 @@ static int erofs_show_options(struct seq_file *seq, struct dentry *root)
 #ifdef CONFIG_EROFS_FS_ONDEMAND
 	if (sbi->fsid)
 		seq_printf(seq, ",fsid=%s", sbi->fsid);
+#endif
+#if defined(CONFIG_EROFS_FS_ONDEMAND) || defined(CONFIG_EROFS_FS_INODE_SHARE)
 	if (sbi->domain_id)
 		seq_printf(seq, ",domain_id=%s", sbi->domain_id);
 #endif
-- 
2.43.5


  parent reply	other threads:[~2025-03-01 14:50 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
2025-03-01 14:49 ` [RFC PATCH v6 2/7] erofs: support user-defined fingerprint name Hongzhen Luo
2025-03-01 14:49 ` Hongzhen Luo [this message]
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=20250301145002.2420830-4-hongzhen@linux.alibaba.com \
    --to=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®