Skip to contentSkip to conversation

erofs: misc cleanups for fscache mode

PATCH In review Jingbo Xu 3 participants 7 messages Jan 12, 2023 – Jan 16, 2023

Subsystems (2)
lore
Share & tools
lore

Jingbo Xu

author
#0 lore raw

v2 cover erofs: misc cleanups for fscache mode

changelog
v2:
- patch 1: polish the commit message and documentation (Gao Xiang); add "Reviewed-by" tags
- patch 2: add "Reviewed-by" tags

Some trivial cleanups for fscache mode.

Jingbo Xu (2):
erofs: add documentation for 'domain_id' mount option
erofs: clean up parsing of fscache related options

 Documentation/filesystems/erofs.rst |  2 ++
 fs/erofs/super.c                    | 13 ++++++-------
 2 files changed, 8 insertions(+), 7 deletions(-)
Signature · 1 line
2.19.1.6.gb485710b
author
#1 lore raw

PATCH v2 1/2 erofs: add documentation for 'domain_id' mount option

Since the EROFS share domain feature for fscache mode has been available since Linux v6.1, let's add documentation for 'domain_id' mount option.

---
 Documentation/filesystems/erofs.rst | 2 ++
 1 file changed, 2 insertions(+)
Documentation/filesystems/erofs.rst +2 -0
index 067fd1670b1f..a43aacf1494e 100644
@@ -120,6 +120,8 @@ dax={always,never}     Use direct access (no page cache).  See
 dax                    A legacy option which is an alias for ``dax=always``.
 device=%s              Specify a path to an extra device to be used together.
 fsid=%s                Specify a filesystem image ID for Fscache back-end.
+domain_id=%s           Specify a domain ID in fscache mode so that different images
+                       with the same blobs under a given domain ID can share storage.
 ===================    =========================================================
 
 Sysfs Entries
Signature · 1 line
2.19.1.6.gb485710b
author
#2 lore raw

Re: [PATCH v2 1/2] erofs: add documentation for 'domain_id' mount option

Quoted 23 lines · Jingbo Xu

Since the EROFS share domain feature for fscache mode has been available since Linux v6.1, let's add documentation for 'domain_id' mount option.

---
 Documentation/filesystems/erofs.rst | 2 ++
 1 file changed, 2 insertions(+)
Documentation/filesystems/erofs.rst +2 -0
index 067fd1670b1f..a43aacf1494e 100644
@@ -120,6 +120,8 @@ dax={always,never}     Use direct access (no page cache).  See
 dax                    A legacy option which is an alias for ``dax=always``.
 device=%s              Specify a path to an extra device to be used together.
 fsid=%s                Specify a filesystem image ID for Fscache back-end.
+domain_id=%s           Specify a domain ID in fscache mode so that different images
+                       with the same blobs under a given domain ID can share storage.
 ===================    =========================================================
 
 Sysfs Entries
Signature · 2 lines
Thanks,
Jingbo
Reviewed-by on v2 1/2
#3 lore raw

Re: [PATCH v2 1/2] erofs: add documentation for 'domain_id' mount option

In reply to Jingbo Xu
Quoted 6 lines · Jingbo Xu

Since the EROFS share domain feature for fscache mode has been available since Linux v6.1, let's add documentation for 'domain_id' mount option.

Thanks,
Gao Xiang

Quoted 17 lines
---
  Documentation/filesystems/erofs.rst | 2 ++
  1 file changed, 2 insertions(+)
Documentation/filesystems/erofs.rst +2 -0
index 067fd1670b1f..a43aacf1494e 100644
@@ -120,6 +120,8 @@ dax={always,never}     Use direct access (no page cache).  See
  dax                    A legacy option which is an alias for ``dax=always``.
  device=%s              Specify a path to an extra device to be used together.
  fsid=%s                Specify a filesystem image ID for Fscache back-end.
+domain_id=%s           Specify a domain ID in fscache mode so that different images
+                       with the same blobs under a given domain ID can share storage.
  ===================    =========================================================
 
  Sysfs Entries
author
#5 lore raw

PATCH v2 2/2 erofs: clean up parsing of fscache related options

In reply to Jingbo Xu

... to avoid the mess of conditional preprocessing as we are continually adding fscache related mount options.

---
 fs/erofs/super.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
fs/erofs/super.c +6 -7
index 481788c24a68..626a615dafc2 100644
@@ -577,26 +577,25 @@ static int erofs_fc_parse_param(struct fs_context *fc,
 		}
 		++ctx->devs->extra_devices;
 		break;
-	case Opt_fsid:
 #ifdef CONFIG_EROFS_FS_ONDEMAND
+	case Opt_fsid:
 		kfree(ctx->fsid);
 		ctx->fsid = kstrdup(param->string, GFP_KERNEL);
 		if (!ctx->fsid)
 			return -ENOMEM;
-#else
-		errorfc(fc, "fsid option not supported");
-#endif
 		break;
 	case Opt_domain_id:
-#ifdef CONFIG_EROFS_FS_ONDEMAND
 		kfree(ctx->domain_id);
 		ctx->domain_id = kstrdup(param->string, GFP_KERNEL);
 		if (!ctx->domain_id)
 			return -ENOMEM;
+		break;
 #else
-		errorfc(fc, "domain_id option not supported");
-#endif
+	case Opt_fsid:
+	case Opt_domain_id:
+		errorfc(fc, "%s option not supported", erofs_fs_parameters[opt].name);
 		break;
+#endif
 	default:
 		return -ENOPARAM;
 	}
Signature · 1 line
2.19.1.6.gb485710b