Skip to contentSkip to conversation

erofs: misc cleanups for fscache mode

PATCH Superseded Jingbo Xu 4 participants 8 messages Jan 11, 2023 – Jan 12, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
author
#1 lore raw

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

In reply to Jingbo Xu

The share domain feature for fscache mode has been merged, and let's add documentation for 'domain_id' mount option.

---
 Documentation/filesystems/erofs.rst | 3 +++
 1 file changed, 3 insertions(+)
Documentation/filesystems/erofs.rst +3 -0
index 067fd1670b1f..958cad2c4997 100644
@@ -120,6 +120,9 @@ 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 for Fscache back-end.  The blob
+                       images are shared among filesystem instances in the same
+                       domain.
 ===================    =========================================================
 
 Sysfs Entries
Signature · 1 line
2.19.1.6.gb485710b

Jingbo Xu

author
#0 lore raw

cover erofs: misc cleanups for fscache mode

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 |  3 +++
 fs/erofs/super.c                    | 13 ++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)
Signature · 1 line
2.19.1.6.gb485710b
author
#4 lore raw

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

... 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
Reviewed-by on v1 1/2
#2 lore raw

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

In reply to Jingbo Xu
Quoted 4 lines · Jingbo Xu

The share domain feature for fscache mode has been merged, and let's add documentation for 'domain_id' mount option.

Thanks.

Quoted 18 lines
---
  Documentation/filesystems/erofs.rst | 3 +++
  1 file changed, 3 insertions(+)
Documentation/filesystems/erofs.rst +3 -0
index 067fd1670b1f..958cad2c4997 100644
@@ -120,6 +120,9 @@ 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 for Fscache back-end.  The blob
+                       images are shared among filesystem instances in the same
+                       domain.
  ===================    =========================================================
 
  Sysfs Entries
#3 lore raw

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

In reply to Jingbo Xu
Quoted 2 lines · Jingbo Xu

The share domain feature for fscache mode has been merged, and let's 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.

Quoted 11 lines
---
  Documentation/filesystems/erofs.rst | 3 +++
  1 file changed, 3 insertions(+)
Documentation/filesystems/erofs.rst +0 -0
index 067fd1670b1f..958cad2c4997 100644

Documentation/filesystems/erofs.rst dax={always,never} Use direct access (no page cache). See · line 125

Quoted 6 lines
Documentation/filesystems/erofs.rst +3 -0
@@ -120,6 +120,9 @@ 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 for Fscache back-end.  The blob
+                       images are shared among filesystem instances in the same
+                       domain.

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.

Thanks,
Gao Xiang

Quoted 3 lines
Documentation/filesystems/erofs.rst +0 -0
  ===================    =========================================================
 
  Sysfs Entries
Reviewed-by on v1 2/2
#5 lore raw

Re: [External] [PATCH 2/2] erofs: clean up parsing of fscache related options

In reply to Jingbo Xu
Quoted 4 lines · Jingbo Xu

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

Thanks.

Quoted 41 lines
---
  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;
  	}